pci: msi-x support

This commit is contained in:
Matheus
2023-07-19 15:08:51 -03:00
parent 5e85429c5e
commit 1879bfcc20
3 changed files with 85 additions and 8 deletions
+6
View File
@@ -8,6 +8,7 @@
#include <arch/io.h>
#include <arch/acpi.h>
#include <kernel/pmm.h>
#include <arch/cpu.h>
static size_t mcfgentrycount;
static mcfgentry_t *mcfgentries;
@@ -65,6 +66,11 @@ static void mcfg_write32(int bus, int device, int function, uint32_t offset, uin
*address = value;
}
static uint64_t msiformatmessage(uint32_t *data, int vector, int edgetrigger, int deassert) {
*data = (edgetrigger << 15) | (deassert << 14) | vector;
return 0xfee00000 | (_cpu()->id << 12);
}
static void pci_archinit() {
mcfg_t *mcfg = arch_acpi_findtable("MCFG", 0);
if (mcfg) {