The Pedigree Project 0.1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AhciPort Class Reference
+ Collaboration diagram for AhciPort:

Classes

struct  Slot
 

Public Member Functions

 AhciPort (IoBase *registers, size_t port, Device *dmaDevice)
 
bool initialise (uint32_t capabilities, uint32_t version, uint32_t extendedCapabilities)
 
void shutdown ()
 
void enableInterrupts ()
 
bool interrupt (bool pending)
 
bool command (uint8_t opcode, uint64_t lba, uint16_t sectors, void *buffer, size_t bytes, bool write, bool interrupts, bool interruptProbe=false, bool cacheFill=false, physical_uintptr_t dmaPhysical=0, const physical_uintptr_t *directReadPages=nullptr)
 
bool readBatch (Disk::ReadBuffer *buffers, size_t count, bool interrupts)
 
bool writeBatch (Disk::WriteBuffer *buffers, size_t count, bool interrupts)
 
size_t interruptCompletions () const
 
size_t maximumOutstanding () const
 
void configureDisk (size_t sectorBytes, size_t queueDepth)
 
size_t sectorBytes () const
 

Private Member Functions

bool transferBatch (Disk::ReadBuffer *buffers, size_t count, bool interrupts, bool writing, const physical_uintptr_t *dmaPhysical=nullptr, const physical_uintptr_t *const *directReadPages=nullptr)
 
uint32_t read (size_t reg) const
 
void write (size_t reg, uint32_t value)
 
void waitForProgress ()
 
bool waitClear (size_t reg, uint32_t bits, size_t milliseconds)
 
bool stopEngines ()
 
void acknowledge (uint32_t status)
 
void observe (uint32_t status, bool fromInterrupt)
 
void pollCompletions (bool interrupts)
 
bool chooseSlot (bool queued, size_t &index)
 
bool issueCommand (size_t index, uint8_t opcode, uint64_t lba, uint16_t sectors, void *buffer, size_t bytes, bool writing, bool queued, bool interrupts, physical_uintptr_t directPhysical=0, const physical_uintptr_t *directReadPages=nullptr)
 
bool reapCommand (size_t index, uint8_t opcode, void *buffer, size_t bytes, bool writing, bool queued, bool interrupts, bool interruptProbe, bool directRead=false)
 

Private Attributes

IoBase * m_Registers
 
Device * m_DmaDevice
 
size_t m_Port
 
MemoryRegion m_Control
 
Slot m_Slots [32]
 
Mutex m_CommandLock
 
Mutex m_StateLock
 
bool m_Online
 
bool m_WritesPending
 
uint32_t m_Active
 
uint32_t m_Queued
 
size_t m_SlotCount
 
size_t m_QueueDepth
 
size_t m_SectorBytes
 
bool m_SupportsNcq
 
bool m_AddressesInstalled
 
bool m_PolledInterrupt
 
size_t m_InterruptCompletions
 
size_t m_MaximumOutstanding
 
size_t m_Outstanding
 

Detailed Description

Definition at line 25 of file AhciPort.h.

Constructor & Destructor Documentation

◆ AhciPort()

AhciPort::AhciPort ( IoBase *  registers,
size_t  port,
Device *  dmaDevice 
)

Definition at line 51 of file AhciPort.cc.

◆ ~AhciPort()

AhciPort::~AhciPort ( )

Definition at line 69 of file AhciPort.cc.

Member Function Documentation

◆ acknowledge()

void AhciPort::acknowledge ( uint32_t  status)
private

Definition at line 106 of file AhciPort.cc.

◆ chooseSlot()

bool AhciPort::chooseSlot ( bool  queued,
size_t &  index 
)
private

Definition at line 256 of file AhciPort.cc.

◆ command()

bool AhciPort::command ( uint8_t  opcode,
uint64_t  lba,
uint16_t  sectors,
void *  buffer,
size_t  bytes,
bool  write,
bool  interrupts,
bool  interruptProbe = false,
bool  cacheFill = false,
physical_uintptr_t  dmaPhysical = 0,
const physical_uintptr_t *  directReadPages = nullptr 
)

Definition at line 409 of file AhciPort.cc.

◆ configureDisk()

void AhciPort::configureDisk ( size_t  sectorBytes,
size_t  queueDepth 
)

Definition at line 202 of file AhciPort.cc.

◆ enableInterrupts()

void AhciPort::enableInterrupts ( )

Definition at line 196 of file AhciPort.cc.

◆ initialise()

bool AhciPort::initialise ( uint32_t  capabilities,
uint32_t  version,
uint32_t  extendedCapabilities 
)

Definition at line 114 of file AhciPort.cc.

◆ interrupt()

bool AhciPort::interrupt ( bool  pending)

Definition at line 245 of file AhciPort.cc.

◆ interruptCompletions()

size_t AhciPort::interruptCompletions ( ) const

Definition at line 711 of file AhciPort.cc.

◆ issueCommand()

bool AhciPort::issueCommand ( size_t  index,
uint8_t  opcode,
uint64_t  lba,
uint16_t  sectors,
void *  buffer,
size_t  bytes,
bool  writing,
bool  queued,
bool  interrupts,
physical_uintptr_t  directPhysical = 0,
const physical_uintptr_t *  directReadPages = nullptr 
)
private

