feat: initial locking etc.

This commit is contained in:
2021-03-01 21:07:53 +01:00
parent ebe006a8ba
commit 990b850c43
14 changed files with 427 additions and 14 deletions

View File

@@ -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();