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

Go to the source code of this file.

Functions

static uint8_t inb (uint16_t port)
 Reads and returns a byte from PORT. More...
 
static void insb (uint16_t port, void *addr, size_t cnt)
 Reads CNT bytes from PORT, one after another, and stores them into the buffer starting at ADDR. More...
 
static uint16_t inw (uint16_t port)
 Reads and returns 16 bits from PORT. More...
 
static void insw (uint16_t port, void *addr, size_t cnt)
 Reads CNT 16-bit (halfword) units from PORT, one after another, and stores them into the buffer starting at ADDR. More...
 
static uint32_t inl (uint16_t port)
 Reads and returns 32 bits from PORT. More...
 
static void insl (uint16_t port, void *addr, size_t cnt)
 Reads CNT 32-bit (word) units from PORT, one after another, and stores them into the buffer starting at ADDR. More...
 
static void outb (uint16_t port, uint8_t data)
 Writes byte DATA to PORT. More...
 
static void outsb (uint16_t port, const void *addr, size_t cnt)
 Writes to PORT each byte of data in the CNT-byte buffer starting at ADDR. More...
 
static void outw (uint16_t port, uint16_t data)
 Writes the 16-bit DATA to PORT. More...
 
static void outsw (uint16_t port, const void *addr, size_t cnt)
 Writes to PORT each 16-bit unit (halfword) of data in the CNT-halfword buffer starting at ADDR. More...
 
static void outl (uint16_t port, uint32_t data)
 Writes the 32-bit DATA to PORT. More...
 
static void outsl (uint16_t port, const void *addr, size_t cnt)
 Writes to PORT each 32-bit unit (word) of data in the CNT-word buffer starting at ADDR. More...
 

Function Documentation

◆ inb()

static uint8_t inb ( uint16_t  port)
inlinestatic

Reads and returns a byte from PORT.

Definition at line 9 of file io.h.

Referenced by check_device_type(), cmos_read(), find_cursor(), interrupt_handler(), keyboard_interrupt(), putc_poll(), reset_channel(), select_device(), serial_interrupt(), shutdown_reboot(), speaker_off(), speaker_on(), wait_until_idle(), and wait_while_busy().

Here is the caller graph for this function:

◆ inl()

static uint32_t inl ( uint16_t  port)
inlinestatic

Reads and returns 32 bits from PORT.

Definition at line 47 of file io.h.

◆ insb()

static void insb ( uint16_t  port,
void *  addr,
size_t  cnt 
)
inlinestatic

Reads CNT bytes from PORT, one after another, and stores them into the buffer starting at ADDR.

Definition at line 20 of file io.h.

◆ insl()

static void insl ( uint16_t  port,
void *  addr,
size_t  cnt 
)
inlinestatic

Reads CNT 32-bit (word) units from PORT, one after another, and stores them into the buffer starting at ADDR.

Definition at line 58 of file io.h.

◆ insw()

static void insw ( uint16_t  port,
void *  addr,
size_t  cnt 
)
inlinestatic

Reads CNT 16-bit (halfword) units from PORT, one after another, and stores them into the buffer starting at ADDR.

Definition at line 39 of file io.h.

Referenced by input_sector().

Here is the caller graph for this function:

◆ inw()

static uint16_t inw ( uint16_t  port)
inlinestatic

Reads and returns 16 bits from PORT.

Definition at line 28 of file io.h.

◆ outb()

static void outb ( uint16_t  port,
uint8_t  data 
)
inlinestatic

◆ outl()

static void outl ( uint16_t  port,
uint32_t  data 
)
inlinestatic

Writes the 32-bit DATA to PORT.

Definition at line 100 of file io.h.

◆ outsb()

static void outsb ( uint16_t  port,
const void *  addr,
size_t  cnt 
)
inlinestatic

Writes to PORT each byte of data in the CNT-byte buffer starting at ADDR.

Definition at line 75 of file io.h.

◆ outsl()

static void outsl ( uint16_t  port,
const void *  addr,
size_t  cnt 
)
inlinestatic

Writes to PORT each 32-bit unit (word) of data in the CNT-word buffer starting at ADDR.

threads/io.h

Definition at line 109 of file io.h.

◆ outsw()

static void outsw ( uint16_t  port,
const void *  addr,
size_t  cnt 
)
inlinestatic

Writes to PORT each 16-bit unit (halfword) of data in the CNT-halfword buffer starting at ADDR.

Definition at line 92 of file io.h.

Referenced by output_sector().

Here is the caller graph for this function:

◆ outw()

static void outw ( uint16_t  port,
uint16_t  data 
)
inlinestatic

Writes the 16-bit DATA to PORT.

Definition at line 83 of file io.h.

Referenced by move_cursor(), and shutdown_power_off().

Here is the caller graph for this function: