summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/pci.h
diff options
context:
space:
mode:
authordzwdz2022-08-17 12:49:34 +0200
committerdzwdz2022-08-17 12:49:34 +0200
commit2341a0705164e94d0874572505b60680fdbe631f (patch)
treeaea0bcd5c2339076b10d9e416ea1af4d1fb48400 /src/kernel/arch/amd64/pci.h
parent63fd7ce362c7f1d59365045f19cf1ca87ffe2db9 (diff)
amd64: rtl8139 driver with basic rx support
Diffstat (limited to 'src/kernel/arch/amd64/pci.h')
-rw-r--r--src/kernel/arch/amd64/pci.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/kernel/arch/amd64/pci.h b/src/kernel/arch/amd64/pci.h
new file mode 100644
index 0000000..0efe24e
--- /dev/null
+++ b/src/kernel/arch/amd64/pci.h
@@ -0,0 +1,15 @@
+#pragma once
+#include <stdint.h>
+
+#define PCICFG_CMD 0x4
+
+uint8_t pcicfg_r8(uint32_t bdf, uint32_t offset);
+uint16_t pcicfg_r16(uint32_t bdf, uint32_t offset);
+uint32_t pcicfg_r32(uint32_t bdf, uint32_t offset);
+
+void pcicfg_w16(uint32_t bdf, uint32_t offset, uint32_t value);
+void pcicfg_w32(uint32_t bdf, uint32_t offset, uint32_t value);
+
+uint16_t pcicfg_iobase(uint32_t bdf);
+
+void pci_init(void);