swissChili | 0d24883 | 2021-04-08 18:16:02 -0700 | [diff] [blame^] | 1 | #pragma once |
2 | |||||
3 | #include <kint.h> | ||||
4 | |||||
5 | struct pci_config_address | ||||
6 | { | ||||
7 | union | ||||
8 | { | ||||
9 | struct | ||||
10 | { | ||||
11 | int enable : 1; | ||||
12 | int reserved : 7; | ||||
13 | int bus : 8; | ||||
14 | int device : 5; | ||||
15 | int function : 3; | ||||
16 | // Offset into the 256 byte register. Least significant two bits must be zero. | ||||
17 | int offset : 8; | ||||
18 | }; | ||||
19 | |||||
20 | uint packed; | ||||
21 | }; | ||||
22 | |||||
23 | } __attribute__((packed)); | ||||
24 | |||||
25 | ushort pci_config_readw(uchar bus, uchar slot, uchar func, uchar offset); |