No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / xen / include / i82093var.h
blob55afbec40b43688abc142de4e04d73fcc81e4d1f
1 /* $NetBSD: i82093var.h,v 1.2 2008/04/14 13:38:03 cegger Exp $ */
3 #include "opt_xen.h"
4 #define _IOAPIC_CUSTOM_RW
5 #include <x86/i82093var.h>
6 #include <hypervisor.h>
8 static inline uint32_t
9 ioapic_read_ul(struct ioapic_softc *sc, int regid)
11 physdev_op_t op;
12 int ret;
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);
18 if (ret) {
19 printf("PHYSDEVOP_APIC_READ ret %d\n", ret);
20 panic("PHYSDEVOP_APIC_READ");
22 return op.u.apic_op.value;
25 static inline void
26 ioapic_write_ul(struct ioapic_softc *sc, int regid, uint32_t val)
28 physdev_op_t op;
29 int ret;
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);
36 if (ret) {
37 printf("PHYSDEVOP_APIC_WRITE ret %d\n", ret);
38 panic("PHYSDEVOP_APIC_WRITE");