summaryrefslogtreecommitdiff
path: root/uart.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2011-05-05 13:06:24 -0700
committerRichard Henderson <rth@twiddle.net>2011-05-05 13:12:49 -0700
commit369d1d9a68527fe2659f4a21dc4c0aa52533dbc3 (patch)
treee348726a048cecbb036ba7b9a80cd1bf7bfcff21 /uart.c
parent9e75c89f005e07e059c80317904fefaffe6fde7f (diff)
downloadqemu-palcode-369d1d9a68527fe2659f4a21dc4c0aa52533dbc3.tar.gz
Beginnings of the SRM console prompt.
Diffstat (limited to 'uart.c')
-rw-r--r--uart.c13
1 files changed, 11 insertions, 2 deletions
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);
}