Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / arch / x86 / xen / apic.c
CommitLineData
31b3c9d7 1#include <linux/init.h>
87e4baac 2
31b3c9d7 3#include <asm/x86_init.h>
ab6ec39a 4#include <asm/apic.h>
ab6ec39a 5#include <asm/xen/hypercall.h>
31b3c9d7 6
87e4baac
IM
7#include <xen/xen.h>
8#include <xen/interface/physdev.h>
b8b0f559 9#include "xen-ops.h"
87e4baac 10
b8b0f559 11static unsigned int xen_io_apic_read(unsigned apic, unsigned reg)
31b3c9d7 12{
ab6ec39a
LM
13 struct physdev_apic apic_op;
14 int ret;
15
16 apic_op.apic_physbase = mpc_ioapic_addr(apic);
17 apic_op.reg = reg;
18 ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op);
19 if (!ret)
20 return apic_op.value;
21
22 /* fallback to return an emulated IO_APIC values */
31b3c9d7
KRW
23 if (reg == 0x1)
24 return 0x00170020;
25 else if (reg == 0x0)
26 return apic << 24;
27
28 return 0xfd;
29}
30
31void __init xen_init_apic(void)
32{
33 x86_io_apic_ops.read = xen_io_apic_read;
34}
This page took 0.145665 seconds and 5 git commands to generate.