The Pedigree Project
0.1
|
Memory mapped I/O range. More...
#include <MemoryMappedIo.h>
Public Member Functions | |
MemoryMappedIo (const char *pName, uintptr_t offset=0, uintptr_t padding=1) | |
virtual | ~MemoryMappedIo () |
virtual size_t | size () const |
virtual uint8_t | read8 (size_t offset=0) |
virtual uint16_t | read16 (size_t offset=0) |
virtual uint32_t | read32 (size_t offset=0) |
virtual uint64_t | read64 (size_t offset=0) |
virtual void | write8 (uint8_t value, size_t offset=0) |
virtual void | write16 (uint16_t value, size_t offset=0) |
virtual void | write32 (uint32_t value, size_t offset=0) |
virtual void | write64 (uint64_t value, size_t offset=0) |
virtual | operator bool () const |
Public Member Functions inherited from IoBase | |
virtual | ~IoBase () |
uint64_t | read64LowFirst (size_t offset=0) |
uint64_t | read64HighFirst (size_t offset=0) |
void | write64LowFirst (uint64_t value, size_t offset=0) |
void | write64HighFirst (uint64_t value, size_t offset=0) |
Public Member Functions inherited from MemoryRegion | |
MemoryRegion (const char *pName) | |
virtual | ~MemoryRegion () |
void | free () |
void * | virtualAddress () const |
physical_uintptr_t | physicalAddress () const |
size_t | size () const |
const char * | name () const |
operator bool () const | |
bool | physicalBoundsCheck (physical_uintptr_t address) |
template<typename T > | |
T * | convertPhysicalPointer (physical_uintptr_t address) |
void | setNonRamMemory (bool b) |
bool | getNonRamMemory () |
void | setForced (bool b) |
bool | getForced () |
Private Member Functions | |
MemoryMappedIo (const MemoryMappedIo &) | |
MemoryMappedIo & | operator= (const MemoryMappedIo &) |
Private Attributes | |
uintptr_t | m_Offset |
size_t | m_Padding |
Additional Inherited Members | |
Protected Member Functions inherited from IoBase | |
IoBase () | |
Memory mapped I/O range.
The MemoryMappedIo handles special MemoryRegions for I/O to hardware devices
Definition at line 32 of file MemoryMappedIo.h.
|
virtual |
The destructor frees the allocated ressources
Definition at line 30 of file MemoryMappedIo.cc.
|
private |
The copy-constructor
|
virtual |
Check whether this class is usable
Implements IoBase.
Definition at line 127 of file MemoryMappedIo.cc.
|
private |
The assignment operator
|
virtual |
Read two byte (16bit) from the I/O Port or the memory-mapped I/O region
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 50 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Read four byte (32bit) from the I/O Port or the memory-mapped I/O region
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 61 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Read eight byte (64bit) from the I/O Port or the memory-mapped I/O region.
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 72 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Read a byte (8bit) from the I/O Port or the memory-mapped I/O region
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 39 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Get the size of the I/O region in bytes
Implements IoBase.
Definition at line 34 of file MemoryMappedIo.cc.
References MemoryRegion::size().
|
virtual |
Write two byte (16bit) to the I/O port or the memory-mapped I/O region
[in] | value | the value that should be written |
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 94 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Write four byte (32bit) to the I/O port or the memory-mapped I/O region
[in] | value | the value that should be written |
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 105 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Write eight byte (64bit) to the I/O Port or the memory-mapped I/O region.
[in] | value | the value that should be written |
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 116 of file MemoryMappedIo.cc.
References Processor::halt().
|
virtual |
Write a byte (8bit) to the I/O port or the memory-mapped I/O region
[in] | value | the value that should be written |
[in] | offset | offset from the I/O base port or the I/O base memory address |
Implements IoBase.
Definition at line 83 of file MemoryMappedIo.cc.
References Processor::halt().
|
private |
MemoryRegion only supports allocation on a page boundary. This variable adds an offset onto each access to make up for this (if required)
Definition at line 69 of file MemoryMappedIo.h.
|
private |
It is possible that registers may not follow one another directly in memory, instead being padded to some boundary.
Definition at line 73 of file MemoryMappedIo.h.