ia64/xen-unstable

changeset 6825:1936ccaccf5e

Move hypervisor.h to asm-i386/asm-x86_64.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 14 09:17:44 2005 +0000 (2005-09-14)
parents 0a7194ec36a4
children f5ff107742ce
files linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/i386/mm/init.c linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/drivers/xen/blkback/common.h linux-2.6-xen-sparse/drivers/xen/blkfront/block.h linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h linux-2.6-xen-sparse/drivers/xen/blktap/common.h linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c linux-2.6-xen-sparse/drivers/xen/usbback/common.h linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h linux-2.6-xen-sparse/include/asm-xen/evtchn.h linux-2.6-xen-sparse/include/asm-xen/gnttab.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Wed Sep 14 09:14:32 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Wed Sep 14 09:17:44 2005 +0000
     1.3 @@ -15,7 +15,7 @@
     1.4  #include <asm/apic.h>
     1.5  #include <mach_apic.h>
     1.6  #endif
     1.7 -#include <asm-xen/hypervisor.h>
     1.8 +#include <asm/hypervisor.h>
     1.9  
    1.10  #include "cpu.h"
    1.11  
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Wed Sep 14 09:14:32 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Wed Sep 14 09:17:44 2005 +0000
     2.3 @@ -53,7 +53,7 @@
     2.4  #include <asm/io_apic.h>
     2.5  #include <asm/ist.h>
     2.6  #include <asm/io.h>
     2.7 -#include <asm-xen/hypervisor.h>
     2.8 +#include <asm/hypervisor.h>
     2.9  #include <asm-xen/xen-public/physdev.h>
    2.10  #include <asm-xen/xen-public/memory.h>
    2.11  #include "setup_arch_pre.h"
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Wed Sep 14 09:14:32 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Wed Sep 14 09:17:44 2005 +0000
     3.3 @@ -33,7 +33,7 @@
     3.4  #include <linux/vmalloc.h>
     3.5  #include <asm/page.h>
     3.6  #include <asm/pgtable.h>
     3.7 -#include <asm-xen/hypervisor.h>
     3.8 +#include <asm/hypervisor.h>
     3.9  #include <asm-xen/balloon.h>
    3.10  #include <asm-xen/xen-public/memory.h>
    3.11  #include <linux/module.h>
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Wed Sep 14 09:14:32 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Wed Sep 14 09:17:44 2005 +0000
     4.3 @@ -39,7 +39,7 @@
     4.4  #include <asm/tlb.h>
     4.5  #include <asm/tlbflush.h>
     4.6  #include <asm/sections.h>
     4.7 -#include <asm-xen/hypervisor.h>
     4.8 +#include <asm/hypervisor.h>
     4.9  
    4.10  extern unsigned long *contiguous_bitmap;
    4.11  
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Wed Sep 14 09:14:32 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Wed Sep 14 09:17:44 2005 +0000
     5.3 @@ -25,7 +25,7 @@
     5.4  #include <asm/mmu_context.h>
     5.5  
     5.6  #include <asm-xen/foreign_page.h>
     5.7 -#include <asm-xen/hypervisor.h>
     5.8 +#include <asm/hypervisor.h>
     5.9  
    5.10  void show_mem(void)
    5.11  {
     6.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Wed Sep 14 09:14:32 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Wed Sep 14 09:17:44 2005 +0000
     6.3 @@ -40,7 +40,7 @@
     6.4  #include <asm/synch_bitops.h>
     6.5  #include <asm-xen/xen-public/event_channel.h>
     6.6  #include <asm-xen/xen-public/physdev.h>
     6.7 -#include <asm-xen/hypervisor.h>
     6.8 +#include <asm/hypervisor.h>
     6.9  #include <asm-xen/evtchn.h>
    6.10  
    6.11  /*
     7.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Wed Sep 14 09:14:32 2005 +0000
     7.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Wed Sep 14 09:17:44 2005 +0000
     7.3 @@ -10,7 +10,7 @@
     7.4  #include <asm/irq.h>
     7.5  #include <asm/mmu_context.h>
     7.6  #include <asm-xen/evtchn.h>
     7.7 -#include <asm-xen/hypervisor.h>
     7.8 +#include <asm/hypervisor.h>
     7.9  #include <asm-xen/xen-public/dom0_ops.h>
    7.10  #include <asm-xen/queues.h>
    7.11  #include <asm-xen/xenbus.h>
     8.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Wed Sep 14 09:14:32 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Wed Sep 14 09:17:44 2005 +0000
     8.3 @@ -12,7 +12,7 @@
     8.4  #include <linux/init.h>
     8.5  #include <asm/io.h>
     8.6  #include <asm/page.h>
     8.7 -#include <asm-xen/hypervisor.h>
     8.8 +#include <asm/hypervisor.h>
     8.9  
    8.10  /* Referenced in netback.c. */
    8.11  /*static*/ kmem_cache_t *skbuff_cachep;
     9.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c	Wed Sep 14 09:14:32 2005 +0000
     9.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c	Wed Sep 14 09:17:44 2005 +0000
     9.3 @@ -61,7 +61,7 @@
     9.4  #include <linux/percpu.h>
     9.5  #include <asm-xen/xen-public/physdev.h>
     9.6  #include "setup_arch_pre.h"
     9.7 -#include <asm-xen/hypervisor.h>
     9.8 +#include <asm/hypervisor.h>
     9.9  #define PFN_UP(x)       (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
    9.10  #define PFN_PHYS(x)     ((x) << PAGE_SHIFT)
    9.11  #define end_pfn_map end_pfn
    10.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c	Wed Sep 14 09:14:32 2005 +0000
    10.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c	Wed Sep 14 09:17:44 2005 +0000
    10.3 @@ -31,7 +31,7 @@
    10.4  #include <asm/mman.h>
    10.5  #include <asm/numa.h>
    10.6  #ifdef CONFIG_XEN
    10.7 -#include <asm-xen/hypervisor.h>
    10.8 +#include <asm/hypervisor.h>
    10.9  #endif
   10.10  char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,};
   10.11  
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Wed Sep 14 09:14:32 2005 +0000
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Wed Sep 14 09:17:44 2005 +0000
    11.3 @@ -42,7 +42,7 @@
    11.4  #include <linux/highmem.h>
    11.5  #include <linux/vmalloc.h>
    11.6  #include <asm-xen/xen_proc.h>
    11.7 -#include <asm-xen/hypervisor.h>
    11.8 +#include <asm/hypervisor.h>
    11.9  #include <asm-xen/balloon.h>
   11.10  #include <asm-xen/xen-public/memory.h>
   11.11  #include <asm/pgalloc.h>
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Wed Sep 14 09:14:32 2005 +0000
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Wed Sep 14 09:17:44 2005 +0000
    12.3 @@ -13,7 +13,7 @@
    12.4  #include <asm/setup.h>
    12.5  #include <asm/pgalloc.h>
    12.6  #include <asm-xen/evtchn.h>
    12.7 -#include <asm-xen/hypervisor.h>
    12.8 +#include <asm/hypervisor.h>
    12.9  #include <asm-xen/xen-public/io/blkif.h>
   12.10  #include <asm-xen/xen-public/io/ring.h>
   12.11  #include <asm-xen/gnttab.h>
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Wed Sep 14 09:14:32 2005 +0000
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Wed Sep 14 09:17:44 2005 +0000
    13.3 @@ -45,7 +45,7 @@
    13.4  #include <linux/blkdev.h>
    13.5  #include <linux/major.h>
    13.6  #include <linux/devfs_fs_kernel.h>
    13.7 -#include <asm-xen/hypervisor.h>
    13.8 +#include <asm/hypervisor.h>
    13.9  #include <asm-xen/xenbus.h>
   13.10  #include <asm-xen/xen-public/xen.h>
   13.11  #include <asm-xen/xen-public/io/blkif.h>
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h	Wed Sep 14 09:14:32 2005 +0000
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h	Wed Sep 14 09:17:44 2005 +0000
    14.3 @@ -20,7 +20,7 @@
    14.4  #include <asm/io.h>
    14.5  #include <asm/setup.h>
    14.6  #include <asm/pgalloc.h>
    14.7 -#include <asm-xen/hypervisor.h>
    14.8 +#include <asm/hypervisor.h>
    14.9  #include <asm-xen/xen-public/io/blkif.h>
   14.10  #include <asm-xen/xen-public/io/ring.h>
   14.11  
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/common.h	Wed Sep 14 09:14:32 2005 +0000
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/common.h	Wed Sep 14 09:17:44 2005 +0000
    15.3 @@ -13,7 +13,7 @@
    15.4  #include <asm/setup.h>
    15.5  #include <asm/pgalloc.h>
    15.6  #include <asm-xen/evtchn.h>
    15.7 -#include <asm-xen/hypervisor.h>
    15.8 +#include <asm/hypervisor.h>
    15.9  #include <asm-xen/xen-public/io/blkif.h>
   15.10  #include <asm-xen/xen-public/io/ring.h>
   15.11  #include <asm-xen/gnttab.h>
    16.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Sep 14 09:14:32 2005 +0000
    16.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Sep 14 09:17:44 2005 +0000
    16.3 @@ -50,7 +50,7 @@
    16.4  #include <asm/irq.h>
    16.5  #include <asm/uaccess.h>
    16.6  #include <asm-xen/xen-public/event_channel.h>
    16.7 -#include <asm-xen/hypervisor.h>
    16.8 +#include <asm/hypervisor.h>
    16.9  #include <asm-xen/evtchn.h>
   16.10  
   16.11  #include "xencons_ring.h"
    17.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Wed Sep 14 09:14:32 2005 +0000
    17.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Wed Sep 14 09:17:44 2005 +0000
    17.3 @@ -13,7 +13,7 @@
    17.4  #include <linux/mm.h>
    17.5  #include <linux/slab.h>
    17.6  
    17.7 -#include <asm-xen/hypervisor.h>
    17.8 +#include <asm/hypervisor.h>
    17.9  #include <asm-xen/evtchn.h>
   17.10  #include <linux/wait.h>
   17.11  #include <linux/interrupt.h>
    18.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbback/common.h	Wed Sep 14 09:14:32 2005 +0000
    18.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbback/common.h	Wed Sep 14 09:17:44 2005 +0000
    18.3 @@ -12,7 +12,7 @@
    18.4  #include <asm/io.h>
    18.5  #include <asm/setup.h>
    18.6  #include <asm/pgalloc.h>
    18.7 -#include <asm-xen/hypervisor.h>
    18.8 +#include <asm/hypervisor.h>
    18.9  
   18.10  #include <asm-xen/xen-public/io/usbif.h>
   18.11  
    19.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Wed Sep 14 09:14:32 2005 +0000
    19.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Wed Sep 14 09:17:44 2005 +0000
    19.3 @@ -27,7 +27,7 @@
    19.4   * IN THE SOFTWARE.
    19.5   */
    19.6  
    19.7 -#include <asm-xen/hypervisor.h>
    19.8 +#include <asm/hypervisor.h>
    19.9  #include <asm-xen/evtchn.h>
   19.10  #include <linux/wait.h>
   19.11  #include <linux/interrupt.h>
    20.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Wed Sep 14 09:14:32 2005 +0000
    20.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Wed Sep 14 09:17:44 2005 +0000
    20.3 @@ -27,7 +27,7 @@
    20.4   */
    20.5  #define DEBUG
    20.6  
    20.7 -#include <asm-xen/hypervisor.h>
    20.8 +#include <asm/hypervisor.h>
    20.9  #include <asm-xen/xenbus.h>
   20.10  #include <asm-xen/balloon.h>
   20.11  #include <linux/kernel.h>
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Wed Sep 14 09:17:44 2005 +0000
    21.3 @@ -0,0 +1,189 @@
    21.4 +/******************************************************************************
    21.5 + * hypervisor.h
    21.6 + * 
    21.7 + * Linux-specific hypervisor handling.
    21.8 + * 
    21.9 + * Copyright (c) 2002-2004, K A Fraser
   21.10 + * 
   21.11 + * This file may be distributed separately from the Linux kernel, or
   21.12 + * incorporated into other software packages, subject to the following license:
   21.13 + * 
   21.14 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   21.15 + * of this source file (the "Software"), to deal in the Software without
   21.16 + * restriction, including without limitation the rights to use, copy, modify,
   21.17 + * merge, publish, distribute, sublicense, and/or sell copies of the Software,
   21.18 + * and to permit persons to whom the Software is furnished to do so, subject to
   21.19 + * the following conditions:
   21.20 + * 
   21.21 + * The above copyright notice and this permission notice shall be included in
   21.22 + * all copies or substantial portions of the Software.
   21.23 + * 
   21.24 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   21.25 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   21.26 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   21.27 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   21.28 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   21.29 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
   21.30 + * IN THE SOFTWARE.
   21.31 + */
   21.32 +
   21.33 +#ifndef __HYPERVISOR_H__
   21.34 +#define __HYPERVISOR_H__
   21.35 +
   21.36 +#include <linux/config.h>
   21.37 +#include <linux/types.h>
   21.38 +#include <linux/kernel.h>
   21.39 +#include <linux/version.h>
   21.40 +#include <asm-xen/xen-public/xen.h>
   21.41 +#include <asm-xen/xen-public/dom0_ops.h>
   21.42 +#include <asm-xen/xen-public/io/domain_controller.h>
   21.43 +#include <asm/ptrace.h>
   21.44 +#include <asm/page.h>
   21.45 +#if defined(__i386__)
   21.46 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   21.47 +#  ifdef CONFIG_X86_PAE
   21.48 +#   include <asm-generic/pgtable-nopud.h>
   21.49 +#  else
   21.50 +#   include <asm-generic/pgtable-nopmd.h>
   21.51 +#  endif
   21.52 +# else
   21.53 +#  define pud_t pgd_t
   21.54 +# endif
   21.55 +#endif
   21.56 +
   21.57 +/* arch/xen/i386/kernel/setup.c */
   21.58 +extern start_info_t *xen_start_info;
   21.59 +
   21.60 +/* arch/xen/kernel/evtchn.c */
   21.61 +/* Force a proper event-channel callback from Xen. */
   21.62 +void force_evtchn_callback(void);
   21.63 +
   21.64 +/* arch/xen/kernel/process.c */
   21.65 +void xen_cpu_idle (void);
   21.66 +
   21.67 +/* arch/xen/i386/kernel/hypervisor.c */
   21.68 +void do_hypervisor_callback(struct pt_regs *regs);
   21.69 +
   21.70 +/* arch/xen/i386/kernel/head.S */
   21.71 +void lgdt_finish(void);
   21.72 +
   21.73 +/* arch/xen/i386/mm/hypervisor.c */
   21.74 +/*
   21.75 + * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already
   21.76 + * be MACHINE addresses.
   21.77 + */
   21.78 +
   21.79 +void xen_pt_switch(unsigned long ptr);
   21.80 +void xen_new_user_pt(unsigned long ptr); /* x86_64 only */
   21.81 +void xen_load_gs(unsigned int selector); /* x86_64 only */
   21.82 +void xen_tlb_flush(void);
   21.83 +void xen_invlpg(unsigned long ptr);
   21.84 +
   21.85 +#ifndef CONFIG_XEN_SHADOW_MODE
   21.86 +void xen_l1_entry_update(pte_t *ptr, pte_t val);
   21.87 +void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
   21.88 +void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
   21.89 +void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
   21.90 +void xen_pgd_pin(unsigned long ptr);
   21.91 +void xen_pgd_unpin(unsigned long ptr);
   21.92 +void xen_pud_pin(unsigned long ptr); /* x86_64 only */
   21.93 +void xen_pud_unpin(unsigned long ptr); /* x86_64 only */
   21.94 +void xen_pmd_pin(unsigned long ptr); /* x86_64 only */
   21.95 +void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */
   21.96 +void xen_pte_pin(unsigned long ptr);
   21.97 +void xen_pte_unpin(unsigned long ptr);
   21.98 +#else
   21.99 +#define xen_l1_entry_update(_p, _v) set_pte((_p), (_v))
  21.100 +#define xen_l2_entry_update(_p, _v) set_pgd((_p), (_v))
  21.101 +#define xen_pgd_pin(_p)   ((void)0)
  21.102 +#define xen_pgd_unpin(_p) ((void)0)
  21.103 +#define xen_pte_pin(_p)   ((void)0)
  21.104 +#define xen_pte_unpin(_p) ((void)0)
  21.105 +#endif
  21.106 +
  21.107 +void xen_set_ldt(unsigned long ptr, unsigned long bytes);
  21.108 +void xen_machphys_update(unsigned long mfn, unsigned long pfn);
  21.109 +
  21.110 +#ifdef CONFIG_SMP
  21.111 +#include <linux/cpumask.h>
  21.112 +void xen_tlb_flush_all(void);
  21.113 +void xen_invlpg_all(unsigned long ptr);
  21.114 +void xen_tlb_flush_mask(cpumask_t *mask);
  21.115 +void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr);
  21.116 +#endif
  21.117 +
  21.118 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  21.119 +/* 
  21.120 +** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just 
  21.121 +** include sufficient #defines to allow the below to build. 
  21.122 +*/
  21.123 +#define DEFINE_PER_CPU(type, name) \
  21.124 +    __typeof__(type) per_cpu__##name
  21.125 +
  21.126 +#define per_cpu(var, cpu)           (*((void)cpu, &per_cpu__##var))
  21.127 +#define __get_cpu_var(var)          per_cpu__##var
  21.128 +#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
  21.129 +
  21.130 +#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
  21.131 +#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
  21.132 +#endif /* linux < 2.6.0 */
  21.133 +
  21.134 +void xen_create_contiguous_region(unsigned long vstart, unsigned int order);
  21.135 +void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
  21.136 +
  21.137 +#include <asm/hypercall.h>
  21.138 +
  21.139 +#if defined(CONFIG_X86_64)
  21.140 +#define MULTI_UVMFLAGS_INDEX 2
  21.141 +#define MULTI_UVMDOMID_INDEX 3
  21.142 +#else
  21.143 +#define MULTI_UVMFLAGS_INDEX 3
  21.144 +#define MULTI_UVMDOMID_INDEX 4
  21.145 +#endif
  21.146 +
  21.147 +static inline void
  21.148 +MULTI_update_va_mapping(
  21.149 +    multicall_entry_t *mcl, unsigned long va,
  21.150 +    pte_t new_val, unsigned long flags)
  21.151 +{
  21.152 +    mcl->op = __HYPERVISOR_update_va_mapping;
  21.153 +    mcl->args[0] = va;
  21.154 +#if defined(CONFIG_X86_64)
  21.155 +    mcl->args[1] = new_val.pte;
  21.156 +    mcl->args[2] = flags;
  21.157 +#elif defined(CONFIG_X86_PAE)
  21.158 +    mcl->args[1] = new_val.pte_low;
  21.159 +    mcl->args[2] = new_val.pte_high;
  21.160 +    mcl->args[3] = flags;
  21.161 +#else
  21.162 +    mcl->args[1] = new_val.pte_low;
  21.163 +    mcl->args[2] = 0;
  21.164 +    mcl->args[3] = flags;
  21.165 +#endif
  21.166 +}
  21.167 +
  21.168 +static inline void
  21.169 +MULTI_update_va_mapping_otherdomain(
  21.170 +    multicall_entry_t *mcl, unsigned long va,
  21.171 +    pte_t new_val, unsigned long flags, domid_t domid)
  21.172 +{
  21.173 +    mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
  21.174 +    mcl->args[0] = va;
  21.175 +#if defined(CONFIG_X86_64)
  21.176 +    mcl->args[1] = new_val.pte;
  21.177 +    mcl->args[2] = flags;
  21.178 +    mcl->args[3] = domid;
  21.179 +#elif defined(CONFIG_X86_PAE)
  21.180 +    mcl->args[1] = new_val.pte_low;
  21.181 +    mcl->args[2] = new_val.pte_high;
  21.182 +    mcl->args[3] = flags;
  21.183 +    mcl->args[4] = domid;
  21.184 +#else
  21.185 +    mcl->args[1] = new_val.pte_low;
  21.186 +    mcl->args[2] = 0;
  21.187 +    mcl->args[3] = flags;
  21.188 +    mcl->args[4] = domid;
  21.189 +#endif
  21.190 +}
  21.191 +
  21.192 +#endif /* __HYPERVISOR_H__ */
    22.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Wed Sep 14 09:14:32 2005 +0000
    22.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Wed Sep 14 09:17:44 2005 +0000
    22.3 @@ -2,7 +2,7 @@
    22.4  #define _I386_PGTABLE_H
    22.5  
    22.6  #include <linux/config.h>
    22.7 -#include <asm-xen/hypervisor.h>
    22.8 +#include <asm/hypervisor.h>
    22.9  
   22.10  /*
   22.11   * The Linux memory management assumes a three-level page table setup. On
    23.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Wed Sep 14 09:14:32 2005 +0000
    23.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Wed Sep 14 09:17:44 2005 +0000
    23.3 @@ -7,7 +7,7 @@
    23.4  #include <asm/synch_bitops.h>
    23.5  #include <asm/segment.h>
    23.6  #include <asm/cpufeature.h>
    23.7 -#include <asm-xen/hypervisor.h>
    23.8 +#include <asm/hypervisor.h>
    23.9  #include <asm/smp_alt.h>
   23.10  
   23.11  #ifdef __KERNEL__
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h	Wed Sep 14 09:17:44 2005 +0000
    24.3 @@ -0,0 +1,2 @@
    24.4 +
    24.5 +#include <asm-i386/hypervisor.h>
    25.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Wed Sep 14 09:14:32 2005 +0000
    25.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Wed Sep 14 09:17:44 2005 +0000
    25.3 @@ -12,7 +12,7 @@
    25.4  #include <linux/sched.h>
    25.5  #include <asm/pda.h>
    25.6  #ifdef CONFIG_XEN
    25.7 -#include <asm-xen/hypervisor.h>
    25.8 +#include <asm/hypervisor.h>
    25.9  
   25.10  extern pud_t level3_user_pgt[512];
   25.11  extern pud_t init_level4_user_pgt[];
    26.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Wed Sep 14 09:14:32 2005 +0000
    26.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Wed Sep 14 09:17:44 2005 +0000
    26.3 @@ -5,7 +5,7 @@
    26.4  #include <linux/kernel.h>
    26.5  #include <asm/segment.h>
    26.6  #include <asm/synch_bitops.h>
    26.7 -#include <asm-xen/hypervisor.h>
    26.8 +#include <asm/hypervisor.h>
    26.9  #include <asm-xen/xen-public/arch-x86_64.h>
   26.10  
   26.11  #ifdef __KERNEL__
    27.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Wed Sep 14 09:14:32 2005 +0000
    27.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Wed Sep 14 09:17:44 2005 +0000
    27.3 @@ -33,7 +33,7 @@
    27.4  
    27.5  #include <linux/config.h>
    27.6  #include <linux/interrupt.h>
    27.7 -#include <asm-xen/hypervisor.h>
    27.8 +#include <asm/hypervisor.h>
    27.9  #include <asm/ptrace.h>
   27.10  #include <asm/synch_bitops.h>
   27.11  #include <asm-xen/xen-public/event_channel.h>
    28.1 --- a/linux-2.6-xen-sparse/include/asm-xen/gnttab.h	Wed Sep 14 09:14:32 2005 +0000
    28.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/gnttab.h	Wed Sep 14 09:17:44 2005 +0000
    28.3 @@ -14,7 +14,7 @@
    28.4  #define __ASM_GNTTAB_H__
    28.5  
    28.6  #include <linux/config.h>
    28.7 -#include <asm-xen/hypervisor.h>
    28.8 +#include <asm/hypervisor.h>
    28.9  #include <asm-xen/xen-public/grant_table.h>
   28.10  
   28.11  /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
    29.1 --- a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h	Wed Sep 14 09:14:32 2005 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,189 +0,0 @@
    29.4 -/******************************************************************************
    29.5 - * hypervisor.h
    29.6 - * 
    29.7 - * Linux-specific hypervisor handling.
    29.8 - * 
    29.9 - * Copyright (c) 2002-2004, K A Fraser
   29.10 - * 
   29.11 - * This file may be distributed separately from the Linux kernel, or
   29.12 - * incorporated into other software packages, subject to the following license:
   29.13 - * 
   29.14 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   29.15 - * of this source file (the "Software"), to deal in the Software without
   29.16 - * restriction, including without limitation the rights to use, copy, modify,
   29.17 - * merge, publish, distribute, sublicense, and/or sell copies of the Software,
   29.18 - * and to permit persons to whom the Software is furnished to do so, subject to
   29.19 - * the following conditions:
   29.20 - * 
   29.21 - * The above copyright notice and this permission notice shall be included in
   29.22 - * all copies or substantial portions of the Software.
   29.23 - * 
   29.24 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   29.25 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   29.26 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   29.27 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   29.28 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   29.29 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
   29.30 - * IN THE SOFTWARE.
   29.31 - */
   29.32 -
   29.33 -#ifndef __HYPERVISOR_H__
   29.34 -#define __HYPERVISOR_H__
   29.35 -
   29.36 -#include <linux/config.h>
   29.37 -#include <linux/types.h>
   29.38 -#include <linux/kernel.h>
   29.39 -#include <linux/version.h>
   29.40 -#include <asm-xen/xen-public/xen.h>
   29.41 -#include <asm-xen/xen-public/dom0_ops.h>
   29.42 -#include <asm-xen/xen-public/io/domain_controller.h>
   29.43 -#include <asm/ptrace.h>
   29.44 -#include <asm/page.h>
   29.45 -#if defined(__i386__)
   29.46 -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   29.47 -#  ifdef CONFIG_X86_PAE
   29.48 -#   include <asm-generic/pgtable-nopud.h>
   29.49 -#  else
   29.50 -#   include <asm-generic/pgtable-nopmd.h>
   29.51 -#  endif
   29.52 -# else
   29.53 -#  define pud_t pgd_t
   29.54 -# endif
   29.55 -#endif
   29.56 -
   29.57 -/* arch/xen/i386/kernel/setup.c */
   29.58 -extern start_info_t *xen_start_info;
   29.59 -
   29.60 -/* arch/xen/kernel/evtchn.c */
   29.61 -/* Force a proper event-channel callback from Xen. */
   29.62 -void force_evtchn_callback(void);
   29.63 -
   29.64 -/* arch/xen/kernel/process.c */
   29.65 -void xen_cpu_idle (void);
   29.66 -
   29.67 -/* arch/xen/i386/kernel/hypervisor.c */
   29.68 -void do_hypervisor_callback(struct pt_regs *regs);
   29.69 -
   29.70 -/* arch/xen/i386/kernel/head.S */
   29.71 -void lgdt_finish(void);
   29.72 -
   29.73 -/* arch/xen/i386/mm/hypervisor.c */
   29.74 -/*
   29.75 - * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already
   29.76 - * be MACHINE addresses.
   29.77 - */
   29.78 -
   29.79 -void xen_pt_switch(unsigned long ptr);
   29.80 -void xen_new_user_pt(unsigned long ptr); /* x86_64 only */
   29.81 -void xen_load_gs(unsigned int selector); /* x86_64 only */
   29.82 -void xen_tlb_flush(void);
   29.83 -void xen_invlpg(unsigned long ptr);
   29.84 -
   29.85 -#ifndef CONFIG_XEN_SHADOW_MODE
   29.86 -void xen_l1_entry_update(pte_t *ptr, pte_t val);
   29.87 -void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
   29.88 -void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
   29.89 -void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
   29.90 -void xen_pgd_pin(unsigned long ptr);
   29.91 -void xen_pgd_unpin(unsigned long ptr);
   29.92 -void xen_pud_pin(unsigned long ptr); /* x86_64 only */
   29.93 -void xen_pud_unpin(unsigned long ptr); /* x86_64 only */
   29.94 -void xen_pmd_pin(unsigned long ptr); /* x86_64 only */
   29.95 -void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */
   29.96 -void xen_pte_pin(unsigned long ptr);
   29.97 -void xen_pte_unpin(unsigned long ptr);
   29.98 -#else
   29.99 -#define xen_l1_entry_update(_p, _v) set_pte((_p), (_v))
  29.100 -#define xen_l2_entry_update(_p, _v) set_pgd((_p), (_v))
  29.101 -#define xen_pgd_pin(_p)   ((void)0)
  29.102 -#define xen_pgd_unpin(_p) ((void)0)
  29.103 -#define xen_pte_pin(_p)   ((void)0)
  29.104 -#define xen_pte_unpin(_p) ((void)0)
  29.105 -#endif
  29.106 -
  29.107 -void xen_set_ldt(unsigned long ptr, unsigned long bytes);
  29.108 -void xen_machphys_update(unsigned long mfn, unsigned long pfn);
  29.109 -
  29.110 -#ifdef CONFIG_SMP
  29.111 -#include <linux/cpumask.h>
  29.112 -void xen_tlb_flush_all(void);
  29.113 -void xen_invlpg_all(unsigned long ptr);
  29.114 -void xen_tlb_flush_mask(cpumask_t *mask);
  29.115 -void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr);
  29.116 -#endif
  29.117 -
  29.118 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  29.119 -/* 
  29.120 -** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just 
  29.121 -** include sufficient #defines to allow the below to build. 
  29.122 -*/
  29.123 -#define DEFINE_PER_CPU(type, name) \
  29.124 -    __typeof__(type) per_cpu__##name
  29.125 -
  29.126 -#define per_cpu(var, cpu)           (*((void)cpu, &per_cpu__##var))
  29.127 -#define __get_cpu_var(var)          per_cpu__##var
  29.128 -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
  29.129 -
  29.130 -#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
  29.131 -#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
  29.132 -#endif /* linux < 2.6.0 */
  29.133 -
  29.134 -void xen_create_contiguous_region(unsigned long vstart, unsigned int order);
  29.135 -void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
  29.136 -
  29.137 -#include <asm/hypercall.h>
  29.138 -
  29.139 -#if defined(CONFIG_X86_64)
  29.140 -#define MULTI_UVMFLAGS_INDEX 2
  29.141 -#define MULTI_UVMDOMID_INDEX 3
  29.142 -#else
  29.143 -#define MULTI_UVMFLAGS_INDEX 3
  29.144 -#define MULTI_UVMDOMID_INDEX 4
  29.145 -#endif
  29.146 -
  29.147 -static inline void
  29.148 -MULTI_update_va_mapping(
  29.149 -    multicall_entry_t *mcl, unsigned long va,
  29.150 -    pte_t new_val, unsigned long flags)
  29.151 -{
  29.152 -    mcl->op = __HYPERVISOR_update_va_mapping;
  29.153 -    mcl->args[0] = va;
  29.154 -#if defined(CONFIG_X86_64)
  29.155 -    mcl->args[1] = new_val.pte;
  29.156 -    mcl->args[2] = flags;
  29.157 -#elif defined(CONFIG_X86_PAE)
  29.158 -    mcl->args[1] = new_val.pte_low;
  29.159 -    mcl->args[2] = new_val.pte_high;
  29.160 -    mcl->args[3] = flags;
  29.161 -#else
  29.162 -    mcl->args[1] = new_val.pte_low;
  29.163 -    mcl->args[2] = 0;
  29.164 -    mcl->args[3] = flags;
  29.165 -#endif
  29.166 -}
  29.167 -
  29.168 -static inline void
  29.169 -MULTI_update_va_mapping_otherdomain(
  29.170 -    multicall_entry_t *mcl, unsigned long va,
  29.171 -    pte_t new_val, unsigned long flags, domid_t domid)
  29.172 -{
  29.173 -    mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
  29.174 -    mcl->args[0] = va;
  29.175 -#if defined(CONFIG_X86_64)
  29.176 -    mcl->args[1] = new_val.pte;
  29.177 -    mcl->args[2] = flags;
  29.178 -    mcl->args[3] = domid;
  29.179 -#elif defined(CONFIG_X86_PAE)
  29.180 -    mcl->args[1] = new_val.pte_low;
  29.181 -    mcl->args[2] = new_val.pte_high;
  29.182 -    mcl->args[3] = flags;
  29.183 -    mcl->args[4] = domid;
  29.184 -#else
  29.185 -    mcl->args[1] = new_val.pte_low;
  29.186 -    mcl->args[2] = 0;
  29.187 -    mcl->args[3] = flags;
  29.188 -    mcl->args[4] = domid;
  29.189 -#endif
  29.190 -}
  29.191 -
  29.192 -#endif /* __HYPERVISOR_H__ */