diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-05-19 09:13:34 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-05-27 17:40:18 -0400 |
commit | 1ff730b52f0c3e4e3846c3ff345c5526b2633ba9 (patch) | |
tree | 59a614eaa0679ba0ccd99e1f910ceeb22fc31948 /include/asm-ia64/intrinsics.h | |
parent | 3e0879deb700f322f6c81ab34f056fc72d15ec02 (diff) |
[IA64] pvops: introduce pv_cpu_ops to paravirtualize privileged instructions.
introduce pv_cpu_ops to paravirtualize privleged instructions
which are defined by ia64 intrinsics.
make them indirect C function calls by introducing function
tables, pv_cpu_ops.
Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include/asm-ia64/intrinsics.h')
-rw-r--r-- | include/asm-ia64/intrinsics.h | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/include/asm-ia64/intrinsics.h b/include/asm-ia64/intrinsics.h index a3b96892f83f..47d686dba1eb 100644 --- a/include/asm-ia64/intrinsics.h +++ b/include/asm-ia64/intrinsics.h | |||
@@ -18,15 +18,15 @@ | |||
18 | # include <asm/gcc_intrin.h> | 18 | # include <asm/gcc_intrin.h> |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #define ia64_get_psr_i() (ia64_getreg(_IA64_REG_PSR) & IA64_PSR_I) | 21 | #define ia64_native_get_psr_i() (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I) |
22 | 22 | ||
23 | #define ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4) \ | 23 | #define ia64_native_set_rr0_to_rr4(val0, val1, val2, val3, val4) \ |
24 | do { \ | 24 | do { \ |
25 | ia64_set_rr(0x0000000000000000UL, (val0)); \ | 25 | ia64_native_set_rr(0x0000000000000000UL, (val0)); \ |
26 | ia64_set_rr(0x2000000000000000UL, (val1)); \ | 26 | ia64_native_set_rr(0x2000000000000000UL, (val1)); \ |
27 | ia64_set_rr(0x4000000000000000UL, (val2)); \ | 27 | ia64_native_set_rr(0x4000000000000000UL, (val2)); \ |
28 | ia64_set_rr(0x6000000000000000UL, (val3)); \ | 28 | ia64_native_set_rr(0x6000000000000000UL, (val3)); \ |
29 | ia64_set_rr(0x8000000000000000UL, (val4)); \ | 29 | ia64_native_set_rr(0x8000000000000000UL, (val4)); \ |
30 | } while (0) | 30 | } while (0) |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -194,4 +194,48 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void); | |||
194 | #endif /* !CONFIG_IA64_DEBUG_CMPXCHG */ | 194 | #endif /* !CONFIG_IA64_DEBUG_CMPXCHG */ |
195 | 195 | ||
196 | #endif | 196 | #endif |
197 | |||
198 | #ifdef __KERNEL__ | ||
199 | #include <asm/paravirt_privop.h> | ||
200 | #endif | ||
201 | |||
202 | #ifndef __ASSEMBLY__ | ||
203 | #if defined(CONFIG_PARAVIRT) && defined(__KERNEL__) | ||
204 | #define IA64_INTRINSIC_API(name) pv_cpu_ops.name | ||
205 | #define IA64_INTRINSIC_MACRO(name) paravirt_ ## name | ||
206 | #else | ||
207 | #define IA64_INTRINSIC_API(name) ia64_native_ ## name | ||
208 | #define IA64_INTRINSIC_MACRO(name) ia64_native_ ## name | ||
209 | #endif | ||
210 | |||
211 | /************************************************/ | ||
212 | /* Instructions paravirtualized for correctness */ | ||
213 | /************************************************/ | ||
214 | /* fc, thash, get_cpuid, get_pmd, get_eflags, set_eflags */ | ||
215 | /* Note that "ttag" and "cover" are also privilege-sensitive; "ttag" | ||
216 | * is not currently used (though it may be in a long-format VHPT system!) | ||
217 | */ | ||
218 | #define ia64_fc IA64_INTRINSIC_API(fc) | ||
219 | #define ia64_thash IA64_INTRINSIC_API(thash) | ||
220 | #define ia64_get_cpuid IA64_INTRINSIC_API(get_cpuid) | ||
221 | #define ia64_get_pmd IA64_INTRINSIC_API(get_pmd) | ||
222 | |||
223 | |||
224 | /************************************************/ | ||
225 | /* Instructions paravirtualized for performance */ | ||
226 | /************************************************/ | ||
227 | #define ia64_ssm IA64_INTRINSIC_MACRO(ssm) | ||
228 | #define ia64_rsm IA64_INTRINSIC_MACRO(rsm) | ||
229 | #define ia64_getreg IA64_INTRINSIC_API(getreg) | ||
230 | #define ia64_setreg IA64_INTRINSIC_API(setreg) | ||
231 | #define ia64_set_rr IA64_INTRINSIC_API(set_rr) | ||
232 | #define ia64_get_rr IA64_INTRINSIC_API(get_rr) | ||
233 | #define ia64_ptcga IA64_INTRINSIC_API(ptcga) | ||
234 | #define ia64_get_psr_i IA64_INTRINSIC_API(get_psr_i) | ||
235 | #define ia64_intrin_local_irq_restore \ | ||
236 | IA64_INTRINSIC_API(intrin_local_irq_restore) | ||
237 | #define ia64_set_rr0_to_rr4 IA64_INTRINSIC_API(set_rr0_to_rr4) | ||
238 | |||
239 | #endif /* !__ASSEMBLY__ */ | ||
240 | |||
197 | #endif /* _ASM_IA64_INTRINSICS_H */ | 241 | #endif /* _ASM_IA64_INTRINSICS_H */ |