NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HostAhciPort Class Reference

A single AHCI port with its command list and receive FIS buffer. More...

Inheritance diagram for HostAhciPort:
StaticReceiver< HostAhciPort > Device

Public Member Functions

unsigned init (unsigned short *buffer)
 Initialize the port.
void debug ()
void irq ()
bool receive (MessageDisk &msg)
 HostAhciPort (HostAhciPortRegister *regs, DBus< MessageHostOp > &bus_hostop, DBus< MessageDiskCommit > &bus_commit, Clock *clock, unsigned disknr, unsigned max_slots, bool dmar)
- Public Member Functions inherited from StaticReceiver< HostAhciPort >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Private Member Functions

unsigned wait_timeout (volatile unsigned *reg, unsigned mask, unsigned value)
void addr2phys (void *ptr, volatile unsigned *dst)
 Translate a virtual to a physical address.
void set_command (unsigned char command, unsigned long long sector, bool read, unsigned count=0, bool atapi=false, unsigned pmp=0, unsigned features=0)
bool add_dma (char *ptr, unsigned count)
bool add_prd (void *buffer, unsigned count)
unsigned start_command (unsigned long usertag)
unsigned identify_drive (unsigned short *buffer)
unsigned set_features (unsigned features, unsigned count=0)

Private Attributes

HostAhciPortRegister volatile * _regs
DBus< MessageHostOp > & _bus_hostop
DBus< MessageDiskCommit > & _bus_commit
Clock_clock
unsigned _disknr
unsigned _max_slots
bool _dmar
unsigned * _cl
unsigned * _ct
unsigned * _fis
unsigned _tag
HostGenericAta _params
unsigned long _usertags [32]
unsigned _inprogress

Static Private Attributes

static const unsigned CL_DWORDS = 8
static const unsigned MAX_PRD_COUNT = 64
static unsigned const FREQ = 1000
static unsigned const TIMEOUT = 200

Additional Inherited Members

- Static Public Member Functions inherited from StaticReceiver< HostAhciPort >
static bool receive_static (Device *o, M &msg)

Detailed Description

A single AHCI port with its command list and receive FIS buffer.

State: testing Supports: read-sectors, write-sectors, identify-drive Missing: ATAPI detection

Constructor & Destructor Documentation

HostAhciPort::HostAhciPort ( HostAhciPortRegister regs,
DBus< MessageHostOp > &  bus_hostop,
DBus< MessageDiskCommit > &  bus_commit,
Clock clock,
unsigned  disknr,
unsigned  max_slots,
bool  dmar 
)
inline

Member Function Documentation

bool HostAhciPort::add_dma ( char *  ptr,
unsigned  count 
)
inlineprivate
bool HostAhciPort::add_prd ( void *  buffer,
unsigned  count 
)
inlineprivate
void HostAhciPort::addr2phys ( void *  ptr,
volatile unsigned *  dst 
)
inlineprivate

Translate a virtual to a physical address.

void HostAhciPort::debug ( )
inline
unsigned HostAhciPort::identify_drive ( unsigned short *  buffer)
inlineprivate
unsigned HostAhciPort::init ( unsigned short *  buffer)
inline

Initialize the port.

void HostAhciPort::irq ( )
inline
bool HostAhciPort::receive ( MessageDisk msg)
inline
void HostAhciPort::set_command ( unsigned char  command,
unsigned long long  sector,
bool  read,
unsigned  count = 0,
bool  atapi = false,
unsigned  pmp = 0,
unsigned  features = 0 
)
inlineprivate
unsigned HostAhciPort::set_features ( unsigned  features,
unsigned  count = 0 
)
inlineprivate
unsigned HostAhciPort::start_command ( unsigned long  usertag)
inlineprivate
unsigned HostAhciPort::wait_timeout ( volatile unsigned *  reg,
unsigned  mask,
unsigned  value 
)
inlineprivate

Member Data Documentation

DBus<MessageDiskCommit>& HostAhciPort::_bus_commit
private
DBus<MessageHostOp>& HostAhciPort::_bus_hostop
private
unsigned* HostAhciPort::_cl
private
Clock* HostAhciPort::_clock
private
unsigned* HostAhciPort::_ct
private
unsigned HostAhciPort::_disknr
private
bool HostAhciPort::_dmar
private
unsigned* HostAhciPort::_fis
private
unsigned HostAhciPort::_inprogress
private
unsigned HostAhciPort::_max_slots
private
HostGenericAta HostAhciPort::_params
private
HostAhciPortRegister volatile* HostAhciPort::_regs
private
unsigned HostAhciPort::_tag
private
unsigned long HostAhciPort::_usertags[32]
private
const unsigned HostAhciPort::CL_DWORDS = 8
staticprivate
unsigned const HostAhciPort::FREQ = 1000
staticprivate
const unsigned HostAhciPort::MAX_PRD_COUNT = 64
staticprivate
unsigned const HostAhciPort::TIMEOUT = 200
staticprivate

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