FreeNOS
|
Generic I/O functions. More...
#include <IO.h>
Public Types | |
enum | Result { Success, MapFailure, OutOfMemory } |
Result codes. More... | |
Public Member Functions | |
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... | |
Protected Attributes | |
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... | |
enum IO::Result |
Address IO::getBase | ( | ) | const |
Get memory I/O base offset.
Definition at line 28 of file IO.cpp.
References m_base.
Referenced by IntelMP::discover(), IntelACPI::discover(), MemoryChannel::flush(), SunxiPowerManagement::initialize(), SunxiSystemControl::initialize(), SunxiClockControl::initialize(), SunxiCpuConfig::initialize(), and IntelACPI::initialize().
IO::Result IO::map | ( | Address | phys, |
Size | size = 4096 , |
||
Memory::Access | access = Memory::Readable | Memory::Writable | Memory::User |
||
) |
Map I/O address space.
phys | Physical address for start of the range. |
size | Size of the I/O address space. |
access | Memory access flags |
Definition at line 38 of file IO.cpp.
References Memory::Range::access, MemoryContext::findFree(), MemoryContext::getCurrent(), isKernel, MemoryMap::KernelPrivate, m_base, m_range, MemoryContext::map(), MapContiguous, MapFailure, OutOfMemory, Memory::Range::phys, SELF, Memory::Range::size, Success, MemoryContext::Success, API::Success, Memory::User, Memory::Range::virt, and VMCtl().
Referenced by IntelACPI::discover(), SunxiPowerManagement::initialize(), SunxiSystemControl::initialize(), BroadcomGPIO::initialize(), SunxiClockControl::initialize(), SunxiCpuConfig::initialize(), PL011::initialize(), NS16550::initialize(), BroadcomMailbox::initialize(), IntelAPIC::initialize(), IntelMP::initialize(), IntelACPI::initialize(), Sun8iEmac::initialize(), IntelACPI::IntelACPI(), and MemoryChannel::setPhysical().
void IO::setBase | ( | const Address | base | ) |
Set memory I/O base offset.
base | Offset to add to each I/O address. |
Definition at line 33 of file IO.cpp.
References m_base.
Referenced by ARMGenericInterrupt::ARMGenericInterrupt(), Broadcom2836::Broadcom2836(), SunxiPowerManagement::initialize(), SunxiSystemControl::initialize(), SunxiClockControl::initialize(), SunxiCpuConfig::initialize(), PL011::initialize(), NS16550::initialize(), IntelAPIC::IntelAPIC(), and MemoryChannel::setVirtual().
IO::Result IO::unmap | ( | ) |
Unmap I/O address space.
Definition at line 70 of file IO.cpp.
References MemoryContext::getCurrent(), isKernel, m_range, MapFailure, SELF, Success, MemoryContext::Success, API::Success, UnMap, MemoryContext::unmapRange(), and VMCtl().
Referenced by IntelACPI::discover(), and MemoryChannel::unmap().
|
protected |
memory I/O base offset is added to each I/O address.
Definition at line 90 of file IO.h.
Referenced by getBase(), IO(), map(), ARMIO::read(), IntelIO::read(), setBase(), ARMIO::write(), and IntelIO::write().
|
protected |