ia64/xen-unstable

view linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h @ 8534:da7873110bbb

Tiny bootstrap cleanup.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jan 09 19:46:46 2006 +0100 (2006-01-09)
parents 419b32f72179
children 990c009015e8
line source
1 /******************************************************************************
2 * hypervisor.h
3 *
4 * Linux-specific hypervisor handling.
5 *
6 * Copyright (c) 2002-2004, K A Fraser
7 *
8 * This file may be distributed separately from the Linux kernel, or
9 * incorporated into other software packages, subject to the following license:
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this source file (the "Software"), to deal in the Software without
13 * restriction, including without limitation the rights to use, copy, modify,
14 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
15 * and to permit persons to whom the Software is furnished to do so, subject to
16 * the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27 * IN THE SOFTWARE.
28 */
30 #ifndef __HYPERVISOR_H__
31 #define __HYPERVISOR_H__
33 #include <linux/config.h>
34 #include <linux/types.h>
35 #include <linux/kernel.h>
36 #include <linux/version.h>
37 #include <asm-xen/xen-public/xen.h>
38 #include <asm-xen/xen-public/dom0_ops.h>
39 #include <asm/ptrace.h>
40 #include <asm/page.h>
41 #if defined(__i386__)
42 # ifdef CONFIG_X86_PAE
43 # include <asm-generic/pgtable-nopud.h>
44 # else
45 # include <asm-generic/pgtable-nopmd.h>
46 # endif
47 #endif
49 extern shared_info_t *HYPERVISOR_shared_info;
51 /* arch/xen/i386/kernel/setup.c */
52 extern start_info_t *xen_start_info;
54 /* arch/xen/kernel/evtchn.c */
55 /* Force a proper event-channel callback from Xen. */
56 void force_evtchn_callback(void);
58 /* arch/xen/kernel/process.c */
59 void xen_cpu_idle (void);
61 /* arch/xen/i386/kernel/hypervisor.c */
62 void do_hypervisor_callback(struct pt_regs *regs);
64 /* arch/xen/i386/kernel/head.S */
65 void lgdt_finish(void);
67 /* arch/xen/i386/mm/hypervisor.c */
68 /*
69 * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already
70 * be MACHINE addresses.
71 */
73 void xen_pt_switch(unsigned long ptr);
74 void xen_new_user_pt(unsigned long ptr); /* x86_64 only */
75 void xen_load_gs(unsigned int selector); /* x86_64 only */
76 void xen_tlb_flush(void);
77 void xen_invlpg(unsigned long ptr);
79 #ifndef CONFIG_XEN_SHADOW_MODE
80 void xen_l1_entry_update(pte_t *ptr, pte_t val);
81 void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
82 void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
83 void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
84 void xen_pgd_pin(unsigned long ptr);
85 void xen_pgd_unpin(unsigned long ptr);
86 void xen_pud_pin(unsigned long ptr); /* x86_64 only */
87 void xen_pud_unpin(unsigned long ptr); /* x86_64 only */
88 void xen_pmd_pin(unsigned long ptr); /* x86_64 only */
89 void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */
90 void xen_pte_pin(unsigned long ptr);
91 void xen_pte_unpin(unsigned long ptr);
92 #else
93 #define xen_l1_entry_update(_p, _v) set_pte((_p), (_v))
94 #define xen_l2_entry_update(_p, _v) set_pgd((_p), (_v))
95 #define xen_pgd_pin(_p) ((void)0)
96 #define xen_pgd_unpin(_p) ((void)0)
97 #define xen_pte_pin(_p) ((void)0)
98 #define xen_pte_unpin(_p) ((void)0)
99 #endif
101 void xen_set_ldt(unsigned long ptr, unsigned long bytes);
102 void xen_machphys_update(unsigned long mfn, unsigned long pfn);
104 #ifdef CONFIG_SMP
105 #include <linux/cpumask.h>
106 void xen_tlb_flush_all(void);
107 void xen_invlpg_all(unsigned long ptr);
108 void xen_tlb_flush_mask(cpumask_t *mask);
109 void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr);
110 #endif
112 /* Returns zero on success else negative errno. */
113 int xen_create_contiguous_region(
114 unsigned long vstart, unsigned int order, unsigned int address_bits);
115 void xen_destroy_contiguous_region(
116 unsigned long vstart, unsigned int order);
118 #include <asm/hypercall.h>
120 #if defined(CONFIG_X86_64)
121 #define MULTI_UVMFLAGS_INDEX 2
122 #define MULTI_UVMDOMID_INDEX 3
123 #else
124 #define MULTI_UVMFLAGS_INDEX 3
125 #define MULTI_UVMDOMID_INDEX 4
126 #endif
128 #define xen_init() (0)
130 static inline void
131 MULTI_update_va_mapping(
132 multicall_entry_t *mcl, unsigned long va,
133 pte_t new_val, unsigned long flags)
134 {
135 mcl->op = __HYPERVISOR_update_va_mapping;
136 mcl->args[0] = va;
137 #if defined(CONFIG_X86_64)
138 mcl->args[1] = new_val.pte;
139 mcl->args[2] = flags;
140 #elif defined(CONFIG_X86_PAE)
141 mcl->args[1] = new_val.pte_low;
142 mcl->args[2] = new_val.pte_high;
143 mcl->args[3] = flags;
144 #else
145 mcl->args[1] = new_val.pte_low;
146 mcl->args[2] = 0;
147 mcl->args[3] = flags;
148 #endif
149 }
151 static inline void
152 MULTI_update_va_mapping_otherdomain(
153 multicall_entry_t *mcl, unsigned long va,
154 pte_t new_val, unsigned long flags, domid_t domid)
155 {
156 mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
157 mcl->args[0] = va;
158 #if defined(CONFIG_X86_64)
159 mcl->args[1] = new_val.pte;
160 mcl->args[2] = flags;
161 mcl->args[3] = domid;
162 #elif defined(CONFIG_X86_PAE)
163 mcl->args[1] = new_val.pte_low;
164 mcl->args[2] = new_val.pte_high;
165 mcl->args[3] = flags;
166 mcl->args[4] = domid;
167 #else
168 mcl->args[1] = new_val.pte_low;
169 mcl->args[2] = 0;
170 mcl->args[3] = flags;
171 mcl->args[4] = domid;
172 #endif
173 }
175 #endif /* __HYPERVISOR_H__ */