rework external irq system, introduce hierarchical irq
[lunaix-os.git] / lunaix-os / includes / hal / ahci / ahci.h
index 2ed135aba3d00a14f287b2c90a2a7b998337d4cf..b55ba9581c2c09f2f2921347c84cc42c98735c00 100644 (file)
@@ -2,6 +2,8 @@
 #define __LUNAIX_AHCI_H
 
 #include "hba.h"
+#include <asm-generic/isrm.h>
+#include <hal/irq.h>
 
 /*
  * Macro naming rule:
@@ -21,18 +23,18 @@ struct ahci_driver
     int id;
 };
 
-/**
- * @brief 初始化AHCI与HBA
- *
- */
-void
-ahci_init();
+struct ahci_driver_param
+{
+    ptr_t mmio_base;
+    size_t mmio_size;
+    irq_t irq;
+};
 
 void
-ahci_parse_dev_info(struct hba_device* dev_info, uint16_t* data);
+ahci_parse_dev_info(struct hba_device* dev_info, u16_t* data);
 
 void
-ahci_parsestr(char* str, uint16_t* reg_start, int size_word);
+ahci_parsestr(char* str, u16_t* reg_start, int size_word);
 
 /**
  * @brief Issue a HBA command (synchronized)
@@ -54,4 +56,10 @@ ahci_try_send(struct hba_port* port, int slot);
 void
 ahci_post(struct hba_port* port, struct hba_cmd_state* state, int slot);
 
+struct ahci_driver*
+ahci_driver_init(struct ahci_driver_param* param);
+
+void
+ahci_hba_isr(irq_t irq, const struct hart_state* hstate);
+
 #endif /* __LUNAIX_AHCI_H */