projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04abef1
)
Check that the serial rate is reasonable.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 7 Oct 2004 00:35:18 +0000
(
00:35
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 7 Oct 2004 00:35:18 +0000
(
00:35
+0000)
src/devices/serial.c
patch
|
blob
|
history
diff --git
a/src/devices/serial.c
b/src/devices/serial.c
index 8dc7f18cfbd0272b630e0d85c87abf119be23173..099b22841efeafd4289f718210ffb592f8148f57 100644
(file)
--- a/
src/devices/serial.c
+++ b/
src/devices/serial.c
@@
-131,6
+131,8
@@
set_serial (int bps)
int baud_base = 1843200 / 16; /* Base rate of 16550A. */
uint16_t divisor = baud_base / bps; /* Clock rate divisor. */
+ ASSERT (bps >= 300 && bps <= 115200);
+
/* Enable DLAB. */
outb (LCR_REG, LCR_N81 | LCR_DLAB);