#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "../blk/block.h"
#include "../../mtstatus.h"
Go to the source code of this file.
◆ AHCI_DEV_NULL
◆ AHCI_DEV_PM
◆ AHCI_DEV_SATA
◆ AHCI_DEV_SATAPI
| #define AHCI_DEV_SATAPI 4 |
◆ AHCI_DEV_SEMB
◆ AHCI_MAX_PORTS
| #define AHCI_MAX_PORTS 32 |
◆ ATA_CMD_READ_DMA_EX
| #define ATA_CMD_READ_DMA_EX 0x25 |
◆ ATA_CMD_WRITE_DMA_EX
| #define ATA_CMD_WRITE_DMA_EX 0x35 |
◆ ATA_DEV_BSY
◆ ATA_DEV_DRQ
◆ ATA_DEV_ERR
◆ HBA_CMD_HDR_A_BIT
| #define HBA_CMD_HDR_A_BIT (1u << 5) |
◆ HBA_CMD_HDR_CFL_MASK
| #define HBA_CMD_HDR_CFL_MASK 0x0000001Fu |
◆ HBA_CMD_HDR_P_BIT
| #define HBA_CMD_HDR_P_BIT (1u << 7) |
◆ HBA_CMD_HDR_PRDTL_MASK
| #define HBA_CMD_HDR_PRDTL_MASK 0xFFFF0000u |
◆ HBA_CMD_HDR_W_BIT
| #define HBA_CMD_HDR_W_BIT (1u << 6) |
◆ HBA_PORT_DET_PRESENT
| #define HBA_PORT_DET_PRESENT 3 |
◆ HBA_PORT_IPM_ACTIVE
| #define HBA_PORT_IPM_ACTIVE 1 |
◆ HBA_PxCMD_CR
| #define HBA_PxCMD_CR 0x8000 |
◆ HBA_PxCMD_FR
| #define HBA_PxCMD_FR 0x4000 |
◆ HBA_PxCMD_FRE
| #define HBA_PxCMD_FRE 0x0010 |
◆ HBA_PxCMD_ST
| #define HBA_PxCMD_ST 0x0001 |
◆ HBA_PxIS_TFES
| #define HBA_PxIS_TFES (1 << 30) /* TFES - Task File Error Status */ |
◆ FIS_REG_H2D
Register - Host to Device FIS (FIS_TYPE_REG_H2D)
◆ FIS_TYPE
◆ HBA_CMD_HEADER
HBA Command Header (defines an AHCI Command)
◆ HBA_CMD_TBL
Command Table: one per slot.
◆ HBA_MEM
AHCI Register layout (Global HBA Registers)
◆ HBA_PORT
Per port registers at HBA_MEM + 0x100 + (port * 0x80)
◆ HBA_PRDT_ENTRY
Physical Region Descriptor Table Entry.
◆ _FIS_TYPE
| Enumerator |
|---|
| FIS_TYPE_REG_H2D | |
| FIS_TYPE_REG_D2H | |
| FIS_TYPE_DMA_ACT | |
| FIS_TYPE_DMA_SETUP | |
| FIS_TYPE_DATA | |
| FIS_TYPE_BIST | |
| FIS_TYPE_PIO_SETUP | |
| FIS_TYPE_DEV_BITS | |
Definition at line 19 of file ahci.h.
◆ ahci_get_block_device()
◆ ahci_init()
#define AHCI_DEBUG_PRINT
Initialize the AHCI Driver.
- Returns
- True or False based if it initialized correctly or not. (if failure = bugcheck)
Definition at line 292 of file ahci.c.
◆ ahci_read_sector()
Read a single bytes-byte sector from the given LBA on a specific BLOCK_DEVICE.
- Parameters
-
| dev | Takes the BLOCK_DEVICE device pointer (on register_block_device) |
| lba | LBA to read from. |
| buf | Return buffer to place the data read. |
- Returns
- True or False based on succession | buf pointer changes.
Definition at line 330 of file ahci.c.
◆ ahci_write_sector()
Write a single bytes-byte sector to given LBA on a specific BLOCK_DEVICE.
- Parameters
-
| dev | Takes the BLOCK_DEVICE device pointer (on register_block_device) |
| lba | LBA to read from. |
| buf | The buffer to write to the specified LBA. |
- Returns
- True or False based on succession
Definition at line 450 of file ahci.c.