|
StuBS
|
Abstracts access to the I/O address space. More...
#include <machine/ioport.h>
Public Member Functions | |
| IOPort (uint16_t addr) | |
| Constructor. | |
| void | outb (uint8_t val) const |
| Write one byte to the I/O port. | |
| void | outw (uint16_t val) const |
| Write one word (2 bytes) to the I/O port. | |
| uint8_t | inb () const |
| Read one byte from the I/O port. | |
| uint16_t | inw () const |
| Read one word (2 bytes) from the I/O port. | |
Private Attributes | |
| uint16_t | address |
| Address in I/O address space. | |
Abstracts access to the I/O address space.
x86 PCs have a separated I/O address space that is accessible only via the machine instructions in and out. An IOPort object encapsulates the corresponding address in the I/O address space and can be used for byte or word-wise reading or writing.
|
inlineexplicit |
Constructor.
| addr | Address from the I/O address space |
Write one byte to the I/O port.
| val | The value to be written |
Write one word (2 bytes) to the I/O port.
| val | The value to be written |
|
inline |
Read one byte from the I/O port.
|
inline |
Read one word (2 bytes) from the I/O port.
|
private |
Address in I/O address space.