The Pedigree Project 0.1
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
IoBase Class Referenceabstract

Abstrace base class for hardware I/O capabilities. More...

#include <IoBase.h>

+ Inheritance diagram for IoBase:
+ Collaboration diagram for IoBase:

Public Member Functions

virtual ~IoBase ()
 
virtual size_t size () const =0
 
virtual uint8_t read8 (size_t offset=0)=0
 
virtual uint16_t read16 (size_t offset=0)=0
 
virtual uint32_t read32 (size_t offset=0)=0
 
virtual uint64_t read64 (size_t offset=0)=0
 
uint64_t read64LowFirst (size_t offset=0)
 
uint64_t read64HighFirst (size_t offset=0)
 
virtual void write8 (uint8_t value, size_t offset=0)=0
 
virtual void write16 (uint16_t value, size_t offset=0)=0
 
virtual void write32 (uint32_t value, size_t offset=0)=0
 
virtual void write64 (uint64_t value, size_t offset=0)=0
 
void write64LowFirst (uint64_t value, size_t offset=0)
 
void write64HighFirst (uint64_t value, size_t offset=0)
 
virtual operator bool () const =0
 

Protected Member Functions

 IoBase ()
 

Private Member Functions

 IoBase (const IoBase &)
 
IoBase & operator= (const IoBase &)
 

Detailed Description

Abstrace base class for hardware I/O capabilities.

Interface to the hardware's I/O capabilities

Definition at line 32 of file IoBase.h.

Constructor & Destructor Documentation

◆ ~IoBase()

IoBase::~IoBase ( )
virtualdefault

The destructor does nothing

◆ IoBase() [1/2]

IoBase::IoBase ( )
protecteddefault

The default constructor does nothing

◆ IoBase() [2/2]

IoBase::IoBase ( const IoBase &  )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

◆ operator bool()

virtual IoBase::operator bool ( ) const
pure virtual

Check whether this class is usable

Returns
true, if the class holds a ressource that is correctly allocated and usable

Implemented in IoPort, and MemoryMappedIo.

◆ operator=()

IoBase & IoBase::operator= ( const IoBase &  )
private

The assignment operator

Note
NOT implemented

◆ read16()

virtual uint16_t IoBase::read16 ( size_t  offset = 0)
pure virtual

Read two byte (16bit) from the I/O Port or the memory-mapped I/O region

Parameters
[in]offsetoffset from the I/O base port or the I/O base memory address
Returns
the two byte (16bit) that have been read

Implemented in IoPort, and MemoryMappedIo.

Referenced by Uhci::cancelAsyncAndDrain(), Uhci::cancelInterruptInAndDrain(), AtaDisk::doRead(), Uhci::executeRequest(), AtaDisk::initialise(), Nic3C90x::irq(), Uhci::irq(), Nic3C90x::issueCommand(), Uhci::modifyPortControl(), Ne2k::Ne2k(), Nic3C90x::Nic3C90x(), Uhci::portReset(), Nic3C90x::readEeprom(), Uhci::start(), Uhci::stop(), and Uhci::timer().

+ Here is the caller graph for this function:

◆ read32()

virtual uint32_t IoBase::read32 ( size_t  offset = 0)
pure virtual

Read four byte (32bit) from the I/O Port or the memory-mapped I/O region

Parameters
[in]offsetoffset from the I/O base port or the I/O base memory address
Returns
the four byte (32bit) that have been read

Implemented in IoPort, and MemoryMappedIo.

Referenced by Ehci::addInterruptInHandler(), Ehci::cancelAsyncAndDrain(), Ohci::cancelAsyncAndDrain(), Ehci::cancelInterruptInAndDrain(), Ohci::doAsync(), Ehci::executeRequest(), Ohci::executeRequest(), AhciController::irq(), Ohci::irq(), Nic3C90x::Nic3C90x(), Ehci::portReset(), Ohci::portReset(), read64HighFirst(), read64LowFirst(), Ehci::replaySuppressedConnectionChange(), Nic3C90x::reset(), Nic3C90x::send(), Ohci::setRootHubStatusChangeSource(), Ohci::start(), Ohci::stop(), and Ohci::transitionControllerState().

+ Here is the caller graph for this function:

◆ read64()

virtual uint64_t IoBase::read64 ( size_t  offset = 0)
pure virtual

Read eight byte (64bit) from the I/O Port or the memory-mapped I/O region.

Parameters
[in]offsetoffset from the I/O base port or the I/O base memory address
Returns
the eight byte (64bit) that have been read

Implemented in IoPort, and MemoryMappedIo.

◆ read64HighFirst()

uint64_t IoBase::read64HighFirst ( size_t  offset = 0)
inline

Read eight byte (64bit) from the I/O Port or the memory-mapped I/O region. The 32bit at the higher address are read first, then the 32bit at the lower address.

