Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apic.c
Go to the documentation of this file.
1 #include <linux/init.h>
2 
3 #include <asm/x86_init.h>
4 #include <asm/apic.h>
5 #include <asm/xen/hypercall.h>
6 
7 #include <xen/xen.h>
9 #include "xen-ops.h"
10 
11 static unsigned int xen_io_apic_read(unsigned apic, unsigned reg)
12 {
13  struct physdev_apic apic_op;
14  int ret;
15 
16  apic_op.apic_physbase = mpc_ioapic_addr(apic);
17  apic_op.reg = reg;
19  if (!ret)
20  return apic_op.value;
21 
22  /* fallback to return an emulated IO_APIC values */
23  if (reg == 0x1)
24  return 0x00170020;
25  else if (reg == 0x0)
26  return apic << 24;
27 
28  return 0xfd;
29 }
30 
32 {
33  x86_io_apic_ops.read = xen_io_apic_read;
34 }