From 369d1d9a68527fe2659f4a21dc4c0aa52533dbc3 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 5 May 2011 13:06:24 -0700 Subject: Beginnings of the SRM console prompt. --- uart.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'uart.c') diff --git a/uart.c b/uart.c index 56e1cc7..cf2615e 100644 --- a/uart.c +++ b/uart.c @@ -46,8 +46,17 @@ uart_charav(int offset) int uart_getchar(int offset) { - while (!uart_charav(offset)) - continue; + /* If interrupts are enabled, use wtint assuming that either the + device itself will wake us, or that a clock interrupt will. */ + if ((rdps() & 7) == 0) { + while (!uart_charav(offset)) { + wtint(0); + } + } else { + while (!uart_charav(offset)) + continue; + } + return inb(com2Rbr + offset); } -- cgit v1.1