ia64/xen-unstable

view xen/include/public/arch-ia64.h @ 12938:b58670602d35

[POWERPC][XEN] Builtin cmdline dependency rule
Rebuild cmdline.o when the user changes the CMDLINE=X argument passed to
the make invocation. I couldn't find an example of another project that
handles this case properly, so I came up with this.
Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Thu Oct 05 15:48:26 2006 -0500 (2006-10-05)
parents 3ac52066af81
children 05d227d81935
line source
1 /******************************************************************************
2 * arch-ia64/hypervisor-if.h
3 *
4 * Guest OS interface to IA64 Xen.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 */
26 #ifndef __HYPERVISOR_IF_IA64_H__
27 #define __HYPERVISOR_IF_IA64_H__
29 /* Structural guest handles introduced in 0x00030201. */
30 #if __XEN_INTERFACE_VERSION__ >= 0x00030201
31 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
32 typedef struct { type *p; } __guest_handle_ ## name
33 #else
34 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
35 typedef type * __guest_handle_ ## name
36 #endif
38 #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
39 #define XEN_GUEST_HANDLE(name) __guest_handle_ ## name
40 #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0)
41 #ifdef __XEN_TOOLS__
42 #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)
43 #endif
45 #ifndef __ASSEMBLY__
46 /* Guest handles for primitive C types. */
47 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
48 __DEFINE_XEN_GUEST_HANDLE(uint, unsigned int);
49 __DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
50 __DEFINE_XEN_GUEST_HANDLE(u64, unsigned long);
51 DEFINE_XEN_GUEST_HANDLE(char);
52 DEFINE_XEN_GUEST_HANDLE(int);
53 DEFINE_XEN_GUEST_HANDLE(long);
54 DEFINE_XEN_GUEST_HANDLE(void);
56 typedef unsigned long xen_pfn_t;
57 DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
58 #endif
60 /* Arch specific VIRQs definition */
61 #define VIRQ_ITC VIRQ_ARCH_0 /* V. Virtual itc timer */
63 /* Maximum number of virtual CPUs in multi-processor guests. */
64 /* WARNING: before changing this, check that shared_info fits on a page */
65 #define MAX_VIRT_CPUS 64
67 #ifndef __ASSEMBLY__
69 typedef unsigned long xen_ulong_t;
71 #define INVALID_MFN (~0UL)
73 #define MEM_G (1UL << 30)
74 #define MEM_M (1UL << 20)
76 #define MMIO_START (3 * MEM_G)
77 #define MMIO_SIZE (512 * MEM_M)
79 #define VGA_IO_START 0xA0000UL
80 #define VGA_IO_SIZE 0x20000
82 #define LEGACY_IO_START (MMIO_START + MMIO_SIZE)
83 #define LEGACY_IO_SIZE (64*MEM_M)
85 #define IO_PAGE_START (LEGACY_IO_START + LEGACY_IO_SIZE)
86 #define IO_PAGE_SIZE PAGE_SIZE
88 #define STORE_PAGE_START (IO_PAGE_START + IO_PAGE_SIZE)
89 #define STORE_PAGE_SIZE PAGE_SIZE
91 #define BUFFER_IO_PAGE_START (STORE_PAGE_START+PAGE_SIZE)
92 #define BUFFER_IO_PAGE_SIZE PAGE_SIZE
94 #define IO_SAPIC_START 0xfec00000UL
95 #define IO_SAPIC_SIZE 0x100000
97 #define PIB_START 0xfee00000UL
98 #define PIB_SIZE 0x200000
100 #define GFW_START (4*MEM_G -16*MEM_M)
101 #define GFW_SIZE (16*MEM_M)
103 struct pt_fpreg {
104 union {
105 unsigned long bits[2];
106 long double __dummy; /* force 16-byte alignment */
107 } u;
108 };
110 struct cpu_user_regs {
111 /* The following registers are saved by SAVE_MIN: */
112 unsigned long b6; /* scratch */
113 unsigned long b7; /* scratch */
115 unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
116 unsigned long ar_ssd; /* reserved for future use (scratch) */
118 unsigned long r8; /* scratch (return value register 0) */
119 unsigned long r9; /* scratch (return value register 1) */
120 unsigned long r10; /* scratch (return value register 2) */
121 unsigned long r11; /* scratch (return value register 3) */
123 unsigned long cr_ipsr; /* interrupted task's psr */
124 unsigned long cr_iip; /* interrupted task's instruction pointer */
125 unsigned long cr_ifs; /* interrupted task's function state */
127 unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
128 unsigned long ar_pfs; /* prev function state */
129 unsigned long ar_rsc; /* RSE configuration */
130 /* The following two are valid only if cr_ipsr.cpl > 0: */
131 unsigned long ar_rnat; /* RSE NaT */
132 unsigned long ar_bspstore; /* RSE bspstore */
134 unsigned long pr; /* 64 predicate registers (1 bit each) */
135 unsigned long b0; /* return pointer (bp) */
136 unsigned long loadrs; /* size of dirty partition << 16 */
138 unsigned long r1; /* the gp pointer */
139 unsigned long r12; /* interrupted task's memory stack pointer */
140 unsigned long r13; /* thread pointer */
142 unsigned long ar_fpsr; /* floating point status (preserved) */
143 unsigned long r15; /* scratch */
145 /* The remaining registers are NOT saved for system calls. */
147 unsigned long r14; /* scratch */
148 unsigned long r2; /* scratch */
149 unsigned long r3; /* scratch */
150 unsigned long r16; /* scratch */
151 unsigned long r17; /* scratch */
152 unsigned long r18; /* scratch */
153 unsigned long r19; /* scratch */
154 unsigned long r20; /* scratch */
155 unsigned long r21; /* scratch */
156 unsigned long r22; /* scratch */
157 unsigned long r23; /* scratch */
158 unsigned long r24; /* scratch */
159 unsigned long r25; /* scratch */
160 unsigned long r26; /* scratch */
161 unsigned long r27; /* scratch */
162 unsigned long r28; /* scratch */
163 unsigned long r29; /* scratch */
164 unsigned long r30; /* scratch */
165 unsigned long r31; /* scratch */
166 unsigned long ar_ccv; /* compare/exchange value (scratch) */
168 /*
169 * Floating point registers that the kernel considers scratch:
170 */
171 struct pt_fpreg f6; /* scratch */
172 struct pt_fpreg f7; /* scratch */
173 struct pt_fpreg f8; /* scratch */
174 struct pt_fpreg f9; /* scratch */
175 struct pt_fpreg f10; /* scratch */
176 struct pt_fpreg f11; /* scratch */
177 unsigned long r4; /* preserved */
178 unsigned long r5; /* preserved */
179 unsigned long r6; /* preserved */
180 unsigned long r7; /* preserved */
181 unsigned long eml_unat; /* used for emulating instruction */
182 unsigned long pad0; /* alignment pad */
184 };
185 typedef struct cpu_user_regs cpu_user_regs_t;
187 union vac {
188 unsigned long value;
189 struct {
190 int a_int:1;
191 int a_from_int_cr:1;
192 int a_to_int_cr:1;
193 int a_from_psr:1;
194 int a_from_cpuid:1;
195 int a_cover:1;
196 int a_bsw:1;
197 long reserved:57;
198 };
199 };
200 typedef union vac vac_t;
202 union vdc {
203 unsigned long value;
204 struct {
205 int d_vmsw:1;
206 int d_extint:1;
207 int d_ibr_dbr:1;
208 int d_pmc:1;
209 int d_to_pmd:1;
210 int d_itm:1;
211 long reserved:58;
212 };
213 };
214 typedef union vdc vdc_t;
216 struct mapped_regs {
217 union vac vac;
218 union vdc vdc;
219 unsigned long virt_env_vaddr;
220 unsigned long reserved1[29];
221 unsigned long vhpi;
222 unsigned long reserved2[95];
223 union {
224 unsigned long vgr[16];
225 unsigned long bank1_regs[16]; // bank1 regs (r16-r31) when bank0 active
226 };
227 union {
228 unsigned long vbgr[16];
229 unsigned long bank0_regs[16]; // bank0 regs (r16-r31) when bank1 active
230 };
231 unsigned long vnat;
232 unsigned long vbnat;
233 unsigned long vcpuid[5];
234 unsigned long reserved3[11];
235 unsigned long vpsr;
236 unsigned long vpr;
237 unsigned long reserved4[76];
238 union {
239 unsigned long vcr[128];
240 struct {
241 unsigned long dcr; // CR0
242 unsigned long itm;
243 unsigned long iva;
244 unsigned long rsv1[5];
245 unsigned long pta; // CR8
246 unsigned long rsv2[7];
247 unsigned long ipsr; // CR16
248 unsigned long isr;
249 unsigned long rsv3;
250 unsigned long iip;
251 unsigned long ifa;
252 unsigned long itir;
253 unsigned long iipa;
254 unsigned long ifs;
255 unsigned long iim; // CR24
256 unsigned long iha;
257 unsigned long rsv4[38];
258 unsigned long lid; // CR64
259 unsigned long ivr;
260 unsigned long tpr;
261 unsigned long eoi;
262 unsigned long irr[4];
263 unsigned long itv; // CR72
264 unsigned long pmv;
265 unsigned long cmcv;
266 unsigned long rsv5[5];
267 unsigned long lrr0; // CR80
268 unsigned long lrr1;
269 unsigned long rsv6[46];
270 };
271 };
272 union {
273 unsigned long reserved5[128];
274 struct {
275 unsigned long precover_ifs;
276 unsigned long unat; // not sure if this is needed until NaT arch is done
277 int interrupt_collection_enabled; // virtual psr.ic
278 /* virtual interrupt deliverable flag is evtchn_upcall_mask in
279 * shared info area now. interrupt_mask_addr is the address
280 * of evtchn_upcall_mask for current vcpu
281 */
282 unsigned char *interrupt_mask_addr;
283 int pending_interruption;
284 int incomplete_regframe; // see SDM vol2 6.8
285 unsigned char vpsr_pp;
286 unsigned char reserved5_2[7];
287 unsigned long reserved5_1[3];
288 int metaphysical_mode; // 1 = use metaphys mapping, 0 = use virtual
289 int banknum; // 0 or 1, which virtual register bank is active
290 unsigned long rrs[8]; // region registers
291 unsigned long krs[8]; // kernel registers
292 unsigned long pkrs[8]; // protection key registers
293 unsigned long tmp[8]; // temp registers (e.g. for hyperprivops)
294 };
295 };
296 };
297 typedef struct mapped_regs mapped_regs_t;
299 struct vpd {
300 struct mapped_regs vpd_low;
301 unsigned long reserved6[3456];
302 unsigned long vmm_avail[128];
303 unsigned long reserved7[4096];
304 };
305 typedef struct vpd vpd_t;
307 struct arch_vcpu_info {
308 };
309 typedef struct arch_vcpu_info arch_vcpu_info_t;
311 struct arch_shared_info {
312 /* PFN of the start_info page. */
313 unsigned long start_info_pfn;
315 /* Interrupt vector for event channel. */
316 int evtchn_vector;
318 uint64_t pad[32];
319 };
320 typedef struct arch_shared_info arch_shared_info_t;
322 typedef unsigned long xen_callback_t;
324 struct ia64_tr_entry {
325 unsigned long pte;
326 unsigned long itir;
327 unsigned long vadr;
328 unsigned long rid;
329 };
331 struct vcpu_extra_regs {
332 struct ia64_tr_entry itrs[8];
333 struct ia64_tr_entry dtrs[8];
334 unsigned long iva;
335 unsigned long dcr;
336 unsigned long event_callback_ip;
337 };
339 struct vcpu_guest_context {
340 #define VGCF_EXTRA_REGS (1<<1) /* Get/Set extra regs. */
341 unsigned long flags; /* VGCF_* flags */
343 struct cpu_user_regs user_regs;
344 struct vcpu_extra_regs extra_regs;
345 unsigned long privregs_pfn;
346 };
347 typedef struct vcpu_guest_context vcpu_guest_context_t;
348 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
350 /* dom0 vp op */
351 #define __HYPERVISOR_ia64_dom0vp_op __HYPERVISOR_arch_0
352 /* Map io space in machine address to dom0 physical address space.
353 Currently physical assigned address equals to machine address. */
354 #define IA64_DOM0VP_ioremap 0
356 /* Convert a pseudo physical page frame number to the corresponding
357 machine page frame number. If no page is assigned, INVALID_MFN or
358 GPFN_INV_MASK is returned depending on domain's non-vti/vti mode. */
359 #define IA64_DOM0VP_phystomach 1
361 /* Convert a machine page frame number to the corresponding pseudo physical
362 page frame number of the caller domain. */
363 #define IA64_DOM0VP_machtophys 3
365 /* Reserved for future use. */
366 #define IA64_DOM0VP_iounmap 4
368 /* Unmap and free pages contained in the specified pseudo physical region. */
369 #define IA64_DOM0VP_zap_physmap 5
371 /* Assign machine page frame to dom0's pseudo physical address space. */
372 #define IA64_DOM0VP_add_physmap 6
374 /* expose the p2m table into domain */
375 #define IA64_DOM0VP_expose_p2m 7
377 // flags for page assignement to pseudo physical address space
378 #define _ASSIGN_readonly 0
379 #define ASSIGN_readonly (1UL << _ASSIGN_readonly)
380 #define ASSIGN_writable (0UL << _ASSIGN_readonly) // dummy flag
381 /* Internal only: memory attribute must be WC/UC/UCE. */
382 #define _ASSIGN_nocache 1
383 #define ASSIGN_nocache (1UL << _ASSIGN_nocache)
384 // tlb tracking
385 #define _ASSIGN_tlb_track 2
386 #define ASSIGN_tlb_track (1UL << _ASSIGN_tlb_track)
387 /* Internal only: associated with PGC_allocated bit */
388 #define _ASSIGN_pgc_allocated 3
389 #define ASSIGN_pgc_allocated (1UL << _ASSIGN_pgc_allocated)
391 /* This structure has the same layout of struct ia64_boot_param, defined in
392 <asm/system.h>. It is redefined here to ease use. */
393 struct xen_ia64_boot_param {
394 unsigned long command_line; /* physical address of cmd line args */
395 unsigned long efi_systab; /* physical address of EFI system table */
396 unsigned long efi_memmap; /* physical address of EFI memory map */
397 unsigned long efi_memmap_size; /* size of EFI memory map */
398 unsigned long efi_memdesc_size; /* size of an EFI memory map descriptor */
399 unsigned int efi_memdesc_version; /* memory descriptor version */
400 struct {
401 unsigned short num_cols; /* number of columns on console. */
402 unsigned short num_rows; /* number of rows on console. */
403 unsigned short orig_x; /* cursor's x position */
404 unsigned short orig_y; /* cursor's y position */
405 } console_info;
406 unsigned long fpswa; /* physical address of the fpswa interface */
407 unsigned long initrd_start;
408 unsigned long initrd_size;
409 unsigned long domain_start; /* va where the boot time domain begins */
410 unsigned long domain_size; /* how big is the boot domain */
411 };
413 #endif /* !__ASSEMBLY__ */
415 /* Size of the shared_info area (this is not related to page size). */
416 #define XSI_SHIFT 14
417 #define XSI_SIZE (1 << XSI_SHIFT)
418 /* Log size of mapped_regs area (64 KB - only 4KB is used). */
419 #define XMAPPEDREGS_SHIFT 12
420 #define XMAPPEDREGS_SIZE (1 << XMAPPEDREGS_SHIFT)
421 /* Offset of XASI (Xen arch shared info) wrt XSI_BASE. */
422 #define XMAPPEDREGS_OFS XSI_SIZE
424 /* Hyperprivops. */
425 #define HYPERPRIVOP_RFI 0x1
426 #define HYPERPRIVOP_RSM_DT 0x2
427 #define HYPERPRIVOP_SSM_DT 0x3
428 #define HYPERPRIVOP_COVER 0x4
429 #define HYPERPRIVOP_ITC_D 0x5
430 #define HYPERPRIVOP_ITC_I 0x6
431 #define HYPERPRIVOP_SSM_I 0x7
432 #define HYPERPRIVOP_GET_IVR 0x8
433 #define HYPERPRIVOP_GET_TPR 0x9
434 #define HYPERPRIVOP_SET_TPR 0xa
435 #define HYPERPRIVOP_EOI 0xb
436 #define HYPERPRIVOP_SET_ITM 0xc
437 #define HYPERPRIVOP_THASH 0xd
438 #define HYPERPRIVOP_PTC_GA 0xe
439 #define HYPERPRIVOP_ITR_D 0xf
440 #define HYPERPRIVOP_GET_RR 0x10
441 #define HYPERPRIVOP_SET_RR 0x11
442 #define HYPERPRIVOP_SET_KR 0x12
443 #define HYPERPRIVOP_FC 0x13
444 #define HYPERPRIVOP_GET_CPUID 0x14
445 #define HYPERPRIVOP_GET_PMD 0x15
446 #define HYPERPRIVOP_GET_EFLAG 0x16
447 #define HYPERPRIVOP_SET_EFLAG 0x17
448 #define HYPERPRIVOP_RSM_BE 0x18
449 #define HYPERPRIVOP_GET_PSR 0x19
450 #define HYPERPRIVOP_MAX 0x19
452 /* Fast and light hypercalls. */
453 #define __HYPERVISOR_ia64_fast_eoi 0x0200
455 /* Xencomm macros. */
456 #define XENCOMM_INLINE_MASK 0xf800000000000000UL
457 #define XENCOMM_INLINE_FLAG 0x8000000000000000UL
459 #define XENCOMM_IS_INLINE(addr) \
460 (((unsigned long)(addr) & XENCOMM_INLINE_MASK) == XENCOMM_INLINE_FLAG)
461 #define XENCOMM_INLINE_ADDR(addr) \
462 ((unsigned long)(addr) & ~XENCOMM_INLINE_MASK)
463 #endif /* __HYPERVISOR_IF_IA64_H__ */
465 /*
466 * Local variables:
467 * mode: C
468 * c-set-style: "BSD"
469 * c-basic-offset: 4
470 * tab-width: 4
471 * indent-tabs-mode: nil
472 * End:
473 */