blob: 68cdd618def8e4a5d93c4dbc625d31d97d467b77 [file] [log] [blame]
swissChili0d248832021-04-08 18:16:02 -07001#pragma once
2
3#include <kint.h>
4
swissChili7a6f5eb2021-04-13 16:46:02 -07005enum
6{
7 PCI_CONFIG_ADDRESS = 0xCF8,
8 PCI_CONFIG_DATA = 0xCFC,
9};
10
swissChili0d248832021-04-08 18:16:02 -070011struct pci_config_address
12{
13 union
14 {
15 struct
16 {
17 int enable : 1;
18 int reserved : 7;
19 int bus : 8;
20 int device : 5;
21 int function : 3;
22 // Offset into the 256 byte register. Least significant two bits must be zero.
23 int offset : 8;
24 };
25
26 uint packed;
27 };
28
29} __attribute__((packed));
30
31ushort pci_config_readw(uchar bus, uchar slot, uchar func, uchar offset);