PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
Go to the source code of this file.
Functions | |
void | input_init (void) |
Initializes the input buffer. More... | |
void | input_putc (uint8_t key) |
Adds a key to the input buffer. More... | |
uint8_t | input_getc (void) |
Retrieves a key from the input buffer. More... | |
bool | input_full (void) |
Returns true if the input buffer is full, false otherwise. More... | |
Variables | |
static struct intq | buffer |
Stores keys from the keyboard and serial port. More... | |
bool input_full | ( | void | ) |
Returns true if the input buffer is full, false otherwise.
Interrupts must be off.
Definition at line 48 of file input.c.
References ASSERT, buffer, intq_full(), intr_get_level(), and INTR_OFF.
Referenced by keyboard_interrupt(), serial_interrupt(), and write_ier().
uint8_t input_getc | ( | void | ) |
Retrieves a key from the input buffer.
If the buffer is empty, waits for a key to be pressed.
Definition at line 31 of file input.c.
References buffer, intq_getc(), intr_disable(), intr_set_level(), and serial_notify().
void input_init | ( | void | ) |
Initializes the input buffer.
Definition at line 11 of file input.c.
References buffer, and intq_init().
Referenced by pintos_init().
void input_putc | ( | uint8_t | key | ) |
Adds a key to the input buffer.
Interrupts must be off and the buffer must not be full.
Definition at line 19 of file input.c.
References ASSERT, buffer, intq_full(), intq_putc(), intr_get_level(), INTR_OFF, and serial_notify().
Referenced by keyboard_interrupt(), and serial_interrupt().
|
static |
Stores keys from the keyboard and serial port.
Definition at line 7 of file input.c.
Referenced by block_read(), block_write(), do_write(), file_read(), file_read_at(), file_write(), file_write_at(), fsutil_append(), fsutil_cat(), ide_read(), ide_write(), inode_read_at(), inode_write_at(), input_full(), input_getc(), input_init(), input_putc(), main(), partition_read(), partition_write(), putbuf(), read(), snprintf(), test_main(), try_write(), vsnprintf(), and write().