Parameters
[in]offsetoffset from the I/O base port or the I/O base memory address
Returns
the eight byte (64bit) that have been read

Definition at line 31 of file IoBase.cc.

References read32().

◆ read64LowFirst()

uint64_t IoBase::read64LowFirst ( size_t  offset = 0)
inline

Read eight byte (64bit) from the I/O Port or the memory-mapped I/O region. The 32bit at the lower address are read first, then the 32bit at the higher address.

Parameters
[in]offsetoffset from the I/O base port or the I/O base memory address
Returns
the eight byte (64bit) that have been read

Definition at line 25 of file IoBase.cc.

References read32().

◆ read8()

virtual uint8_t IoBase::read8 ( size_t  offset = 0)
pure virtual

Read a byte (8bit) from the I/O Port or the memory-mapped I/O region

Parameters
[in]offsetoffset from the I/O base port or the I/O base memory address
Returns
the byte (8bit) that have been read

Implemented in IoPort, and MemoryMappedIo.

Referenced by BusMasterIde::add(), BusMasterIde::begin(), BusMasterIde::commandComplete(), BusMasterIde::hasCompleted(), BusMasterIde::hasError(), BusMasterIde::hasInterrupt(), AtaDisk::initialise(), Nic3C90x::irq(), Ne2k::irq(), Ps2Controller::irq(), Ne2k::Ne2k(), Ps2Controller::readByte(), and Ne2k::send().

+ Here is the caller graph for this function:

◆ size()

virtual size_t IoBase::size ( ) const
pure virtual

Get the size of the I/O region in bytes

Implemented in IoPort, and MemoryMappedIo.

Referenced by BusMasterIde::initialise().

+ Here is the caller graph for this function:

◆ write16()

virtual void IoBase::write16 ( uint16_t  value,
size_t  offset = 0 
)
pure virtual

Write two byte (16bit) to the I/O port or the memory-mapped I/O region

Parameters
[in]valuethe value that should be written
[in]offsetoffset from the I/O base port or the I/O base memory address

Implemented in IoPort, and MemoryMappedIo.

Referenced by Uhci::cancelAsyncAndDrain(), Uhci::cancelInterruptInAndDrain(), Uhci::irq(), Nic3C90x::issueCommand(), Uhci::modifyPortControl(), Nic3C90x::Nic3C90x(), Uhci::portReset(), Nic3C90x::readEeprom(), Nic3C90x::reset(), Ne2k::send(), Uhci::start(), Uhci::stop(), Uhci::timer(), and Nic3C90x::writeEepromWord().

+ Here is the caller graph for this function:

◆ write32()

virtual void IoBase::write32 ( uint32_t  value,
size_t  offset = 0 
)
pure virtual

◆ write64()

virtual void IoBase::write64 ( uint64_t  value,
size_t  offset = 0 
)
pure virtual

Write eight byte (64bit) to the I/O Port or the memory-mapped I/O region.

Parameters
[in]valuethe value that should be written
[in]offsetoffset from the I/O base port or the I/O base memory address

Implemented in IoPort, and MemoryMappedIo.

◆ write64HighFirst()

void IoBase::write64HighFirst ( uint64_t  value,
size_t  offset = 0 
)

Write eight byte (64bit) to the I/O Port or the memory-mapped I/O region. The 32bit at the higher address are written first, then the 32bit at the lower address.

Parameters
[in]valuethe value that should be written
[in]offsetoffset from the I/O base port or the I/O base memory address

Definition at line 42 of file IoBase.cc.

References write32().

◆ write64LowFirst()

void IoBase::write64LowFirst ( uint64_t  value,
size_t  offset = 0 
)

Write eight byte (64bit) to the I/O Port or the memory-mapped I/O region. The 32bit at the lower address are written first, then the 32bit at the higher address.

Parameters
[in]valuethe value that should be written
[in]offsetoffset from the I/O base port or the I/O base memory address

Definition at line 37 of file IoBase.cc.

References write32().

◆ write8()

virtual void IoBase::write8 ( uint8_t  value,
size_t  offset = 0 
)
pure virtual

Write a byte (8bit) to the I/O port or the memory-mapped I/O region

Parameters
[in]valuethe value that should be written
[in]offsetoffset from the I/O base port or the I/O base memory address

Implemented in IoPort, and MemoryMappedIo.

Referenced by BusMasterIde::begin(), BusMasterIde::commandComplete(), AtaDisk::doRead(), AtaDisk::initialise(), Nic3C90x::irq(), Ne2k::irq(), AtaDisk::maskInterrupts(), Ne2k::Ne2k(), Nic3C90x::Nic3C90x(), Nic3C90x::reset(), Ne2k::send(), AtaDisk::setFeatures(), AtaDisk::setupLBA28(), AtaDisk::setupLBA48(), Ib700Watchdog::timer(), and AtaDisk::writePageBuffer().

+ Here is the caller graph for this function:

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