blob: 196a5253f9e0488f91bab6eabbf797884095925e [file] [log] [blame]
swissChili0d248832021-04-08 18:16:02 -07001#pragma once
2
3#include <kint.h>
4
5struct 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
25ushort pci_config_readw(uchar bus, uchar slot, uchar func, uchar offset);