Definition at line 273 of file AhciPort.cc.

◆ maximumOutstanding()

size_t AhciPort::maximumOutstanding ( ) const

Definition at line 716 of file AhciPort.cc.

◆ observe()

void AhciPort::observe ( uint32_t  status,
bool  fromInterrupt 
)
private

Definition at line 207 of file AhciPort.cc.

◆ pollCompletions()

void AhciPort::pollCompletions ( bool  interrupts)
private

Definition at line 236 of file AhciPort.cc.

◆ read()

uint32_t AhciPort::read ( size_t  reg) const
private

Definition at line 72 of file AhciPort.cc.

◆ readBatch()

bool AhciPort::readBatch ( Disk::ReadBuffer *  buffers,
size_t  count,
bool  interrupts 
)

Definition at line 479 of file AhciPort.cc.

◆ reapCommand()

bool AhciPort::reapCommand ( size_t  index,
uint8_t  opcode,
void *  buffer,
size_t  bytes,
bool  writing,
bool  queued,
bool  interrupts,
bool  interruptProbe,
bool  directRead = false 
)
private

Definition at line 349 of file AhciPort.cc.

◆ sectorBytes()

size_t AhciPort::sectorBytes ( ) const
inline

Definition at line 42 of file AhciPort.h.

◆ shutdown()

void AhciPort::shutdown ( )

Definition at line 670 of file AhciPort.cc.

◆ stopEngines()

bool AhciPort::stopEngines ( )
private

Definition at line 98 of file AhciPort.cc.

◆ transferBatch()

bool AhciPort::transferBatch ( Disk::ReadBuffer *  buffers,
size_t  count,
bool  interrupts,
bool  writing,
const physical_uintptr_t *  dmaPhysical = nullptr,
const physical_uintptr_t *const *  directReadPages = nullptr 
)
private

Definition at line 579 of file AhciPort.cc.

◆ waitClear()

bool AhciPort::waitClear ( size_t  reg,
uint32_t  bits,
size_t  milliseconds 
)
private

Definition at line 89 of file AhciPort.cc.

◆ waitForProgress()

void AhciPort::waitForProgress ( )
private

Definition at line 78 of file AhciPort.cc.

◆ write()

void AhciPort::write ( size_t  reg,
uint32_t  value 
)
private

Definition at line 75 of file AhciPort.cc.

◆ writeBatch()

bool AhciPort::writeBatch ( Disk::WriteBuffer *  buffers,
size_t  count,
bool  interrupts 
)

Definition at line 561 of file AhciPort.cc.

Member Data Documentation

◆ m_Active

uint32_t AhciPort::m_Active
private

Definition at line 87 of file AhciPort.h.

◆ m_AddressesInstalled

bool AhciPort::m_AddressesInstalled
private

Definition at line 93 of file AhciPort.h.

◆ m_CommandLock

Mutex AhciPort::m_CommandLock
private

Definition at line 82 of file AhciPort.h.

◆ m_Control

MemoryRegion AhciPort::m_Control
private

Definition at line 70 of file AhciPort.h.

◆ m_DmaDevice

Device* AhciPort::m_DmaDevice
private

Definition at line 68 of file AhciPort.h.

◆ m_InterruptCompletions

size_t AhciPort::m_InterruptCompletions
private

Definition at line 95 of file AhciPort.h.

◆ m_MaximumOutstanding

size_t AhciPort::m_MaximumOutstanding
private

Definition at line 96 of file AhciPort.h.

◆ m_Online

bool AhciPort::m_Online
private

Definition at line 84 of file AhciPort.h.

◆ m_Outstanding

size_t AhciPort::m_Outstanding
private

Definition at line 97 of file AhciPort.h.

◆ m_PolledInterrupt

bool AhciPort::m_PolledInterrupt
private

Definition at line 94 of file AhciPort.h.

◆ m_Port

size_t AhciPort::m_Port
private

Definition at line 69 of file AhciPort.h.

◆ m_Queued

uint32_t AhciPort::m_Queued
private

Definition at line 88 of file AhciPort.h.

◆ m_QueueDepth

size_t AhciPort::m_QueueDepth
private

Definition at line 90 of file AhciPort.h.

◆ m_Registers

IoBase* AhciPort::m_Registers
private

Definition at line 67 of file AhciPort.h.

◆ m_SectorBytes

size_t AhciPort::m_SectorBytes
private

Definition at line 91 of file AhciPort.h.

◆ m_SlotCount

size_t AhciPort::m_SlotCount
private

Definition at line 89 of file AhciPort.h.

◆ m_Slots

Slot AhciPort::m_Slots[32]
private

Definition at line 81 of file AhciPort.h.

◆ m_StateLock

Mutex AhciPort::m_StateLock
mutableprivate

Definition at line 83 of file AhciPort.h.

◆ m_SupportsNcq

bool AhciPort::m_SupportsNcq
private

Definition at line 92 of file AhciPort.h.

◆ m_WritesPending

bool AhciPort::m_WritesPending
private

Definition at line 86 of file AhciPort.h.


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