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)
 
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 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)
 
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)
 
bool reapCommand (size_t index, uint8_t opcode, void *buffer, size_t bytes, bool writing, bool queued, bool interrupts, bool interruptProbe)
 

Private Attributes

IoBasem_Registers
 
size_t m_Port
 
MemoryRegion m_Control
 
Slot m_Slots [32]
 
Mutex m_CommandLock
 
Mutex m_StateLock
 
bool m_Online
 
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 24 of file AhciPort.h.

Constructor & Destructor Documentation

◆ AhciPort()

AhciPort::AhciPort ( IoBase registers,
size_t  port 
)

Definition at line 36 of file AhciPort.cc.

◆ ~AhciPort()

AhciPort::~AhciPort ( )

Definition at line 52 of file AhciPort.cc.

Member Function Documentation

◆ acknowledge()

void AhciPort::acknowledge ( uint32_t  status)
private

Definition at line 89 of file AhciPort.cc.

◆ chooseSlot()

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

Definition at line 239 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 
)

Definition at line 384 of file AhciPort.cc.

◆ configureDisk()

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

Definition at line 185 of file AhciPort.cc.

◆ enableInterrupts()

void AhciPort::enableInterrupts ( )

Definition at line 179 of file AhciPort.cc.

◆ initialise()

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

Definition at line 97 of file AhciPort.cc.

◆ interrupt()

bool AhciPort::interrupt ( bool  pending)

Definition at line 228 of file AhciPort.cc.

◆ interruptCompletions()

size_t AhciPort::interruptCompletions ( ) const

Definition at line 542 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 
)
private

Definition at line 256 of file AhciPort.cc.

◆ maximumOutstanding()

size_t AhciPort::maximumOutstanding ( ) const

Definition at line 547 of file AhciPort.cc.

◆ observe()

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

Definition at line 190 of file AhciPort.cc.

◆ pollCompletions()

void AhciPort::pollCompletions ( bool  interrupts)
private

Definition at line 219 of file AhciPort.cc.

◆ read()

uint32_t AhciPort::read ( size_t  reg) const
private

Definition at line 55 of file AhciPort.cc.

◆ readBatch()

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

Definition at line 413 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 
)
private

Definition at line 324 of file AhciPort.cc.

◆ sectorBytes()

size_t AhciPort::sectorBytes ( ) const
inline

Definition at line 39 of file AhciPort.h.

◆ shutdown()

void AhciPort::shutdown ( )

Definition at line 512 of file AhciPort.cc.

◆ stopEngines()

bool AhciPort::stopEngines ( )
private

Definition at line 81 of file AhciPort.cc.

◆ transferBatch()

bool AhciPort::transferBatch ( Disk::ReadBuffer buffers,
size_t  count,
bool  interrupts,
bool  writing 
)
private

Definition at line 433 of file AhciPort.cc.

◆ waitClear()

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

Definition at line 72 of file AhciPort.cc.

◆ waitForProgress()

void AhciPort::waitForProgress ( )
private

Definition at line 61 of file AhciPort.cc.

◆ write()

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

Definition at line 58 of file AhciPort.cc.

◆ writeBatch()

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

Definition at line 417 of file AhciPort.cc.

Member Data Documentation

◆ m_Active

uint32_t AhciPort::m_Active
private

Definition at line 77 of file AhciPort.h.

◆ m_AddressesInstalled

bool AhciPort::m_AddressesInstalled
private

Definition at line 83 of file AhciPort.h.

◆ m_CommandLock

Mutex AhciPort::m_CommandLock
private

Definition at line 74 of file AhciPort.h.

◆ m_Control

MemoryRegion AhciPort::m_Control
private

Definition at line 62 of file AhciPort.h.

◆ m_InterruptCompletions

size_t AhciPort::m_InterruptCompletions
private

Definition at line 85 of file AhciPort.h.

◆ m_MaximumOutstanding

size_t AhciPort::m_MaximumOutstanding
private

Definition at line 86 of file AhciPort.h.

◆ m_Online

bool AhciPort::m_Online
private

Definition at line 76 of file AhciPort.h.

◆ m_Outstanding

size_t AhciPort::m_Outstanding
private

Definition at line 87 of file AhciPort.h.

◆ m_PolledInterrupt

bool AhciPort::m_PolledInterrupt
private

Definition at line 84 of file AhciPort.h.

◆ m_Port

size_t AhciPort::m_Port
private

Definition at line 61 of file AhciPort.h.

◆ m_Queued

uint32_t AhciPort::m_Queued
private

Definition at line 78 of file AhciPort.h.

◆ m_QueueDepth

size_t AhciPort::m_QueueDepth
private

Definition at line 80 of file AhciPort.h.

◆ m_Registers

IoBase* AhciPort::m_Registers
private

Definition at line 60 of file AhciPort.h.

◆ m_SectorBytes

size_t AhciPort::m_SectorBytes
private

Definition at line 81 of file AhciPort.h.

◆ m_SlotCount

size_t AhciPort::m_SlotCount
private

Definition at line 79 of file AhciPort.h.

◆ m_Slots

Slot AhciPort::m_Slots[32]
private

Definition at line 73 of file AhciPort.h.

◆ m_StateLock

Mutex AhciPort::m_StateLock
mutableprivate

Definition at line 75 of file AhciPort.h.

◆ m_SupportsNcq

bool AhciPort::m_SupportsNcq
private

Definition at line 82 of file AhciPort.h.


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