5 typedef struct PCIDev PCIDev;
6 typedef struct PCICap PCICap;
7 typedef struct PCIBar PCIBar;
8 typedef struct Region Region;
40 #define RFLAGS "flags"
51 REGALLOC = 1, /* allocate memory for region */
52 REGR = 2, /* can read */
53 REGW = 4, /* can write */
54 REGX = 8, /* can execute */
56 REGRWX = REGR|REGW|REGX,
59 /* E820 types, 0 == omitted from memory map */
60 REGFREE = 1<<8, /* report to OS as free */
61 REGRES = 2<<8, /* report to OS as reserved */
67 int (*mmio)(uintptr, void *, int, int);
72 #define BDF(b,d,f) ((b)<<16&0xff0000|(d)<<11&0xf800|(f)<<8&0x700)
78 PCIBar *busnext, *busprev;
79 u32int (*io)(int, u16int, u32int, int, void *);
92 u32int bdf, viddid, clrev, subid;
94 u8int irqno, irqactive;
105 u32int (*read)(PCICap *, u8int);
106 void (*write)(PCICap *, u8int, u32int, u32int);
111 /* irqline argument */
119 typedef struct VgaMode VgaMode;
122 int w, h, hbytes, sz;
127 extern uchar cmos[0x30];
129 extern void (*kconfig)(void);
131 /* arguments for x86access */
146 ACCSAFE = 0x100, /* don't post exceptions on fault */
149 /* used to speed up consecutive x86access calls */
150 typedef struct TLB TLB;