X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/43c43c058ededea929645fef68d15820eed1f5e9..a362b4b2c4abbf2da6ec14cb44a8685a81107f6a:/lunaix-os/includes/hal/ahci/hba.h diff --git a/lunaix-os/includes/hal/ahci/hba.h b/lunaix-os/includes/hal/ahci/hba.h index 287f868..f6c6392 100644 --- a/lunaix-os/includes/hal/ahci/hba.h +++ b/lunaix-os/includes/hal/ahci/hba.h @@ -35,13 +35,21 @@ #define HBA_PxINTR_DMA (1 << 2) #define HBA_PxINTR_DHR (1) #define HBA_PxINTR_DPS (1 << 5) -#define HBA_PxINTR_TFEE (1 << 30) -#define HBA_PxINTR_OFE (1 << 24) -#define HBA_PxINTR_IFE (1 << 27) +#define HBA_PxINTR_TFE (1 << 30) +#define HBA_PxINTR_HBF (1 << 29) +#define HBA_PxINTR_HBD (1 << 28) +#define HBA_PxINTR_IF (1 << 27) +#define HBA_PxINTR_NIF (1 << 26) +#define HBA_PxINTR_OF (1 << 24) #define HBA_PxTFD_ERR (1) #define HBA_PxTFD_BSY (1 << 7) #define HBA_PxTFD_DRQ (1 << 3) +#define HBA_FATAL \ + (HBA_PxINTR_TFE | HBA_PxINTR_HBF | HBA_PxINTR_HBD | HBA_PxINTR_IF) + +#define HBA_NONFATAL (HBA_PxINTR_NIF | HBA_PxINTR_OF) + #define HBA_RGHC_ACHI_ENABLE (1 << 31) #define HBA_RGHC_INTR_ENABLE (1 << 1) #define HBA_RGHC_RESET 1 @@ -73,18 +81,18 @@ struct hba_cmdh { uint16_t options; uint16_t prdt_len; - uint32_t transferred_size; - uint32_t cmd_table_base; - uint32_t reserved[5]; + u32_t transferred_size; + u32_t cmd_table_base; + u32_t reserved[5]; } __HBA_PACKED__; #define HBA_PRDTE_BYTE_CNT(cnt) ((cnt & 0x3FFFFF) | 0x1) struct hba_prdte { - uint32_t data_base; - uint32_t reserved[2]; - uint32_t byte_count; + u32_t data_base; + u32_t reserved[2]; + u32_t byte_count; } __HBA_PACKED__; struct hba_cmdt @@ -105,9 +113,9 @@ struct hba_device { char serial_num[20]; char model[40]; - uint32_t flags; + u32_t flags; uint64_t max_lba; - uint32_t block_size; + u32_t block_size; uint64_t wwn; uint8_t cbd_size; struct @@ -117,9 +125,9 @@ struct hba_device uint8_t status; uint8_t reserve; } last_result; - uint32_t alignment_offset; - uint32_t block_per_sec; - uint32_t capabilities; + u32_t alignment_offset; + u32_t block_per_sec; + u32_t capabilities; struct hba_port* port; struct ahci_hba* hba;