示例#1
0
/* Handles the keyboard interrupt */
void	keyboard_handler(struct regs *r)
{
	uint8	scancode = inportb(0x60);

	spinlock_acquire(&kbd_lock);

// Do we have room for the scan code?
	if (((buf_head + 1) % KBD_BUFFER_SIZE) == buf_tail)
	{
		printf("kbd: buffer full, dropping scan code %02x\n", scancode);
	}
	else
	{
		kbd_buffer[buf_head] = scancode;
		buf_head = (buf_head + 1) % KBD_BUFFER_SIZE;
	}

	if (scancode == 0x58)	// F12 key
	{
		task_dump_list();
	}

	spinlock_release(&kbd_lock);

	// FIXME: Need to signal a DPC

	if (scancode == 0x46)	// seen during CTRL-BREAK.
	{
		hard_reboot();
	}
}
示例#2
0
JNIEXPORT jboolean JNICALL Java_org_waxbee_Teensy_hard_reboot(JNIEnv *env, jobject obj)
{
	int ret = hard_reboot();
	
	return ret?JNI_TRUE:JNI_FALSE;
}