- init_level = level;
- switch (level)
- {
- case 1:
- outb (IER_REG, 0); /* Turn off all interrupts. */
- outb (FCR_REG, 0); /* Disable FIFO. */
- set_serial (9600, 8, NONE, 1); /* 9600 bps, N-8-1. */
- outb (MCR_REG, 8); /* Turn off output lines. */
- break;
-
- case 2:
- /* Prepare interrupt handler. */
- queue_init (&recv_queue, "serial recv");
- queue_init (&xmit_queue, "serial xmit");
- intr_register (0x20 + 4, 0, INTR_OFF, serial_interrupt, "serial");
- outb (IER_REG, IER_RECV);
- break;
-
- default:
- NOT_REACHED ();
- }
+ ASSERT (!polled_io);
+ polled_io = true;
+ outb (IER_REG, 0); /* Turn off all interrupts. */
+ outb (FCR_REG, 0); /* Disable FIFO. */
+ set_serial (9600, 8, NONE, 1); /* 9600 bps, N-8-1. */
+ outb (MCR_REG, 8); /* Turn on OUT2 output line. */
+}
+
+/* Initializes the serial port device for queued interrupt-driven
+ I/O. With interrupt-driven I/O we don't waste CPU time
+ waiting for the serial device to become ready. */
+void
+serial_init_queue (void)
+{
+ ASSERT (polled_io);
+ polled_io = false;
+ queue_init (&recv_queue, "serial recv");
+ queue_init (&xmit_queue, "serial xmit");
+ intr_register (0x20 + 4, 0, INTR_OFF, serial_interrupt, "serial");