ia64/xen-unstable

view xen/include/asm-ia64/xensystem.h @ 6457:d34925e4144b

Stil more cleanup and moving to 2.6.13 base
author djm@kirby.fc.hp.com
date Thu Sep 01 11:09:27 2005 -0600 (2005-09-01)
parents 9312a3e8a6f8
children b55363593dfc bf3fdeeba48b
line source
1 #ifndef _ASM_IA64_XENSYSTEM_H
2 #define _ASM_IA64_XENSYSTEM_H
3 /*
4 * xen specific context definition
5 *
6 * Copyright (C) 2005 Hewlett-Packard Co.
7 * Dan Magenheimer (dan.magenheimer@hp.com)
8 *
9 * Copyright (C) 2005 Intel Co.
10 * Kun Tian (Kevin Tian) <kevin.tian@intel.com>
11 *
12 */
13 #include <asm/config.h>
14 #include <linux/kernel.h>
16 /* Define HV space hierarchy */
17 #define XEN_VIRT_SPACE_LOW 0xe800000000000000
18 #define XEN_VIRT_SPACE_HIGH 0xf800000000000000
19 /* This is address to mapping rr7 switch stub, in region 5 */
20 #ifdef CONFIG_VTI
21 #define XEN_RR7_SWITCH_STUB 0xb700000000000000
22 #endif // CONFIG_VTI
24 #define XEN_START_ADDR 0xf000000000000000
25 #undef KERNEL_START
26 #define KERNEL_START 0xf000000004000000
27 #undef PERCPU_ADDR
28 #define PERCPU_ADDR 0xf100000000000000-PERCPU_PAGE_SIZE
29 #define SHAREDINFO_ADDR 0xf100000000000000
30 #define VHPT_ADDR 0xf200000000000000
31 #define SHARED_ARCHINFO_ADDR 0xf300000000000000
32 #define XEN_END_ADDR 0xf400000000000000
34 #ifndef __ASSEMBLY__
36 #undef IA64_HAS_EXTRA_STATE
37 #define IA64_HAS_EXTRA_STATE(t) 0
39 #undef __switch_to
40 #ifdef CONFIG_VTI
41 extern struct task_struct *vmx_ia64_switch_to (void *next_task);
42 #define __switch_to(prev,next,last) do { \
43 ia64_save_fpu(prev->arch._thread.fph); \
44 ia64_load_fpu(next->arch._thread.fph); \
45 if (VMX_DOMAIN(prev)) \
46 vmx_save_state(prev); \
47 else { \
48 if (IA64_HAS_EXTRA_STATE(prev)) \
49 ia64_save_extra(prev); \
50 } \
51 if (VMX_DOMAIN(next)) \
52 vmx_load_state(next); \
53 else { \
54 if (IA64_HAS_EXTRA_STATE(next)) \
55 ia64_save_extra(next); \
56 } \
57 ia64_psr(ia64_task_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \
58 (last) = vmx_ia64_switch_to((next)); \
59 } while (0)
60 #else // CONFIG_VTI
61 #define __switch_to(prev,next,last) do { \
62 ia64_save_fpu(prev->arch._thread.fph); \
63 ia64_load_fpu(next->arch._thread.fph); \
64 if (IA64_HAS_EXTRA_STATE(prev)) \
65 ia64_save_extra(prev); \
66 if (IA64_HAS_EXTRA_STATE(next)) \
67 ia64_load_extra(next); \
68 /*ia64_psr(ia64_task_regs(next))->dfh = !ia64_is_local_fpu_owner(next);*/ \
69 (last) = ia64_switch_to((next)); \
70 vcpu_set_next_timer(current); \
71 } while (0)
72 #endif // CONFIG_VTI
74 #define __cmpxchg_user(ptr, new, old, _size) \
75 ({ \
76 register long __gu_r8 asm ("r8"); \
77 register long __gu_r9 asm ("r9"); \
78 asm volatile ("mov ar.ccv=%0;;" :: "rO"(old)); \
79 asm volatile ("mov %1=r0;;\n" \
80 "[1:]\tcmpxchg"_size".acq %0=[%2],%3,ar.ccv\n" \
81 "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \
82 "[1:]" \
83 : "=r"(old), "=r"(__gu_r8) : \
84 "r"(ptr), "r"(new) : "memory"); \
85 __gu_r8; \
86 })
89 // NOTE: Xen defines args as pointer,old,new whereas ia64 uses pointer,new,old
90 // so reverse them here
91 #define cmpxchg_user(_p,_o,_n) \
92 ({ \
93 register long _rc; \
94 ia64_mf(); \
95 switch ( sizeof(*(_p)) ) { \
96 case 1: _rc = __cmpxchg_user(_p,_n,_o,"1"); break; \
97 case 2: _rc = __cmpxchg_user(_p,_n,_o,"2"); break; \
98 case 4: _rc = __cmpxchg_user(_p,_n,_o,"4"); break; \
99 case 8: _rc = __cmpxchg_user(_p,_n,_o,"8"); break; \
100 } \
101 ia64_mf(); \
102 _rc; \
103 })
105 #endif // __ASSEMBLY__
106 #endif // _ASM_IA64_XENSYSTEM_H