FreeNOS
|
Intel I/O functions. More...
#include <IntelIO.h>
Public Member Functions | |
IntelIO () | |
Constructor. More... | |
void | setPortBase (const u16 base) |
Set port I/O base address. More... | |
u8 | inb (u16 port) const |
Read a byte from a port. More... | |
u16 | inw (u16 port) const |
Read a word from a port. More... | |
void | outb (u16 port, u8 byte) |
Output a byte to a port. More... | |
void | outw (u16 port, u16 word) |
Output a word to a port. More... | |
void | outl (u16 port, u32 l) |
Output a long to a I/O port. More... | |
u32 | read (const Address addr) const |
Read memory mapped register. More... | |
void | read (Address addr, Size count, void *buf) const |
Read a number of 32-bit values. More... | |
void | write (const Address addr, const u32 data) |
Write memory mapped register. More... | |
void | write (Address addr, Size count, const void *buf) |
Write a number of 32-bit values. More... | |
void | set (Address addr, u32 data) |
Set bits in memory mapped register. More... | |
void | unset (Address addr, u32 data) |
Unset bits in memory mapped register. More... | |
Public Member Functions inherited from IO | |
IO () | |
Constructor. More... | |
Address | getBase () const |
Get memory I/O base offset. More... | |
void | setBase (const Address base) |
Set memory I/O base offset. More... | |
Result | map (Address phys, Size size=4096, Memory::Access access=Memory::Readable|Memory::Writable|Memory::User) |
Map I/O address space. More... | |
Result | unmap () |
Unmap I/O address space. More... | |
Private Attributes | |
u16 | m_portBase |
Port I/O base address. More... | |
Additional Inherited Members | |
Public Types inherited from IO | |
enum | Result { Success, MapFailure, OutOfMemory } |
Result codes. More... | |
Protected Attributes inherited from IO | |
Address | m_base |
memory I/O base offset is added to each I/O address. More... | |
Memory::Range | m_range |
Memory range for performing I/O mappings. More... | |
Read a byte from a port.
port | The I/O port to read from. |
Definition at line 68 of file IntelIO.h.
References m_portBase.
Referenced by IntelPIC::disable(), IntelPIC::enable(), and IntelPIT::getCounter().
Read a word from a port.
port | The I/O port to read from. |
Definition at line 83 of file IntelIO.h.
References m_portBase.
Output a byte to a port.
port | Port to write to. |
byte | The byte to output. |
Definition at line 97 of file IntelIO.h.
References m_portBase.
Referenced by IntelPIC::clear(), IntelPIC::disable(), IntelPIC::enable(), IntelPIC::initialize(), IntelPIT::setControl(), and IntelPIT::setFrequency().
Output a long to a I/O port.
port | Target I/O port. |
l | The long 32-bit number to output. |
Definition at line 121 of file IntelIO.h.
References m_portBase.
Output a word to a port.
port | Port to write to. |
word | The word to output. |
Definition at line 109 of file IntelIO.h.
References m_portBase.
Read memory mapped register.
addr | Address of the register to read. |
Definition at line 134 of file IntelIO.h.
References IO::m_base.
Referenced by IntelAPIC::getCounter(), read(), IntelAPIC::sendIPI(), IntelAPIC::sendStartupIPI(), set(), IntelAPIC::start(), unset(), and IntelAPIC::wait().
Set bits in memory mapped register.
addr | Address of the register to write. |
data | 32-bit value containing the bits to set (bitwise or). |
Definition at line 188 of file IntelIO.h.
References read(), and write().
Referenced by IntelAPIC::initialize().
|
inline |
Set port I/O base address.
base | New I/O base address. |
Definition at line 56 of file IntelIO.h.
References m_portBase.
Referenced by IntelPIC::IntelPIC().
Write memory mapped register.
addr | Address of the register to write. |
data | 32-bit value to write in the register. |
Definition at line 161 of file IntelIO.h.
References IO::m_base.
Referenced by IntelAPIC::clear(), IntelAPIC::initialize(), IntelAPIC::sendIPI(), IntelAPIC::sendStartupIPI(), set(), IntelAPIC::start(), IntelAPIC::stop(), unset(), and write().
|
private |