CS318 - Pintos
Pintos source browser for JHU CS318 course
Functions
input.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for input.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void input_init (void)
 Initializes the input buffer. More...
 
void input_putc (uint8_t)
 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)
 devices/input.h More...
 

Function Documentation

◆ input_full()

bool input_full ( void  )

devices/input.h

devices/input.h

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().

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

◆ input_getc()

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().

Here is the call graph for this function:

◆ input_init()

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().

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

◆ input_putc()

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().

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