Classes | |
| struct | HBA_MEM |
| Generic Host Control registers. More... | |
| struct | HBA_PORT |
| Port Control registers. More... | |
| struct | HBA_CMD_HDR |
| Command header structure, size = 32 bytes. More... | |
| struct | HBA_PRDT_ENTRY |
| Physical region descriptor table entry, size = 16 bytes. More... | |
| struct | HBA_CMD_TBL |
| struct | PORT_DATA |
| Contains virtual mappings for port phys memory regions. More... | |
| struct | FIS_REG_H2D |
| Register FIS ? Host to Device. More... | |
| struct | FIS_REG_D2H |
| Register FIS ? Device to Host. More... | |
| struct | FIS_DATA |
| Data FIS ? Bidirectional. More... | |
| struct | FIS_PIO_SETUP |
| PIO Setup ? Device to Host. More... | |
| struct | FIS_DMA_SETUP |
| DMA Setup ? Device to Host. More... | |
| struct | FIS_DEV_BITS |
| Set device bits FIS - device to host. More... | |
| struct | HBA_FIS |
| struct | AHCI_CTR |
| AHCI controller structure. More... | |
Functions | |
| void | ahci_port_identify (dword pdata) |
| Identify drive on port ; TODO check in: pdata - address of PORT_DATA structure. More... | |
| void | ahci_querymedia (arg_t pdata, arg_t mediainfo) |
| void | ahci_rw_sectors (dword pdata, dword vbuf, qword startsector, dword numsectors, dword is_write) |
| Read/write sectors, note: currently work for SATA, not SATAPI return value: 0 = success, otherwise = error. More... | |
| void | ahci_read (dword pdata, dword buffer, qword startsector, dword numsectors_ptr) |
| Read sectors return value: 0 = success, otherwise = error. More... | |
| void | ahci_write (dword pdata, dword buffer, qword startsector, dword numsectors_ptr) |
| Write sectors return value: 0 = success, otherwise = error. More... | |
| void | ahci_port_wait (dword port, dword timeout) |
| waits until the port is no longer busy before issuing a new command in: [port] - address of HBA_PORT structure [timeout] - timeout (in iterations) out: eax = 0 if success, 1 if timeout expired More... | |
| void | ahci_port_cmd_wait (dword port, dword cmdslot) |
| Wait for command completion in: [port] - address of HBA_PORT structure [cmdslot] - number of command slot out: eax = 0 if success, 1 if error , timeout: dword. More... | |
| void | ahci_port_rebase (dword port, dword portno, dword pdata) |
| ------------------------------------------------------------------------— in: port - address of HBA_PORT structure portno - port index (0..31) pdata - address of PORT_DATA structure out: rebases port and fills pdata with mappings More... | |
| void | ahci_find_cmdslot (dword pdata) |
| --------------------------------------------------------— ; TODO check Find a free command list slot in: pdata - address of HBA_PORT structure out: eax - if not found -1, else slot index More... | |
| void | _memset (dword dest, byte val, dword cnt) |
| doesnt clobber any registers More... | |
| void | swap_bytes_in_words (dword base, dword len) |
| Swaps byte order in words base - address of first word len - how many words to swap bytes in doesnt clobber any registers. More... | |
| void _memset | ( | dword | dest, |
| byte | val, | ||
| dword | cnt | ||
| ) |
doesnt clobber any registers
| void ahci_find_cmdslot | ( | dword | pdata | ) |
--------------------------------------------------------— ; TODO check Find a free command list slot in: pdata - address of HBA_PORT structure out: eax - if not found -1, else slot index
| void ahci_port_cmd_wait | ( | dword | port, |
| dword | cmdslot | ||
| ) |
Wait for command completion in: [port] - address of HBA_PORT structure [cmdslot] - number of command slot out: eax = 0 if success, 1 if error , timeout: dword.
| void ahci_port_identify | ( | dword | pdata | ) |
Identify drive on port ; TODO check in: pdata - address of PORT_DATA structure.
| void ahci_port_rebase | ( | dword | port, |
| dword | portno, | ||
| dword | pdata | ||
| ) |
------------------------------------------------------------------------— in: port - address of HBA_PORT structure portno - port index (0..31) pdata - address of PORT_DATA structure out: rebases port and fills pdata with mappings
| void ahci_port_wait | ( | dword | port, |
| dword | timeout | ||
| ) |
waits until the port is no longer busy before issuing a new command in: [port] - address of HBA_PORT structure [timeout] - timeout (in iterations) out: eax = 0 if success, 1 if timeout expired
| void ahci_querymedia | ( | arg_t | pdata, |
| arg_t | mediainfo | ||
| ) |
| void ahci_read | ( | dword | pdata, |
| dword | buffer, | ||
| qword | startsector, | ||
| dword | numsectors_ptr | ||
| ) |
Read sectors return value: 0 = success, otherwise = error.
| void ahci_rw_sectors | ( | dword | pdata, |
| dword | vbuf, | ||
| qword | startsector, | ||
| dword | numsectors, | ||
| dword | is_write | ||
| ) |
Read/write sectors, note: currently work for SATA, not SATAPI return value: 0 = success, otherwise = error.
| void ahci_write | ( | dword | pdata, |
| dword | buffer, | ||
| qword | startsector, | ||
| dword | numsectors_ptr | ||
| ) |
Write sectors return value: 0 = success, otherwise = error.
| void swap_bytes_in_words | ( | dword | base, |
| dword | len | ||
| ) |
Swaps byte order in words base - address of first word len - how many words to swap bytes in doesnt clobber any registers.
| label ahci_callbacks |
| label ahci_init |
--------------------------------------------------------------------— detect ahci controller and initialize
| label ahci_start_cmd |
Start command engine in: eax - address of HBA_PORT structure.
| label ahci_stop_cmd |
Stop command engine in: eax - address of HBA_PORT structure.
| dd buf_phys |
| dd buf_virt |
| dd cmdheader |
| dd cmdslot |
| dd cmdtable |
| AHCI_CTR ctr1_data |
| AHCI_CTR ctr2_data |
| AHCI_CTR ctr3_data |
| AHCI_CTR ctr4_data |
| AHCI_CTR ctr5_data |
| AHCI_CTR ctr6_data |
| AHCI_CTR ctr7_data |
| AHCI_CTR ctr8_data |
| dd ctr_counter |
TODO: satapi_dev_counter dd 0 ; satapi devices (optical drives) counter controllers counter.
| dd ctr_ptr |
| dd cur_antioffset |
| dd cur_phys |
| dd cur_phys_page |
| dd cur_prd |
| dd dbc |
| db hd_name |
| rb modelstr |
| dd new_phys_region_start |
| dd next_phys_page |
| dd numsectors |
| dd phys_page1 |
| dd phys_page23 |
| dd phys_region_start |
| dd prdt_bytes_total |
| dd sata_dev_counter |
| dd tmp |
| rb tmpstr |
| dd vbuf_len |
| dd vbuf_orig |
| dd virt_page1 |
| dd virt_page23 |