From 2341a0705164e94d0874572505b60680fdbe631f Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 17 Aug 2022 12:49:34 +0200 Subject: amd64: rtl8139 driver with basic rx support --- src/kernel/arch/amd64/pci.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/kernel/arch/amd64/pci.h (limited to 'src/kernel/arch/amd64/pci.h') 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 + +#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); -- cgit v1.2.3