示例#1
0
void console_putc(unsigned int ch, char c)
{
	struct console_device *cdev;
	int init = initialized;

	switch (init) {
	case CONSOLE_UNINITIALIZED:
		console_init_early();
		/* fall through */

	case CONSOLE_INITIALIZED_BUFFER:
		kfifo_putc(console_output_fifo, c);
		PUTC_LL(c);
		return;

	case CONSOLE_INIT_FULL:
		for_each_console(cdev) {
			if (cdev->f_active & ch) {
				if (c == '\n')
					cdev->putc(cdev, '\r');
				cdev->putc(cdev, c);
			}
		}
		return;
	default:
		/* If we have problems inititalizing our data
		 * get them early
		 */
		hang();
	}
}
void console_putc(unsigned int ch, char c)
{
	if (!console) {
		PUTC_LL(c);
		return;
	}

	console->putc(console, c);
	if (c == '\n')
		console->putc(console, '\r');
}
示例#3
0
void __noreturn hang (void)
{
	puts ("### ERROR ### Please RESET the board ###\n");
	puts ("Press \'r\' key to reset cpu\n");
	for (;;){
		int ch;
		ch = GETC_LL();
		PUTC_LL(ch);
		if(ch == 'r') reset_cpu(0);
	}
}