1 /* $NetBSD: i82093var.h,v 1.2 2008/04/14 13:38:03 cegger Exp $ */
4 #define _IOAPIC_CUSTOM_RW
5 #include <x86/i82093var.h>
6 #include <hypervisor.h>
9 ioapic_read_ul(struct ioapic_softc
*sc
, int regid
)
14 op
.cmd
= PHYSDEVOP_APIC_READ
;
15 op
.u
.apic_op
.apic_physbase
= sc
->sc_pa
;
16 op
.u
.apic_op
.reg
= regid
;
17 ret
= HYPERVISOR_physdev_op(&op
);
19 printf("PHYSDEVOP_APIC_READ ret %d\n", ret
);
20 panic("PHYSDEVOP_APIC_READ");
22 return op
.u
.apic_op
.value
;
26 ioapic_write_ul(struct ioapic_softc
*sc
, int regid
, uint32_t val
)
31 op
.cmd
= PHYSDEVOP_APIC_WRITE
;
32 op
.u
.apic_op
.apic_physbase
= sc
->sc_pa
;
33 op
.u
.apic_op
.reg
= regid
;
34 op
.u
.apic_op
.value
= val
;
35 ret
= HYPERVISOR_physdev_op(&op
);
37 printf("PHYSDEVOP_APIC_WRITE ret %d\n", ret
);
38 panic("PHYSDEVOP_APIC_WRITE");