From 912a232e283c1bd59e5ca8f0922f348af62ed3c5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 7 Oct 2004 00:35:18 +0000 Subject: [PATCH] Check that the serial rate is reasonable. --- src/devices/serial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/devices/serial.c b/src/devices/serial.c index 8dc7f18..099b228 100644 --- 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); -- 2.30.2