PKUOS - Pintos
Pintos source browser for PKU Operating System course
Functions
serial.h File Reference
#include <stdint.h>
Include dependency graph for serial.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void serial_init_queue (void)
 Initializes the serial port device for queued interrupt-driven I/O. More...
 
void serial_putc (uint8_t)
 Sends BYTE to the serial port. More...
 
void serial_flush (void)
 Flushes anything in the serial buffer out the port in polling mode. More...
 
void serial_notify (void)
 devices/serial.h More...
 

Function Documentation

◆ serial_flush()

void serial_flush ( void  )

Flushes anything in the serial buffer out the port in polling mode.

Definition at line 135 of file serial.c.

References intq_empty(), intq_getc(), intr_disable(), intr_set_level(), putc_poll(), and txq.

Referenced by debug_panic(), and shutdown_power_off().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ serial_init_queue()

void serial_init_queue ( void  )

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.

Definition at line 82 of file serial.c.

References ASSERT, init_poll(), intr_disable(), intr_register_ext(), intr_set_level(), mode, POLL, QUEUE, serial_interrupt, UNINIT, and write_ier().

Referenced by pintos_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ serial_notify()

void serial_notify ( void  )

devices/serial.h

devices/serial.h

Reassess whether we should block receive interrupts. Called by the input buffer routines when characters are added to or removed from the buffer.

Definition at line 148 of file serial.c.

References ASSERT, intr_get_level(), INTR_OFF, mode, QUEUE, and write_ier().

Referenced by input_getc(), and input_putc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ serial_putc()

void serial_putc ( uint8_t  byte)

Sends BYTE to the serial port.

Definition at line 99 of file serial.c.

References init_poll(), intq_full(), intq_getc(), intq_putc(), intr_disable(), INTR_OFF, intr_set_level(), mode, putc_poll(), QUEUE, txq, UNINIT, and write_ier().

Referenced by putchar_have_lock().

Here is the call graph for this function:
Here is the caller graph for this function: