Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
ahci.hpp
Go to the documentation of this file.
1#ifndef __USB_AHCI__AHCI_HPP__
2#define __USB_AHCI__AHCI_HPP__
3
4#include "ahci/ahci_reg.hpp"
7#include "type.h"
8
14
15class AHCIModule : public IOforgePCI {
16 public:
17 AHCIModule();
18 void load() override;
19 void unload() override;
20 static AHCIModule* getInstance();
21 int submit_impl(struct ioforge_block_device* dev,
22 struct ioforge_block_request* req);
23
24 protected:
25 void port_power_off(ahci_port_t* port);
26 void port_power_on(ahci_port_t* port);
28 void setup();
29 void probe();
30 void
32
33 bool ata_rw(ahci_port_t* p, struct ahci_internal_vaddr* vaddr,
34 struct ioforge_block_request* req);
35 int atapi_packet(ahci_port_t* p, struct ahci_internal_vaddr* vaddr,
36 struct ioforge_block_request* req);
37 int ata_identify(ahci_port_t* p, struct ahci_internal_vaddr* vaddr,
38 struct ioforge_block_request* req, bool is_atapi);
39
40 int ata_flush(ahci_port_t* p, struct ahci_internal_vaddr* vaddr,
41 struct ioforge_block_request* req);
42
44
45 private:
47 ahci_op_t* op;
48 void build_prdt(ahci_cmd_t* cmd, ahci_cmd_tbl_t* cmdtbl,
49 void* buffer, size_t size);
50};
51
52// prototype
53extern "C" int
54submit(struct ioforge_block_device* dev, struct ioforge_block_request* req);
55
56#endif //__USB_AHCI__AHCI_HPP__
int submit(struct ioforge_block_device *dev, struct ioforge_block_request *req)
Definition ahci.cpp:413
void load() override
Definition init.cpp:17
struct ioforge_pci_device * dev_
Definition ahci.hpp:46
void port_reset(ahci_port_t *port)
int ata_flush(ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req)
Definition ahci.cpp:340
void port_power_on(ahci_port_t *port)
Definition ahci.cpp:70
void port_power_off(ahci_port_t *port)
Definition ahci.cpp:42
ahci_op_t * op
Definition ahci.hpp:47
void port_configure(ahci_port_t *port, struct ahci_internal_vaddr *vaddr)
Definition ahci.cpp:418
void unload() override
Definition init.cpp:14
int submit_impl(struct ioforge_block_device *dev, struct ioforge_block_request *req)
Definition ahci.cpp:378
void build_prdt(ahci_cmd_t *cmd, ahci_cmd_tbl_t *cmdtbl, void *buffer, size_t size)
Definition ahci.cpp:159
int atapi_packet(ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req)
Definition ahci.cpp:235
int ata_identify(ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req, bool is_atapi)
Definition ahci.cpp:296
void probe()
Definition ahci.cpp:459
void setup()
Definition ahci.cpp:568
static AHCIModule * getInstance()
Definition init.cpp:10
bool ata_rw(ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req)
Definition ahci.cpp:185
boolean_t issue_and_wait(ahci_port_t *p, int slot, uint32_t timeout)
Definition ahci.cpp:98
AHCIModule()
Definition init.cpp:7
IOforgePCI(const char *mod)
volatile uint8_t cmd
Definition e1000.hpp:3
volatile uint32_t buffer[5]
Definition ehci.hpp:8
uintptr_t fb
Definition ahci.hpp:11
uintptr_t clb
Definition ahci.hpp:10
uintptr_t cmd[32]
Definition ahci.hpp:12
unsigned int uint32_t
Definition type.h:19
uint8_t boolean_t
Definition type.h:89
unsigned long uintptr_t
Definition type.h:73
size_t size
Definition vnode.h:3
struct xhci_slot_ctx slot
Definition xhci.hpp:0