ref: 7ab86494986671bf38464435f57fb6f925ce8632
dir: /sys/src/cmd/vmx/dat.h/
typedef struct PCIDev PCIDev; typedef struct PCICap PCICap; typedef struct PCIBar PCIBar; typedef struct Region Region; extern int halt, irqactive; enum { BY2PG = 4096 }; #define RPC "pc" #define RSP "sp" #define RAX "ax" #define RBX "bx" #define RCX "cx" #define RDX "dx" #define RBP "bp" #define RSI "si" #define RDI "di" #define R8 "r8" #define R9 "r9" #define R10 "r10" #define R11 "r11" #define R12 "r12" #define R13 "r13" #define R14 "r14" #define R15 "r15" enum { MMIORD = 0, MMIOWRP = 1, MMIOWR = 2, }; struct Region { uintptr start, end; enum { REGNO, REGMEM, REGFB } type; char *segname; uvlong segoff; void *v, *ve; Region *next; }; extern Region *mmap; #define BDF(b,d,f) ((b)<<16&0xff0000|(d)<<11&0xf800|(f)<<8&0x700) struct PCIBar { PCIDev *d; u8int type; u32int addr, length; PCIBar *busnext, *busprev; u32int (*io)(int, u16int, u32int, int, void *); void *aux; }; enum { /* type */ BARIO = 1, BARMEM32 = 0, BARMEM64 = 4, BARPREF = 8, }; struct PCIDev { u32int bdf, viddid, clrev, subid; u16int ctrl; u8int irqno, irqactive; PCIBar bar[6]; PCIDev *next; PCICap *cap; u8int capalloc; }; struct PCICap { PCIDev *dev; u8int length; u8int addr; u32int (*read)(PCICap *, u8int); void (*write)(PCICap *, u8int, u32int, u32int); PCICap *next; }; enum { /* irqline argument */ IRQLTOGGLE = -1, IRQLLOHI = -2, /* postexc */ NOERRC = -1, }; typedef struct VgaMode VgaMode; struct VgaMode { u16int no; int w, h, hbytes, sz; u32int chan; VgaMode *next; };