FreeNOS
Public Types | Public Member Functions | Protected Attributes
IO Class Reference

Generic I/O functions. More...

#include <IO.h>

Inheritance diagram for IO:
ARMIO IntelIO

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

Detailed Description

Generic I/O functions.

Definition at line 35 of file IO.h.

Member Enumeration Documentation

◆ Result

enum IO::Result

Result codes.

Enumerator
Success 
MapFailure 
OutOfMemory 

Definition at line 42 of file IO.h.

Constructor & Destructor Documentation

◆ IO()

IO::IO ( )

Constructor.

Definition at line 23 of file IO.cpp.

References m_base.

Member Function Documentation

◆ getBase()

Address IO::getBase ( ) const

Get memory I/O base offset.

Returns
Base offset to add to each I/O address.

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

◆ map()

IO::Result IO::map ( Address  phys,
Size  size = 4096,
Memory::Access  access = Memory::Readable | Memory::Writable | Memory::User 
)

◆ setBase()

void IO::setBase ( const Address  base)

◆ unmap()

IO::Result IO::unmap ( )

Unmap I/O address space.

Returns
Result code.

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

Field Documentation

◆ m_base

Address IO::m_base
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().

◆ m_range

Memory::Range IO::m_range
protected

Memory range for performing I/O mappings.

Definition at line 93 of file IO.h.

Referenced by map(), and unmap().


The documentation for this class was generated from the following files: