diff options
author | Robert Morris <[email protected]> | 2019-07-27 05:47:19 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-07-27 05:47:19 -0400 |
commit | a33f60fea30c931207aa05c933dab4bd992a40c2 (patch) | |
tree | 95b86005813fb780887e9c81ebe60753c2de6a06 /kernel/uart.c | |
parent | cf48b24c03325a4489e5dea9e2419893b7bf8783 (diff) | |
download | xv6-labs-a33f60fea30c931207aa05c933dab4bd992a40c2.tar.gz xv6-labs-a33f60fea30c931207aa05c933dab4bd992a40c2.tar.bz2 xv6-labs-a33f60fea30c931207aa05c933dab4bd992a40c2.zip |
console/uart tweaks
Diffstat (limited to 'kernel/uart.c')
-rw-r--r-- | kernel/uart.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/uart.c b/kernel/uart.c index b8dd664..ba66237 100644 --- a/kernel/uart.c +++ b/kernel/uart.c @@ -43,6 +43,7 @@ uartinit(void) *R(1) = 0x01; } +// write one output character to the UART. void uartputc(int c) { @@ -52,6 +53,8 @@ uartputc(int c) *R(0) = c; } +// read one input character from the UART. +// return -1 if none is waiting. int uartgetc(void) { @@ -63,6 +66,7 @@ uartgetc(void) } } +// trap.c calls here when the uart interrupts. void uartintr(void) { |