feat: initial locking etc.
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#define NEW_KERNEL_PCI_H
|
||||
|
||||
#include <types.h>
|
||||
#include <stdbool.h>
|
||||
#include <attributes.h>
|
||||
|
||||
#define PCI_CLASS_MASS_STORAGE 0x01
|
||||
|
||||
@@ -130,8 +132,47 @@ typedef struct pci_device {
|
||||
} driver_state;
|
||||
} pci_device;
|
||||
|
||||
typedef union {
|
||||
uint16_t value;
|
||||
struct {
|
||||
bool io_space: 1;
|
||||
bool mem_space: 1;
|
||||
bool bus_master: 1;
|
||||
bool special_cycles: 1;
|
||||
bool mem_write_invalidate_enable: 1;
|
||||
bool vga_palette_snoop: 1;
|
||||
bool parity_error_response: 1;
|
||||
uint8_t reserved: 1;
|
||||
bool serr_enable: 1;
|
||||
bool fast_b2b_enable: 1;
|
||||
bool interrupt_disable: 1;
|
||||
uint8_t reserved2: 5;
|
||||
} packed command;
|
||||
} pci_command_register_t;
|
||||
|
||||
typedef union {
|
||||
uint16_t value;
|
||||
struct {
|
||||
uint8_t reserved: 3;
|
||||
bool interrupt_status: 1;
|
||||
bool capabilities_list: 1;
|
||||
bool speed_66mhz_capable: 1;
|
||||
uint8_t reserved2: 1;
|
||||
bool fast_b2b_capable: 1;
|
||||
bool master_data_parity_error: 1;
|
||||
uint8_t devsel_timing: 2;
|
||||
bool signaled_target_abort: 1;
|
||||
bool received_target_abort: 1;
|
||||
bool received_master_abort: 1;
|
||||
bool signaled_system_error: 1;
|
||||
bool detected_parity_error: 1;
|
||||
} packed status;
|
||||
} pci_status_register_t;
|
||||
|
||||
void pci_print_info();
|
||||
|
||||
void pci_dump_caps();
|
||||
|
||||
uint32_t pci_register_driver(const pci_driver *pci_driver);
|
||||
|
||||
void pci_sort_drivers();
|
||||
|
||||
Reference in New Issue
Block a user