summaryrefslogtreecommitdiff
path: root/include/sys/pci.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-02-04 14:19:54 -0500
committerFreya Murphy <freya@freyacat.org>2024-02-04 14:19:54 -0500
commit1b09896afcf562d199d4df8d671601bba2b1f081 (patch)
treeb4ee4ae8e6e1ff5c5b27fe97509752b17fae330b /include/sys/pci.h
parentfix acpi on uefi, kprint fixes (diff)
downloadcorn-main.tar.gz
corn-main.tar.bz2
corn-main.zip
refactor archHEADmain
Diffstat (limited to '')
-rw-r--r--include/sys/pci.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/sys/pci.h b/include/sys/pci.h
new file mode 100644
index 0000000..1451434
--- /dev/null
+++ b/include/sys/pci.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#ifndef PCI_INTERNAL
+ #error "do not include <sys/pci.h>, only use <pci.h>"
+#endif
+
+#include <stdint.h>
+#include <pci.h>
+
+uint32_t pci_sys_rcfg_d(struct pci_device dev, uint8_t offset);
+uint16_t pci_sys_rcfg_w(struct pci_device dev, uint8_t offset);
+uint8_t pci_sys_rcfg_b(struct pci_device dev, uint8_t offset);
+
+void pci_sys_wcfg_d(struct pci_device dev, uint8_t offset, uint32_t dword);
+void pci_sys_wcfg_w(struct pci_device dev, uint8_t offset, uint16_t word);
+void pci_sys_wcfg_b(struct pci_device dev, uint8_t offset, uint8_t byte);