struct elroy_regs {
u_int32_t pci_id;
u_int32_t pci_cmdstat;
u_int32_t pci_class;
u_int32_t pci_bhlc;
u_int32_t res0[0x30/4];
u_int32_t pci_conf_addr;
u_int32_t pad040;
u_int32_t pci_conf_data;
u_int32_t pad048;
u_int64_t elroy_mtlt;
u_int32_t busnum;
u_int32_t par058;
u_int64_t res1;
u_int64_t rope;
u_int64_t err_addr;
u_int64_t suspend;
u_int32_t arb_mask;
u_int32_t pad080;
#define ELROY_ARB_ENABLE 0x01
#define ELROY_ARB_PCIDEVA 0x02
#define ELROY_ARB_PCIDEVB 0x04
#define ELROY_ARB_PCIDEVC 0x08
#define ELROY_ARB_PCIDEVD 0x10
#define ELROY_ARB_PCIDEVE 0x20
#define ELROY_ARB_PCIDEVF 0x40
#define ELROY_ARB_PCIDEVG 0x80
u_int64_t arb_pri;
u_int64_t arb_mode;
u_int64_t mtlt;
u_int64_t res2[12];
u_int64_t mod_info;
u_int32_t control;
#define ELROY_CONTROL_RF 0x01
#define ELROY_CONTROL_VE 0x08
#define ELROY_CONTROL_CL 0x10
#define ELROY_CONTROL_CE 0x20
#define ELROY_CONTROL_HF 0x40
u_int32_t status;
#define ELROY_STATUS_RC 0x01
#define ELROY_STATUS_BITS "\020\01RC"
u_int64_t res3[30];
u_int64_t lmmio_base;
u_int64_t lmmio_mask;
u_int64_t gmmio_base;
u_int64_t gmmio_mask;
u_int64_t wlmmio_base;
u_int64_t wlmmio_mask;
u_int64_t wgmmio_base;
u_int64_t wgmmio_mask;
u_int32_t io_base;
u_int32_t pad240;
u_int32_t io_mask;
u_int32_t pad248;
u_int32_t res4[4];
u_int32_t eio_base;
u_int32_t pad260;
u_int32_t eio_mask;
u_int32_t pad268;
#define ELROY_BASE_RE 0x01
u_int64_t res5;
u_int64_t dmac_ctrl;
u_int64_t res6[16];
u_int32_t ibase;
u_int32_t pad300;
u_int32_t imask;
u_int32_t pad308;
u_int64_t hint_cfg;
u_int64_t res7[13];
u_int64_t hints[14];
u_int64_t res8[2];
u_int64_t res9[64];
u_int64_t pad0;
u_int64_t pci_drive;
u_int64_t rope_cfg;
u_int64_t clk_ctl;
u_int32_t pad1;
u_int32_t res10[23];
u_int32_t err_cfg;
u_int32_t pad680;
#define ELROY_ERRCFG_PW 0x01
#define ELROY_ERRCFG_PR 0x02
#define ELROY_ERRCFG_DW 0x04
#define ELROY_ERRCFG_DR 0x08
#define ELROY_ERRCFG_CM 0x10
#define ELROY_ERRCFG_SMART 0x20
u_int64_t err_stat;
u_int64_t err_mid;
u_int64_t rope_estat;
u_int64_t rope_eclr;
u_int64_t res11[42];
u_int64_t regbus;
u_int32_t apic_addr;
u_int32_t pad800;
u_int64_t res12;
u_int32_t apic_data;
u_int32_t pad808;
u_int64_t res13[5];
u_int32_t apic_eoi;
u_int32_t pad840;
u_int32_t apic_softint;
u_int32_t pad850;
u_int64_t res14[123];
} __packed;
#define APIC_VERSION 0x01
#define APIC_VERSION_MASK 0xff
#define APIC_VERSION_NENT 0xff0000
#define APIC_VERSION_NENT_SHIFT 16
#define APIC_ENT0(i) (0x10 + (i)*2)
#define APIC_ENT0_VEC 0x000ff
#define APIC_ENT0_MOD 0x00700
#define APIC_ENT0_FXD 0x00000
#define APIC_ENT0_RDR 0x00100
#define APIC_ENT0_PMI 0x00200
#define APIC_ENT0_NMI 0x00400
#define APIC_ENT0_INI 0x00500
#define APIC_ENT0_EXT 0x00700
#define APIC_ENT0_PEND 0x01000
#define APIC_ENT0_LOW 0x02000
#define APIC_ENT0_LEV 0x08000
#define APIC_ENT0_MASK 0x10000
#define APIC_ENT1(i) (0x11 + (i)*2)