diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-05-19 09:13:31 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-05-27 17:39:07 -0400 |
commit | 72cb4256c7574e1c2c1350fa92eecd7cef9e4772 (patch) | |
tree | 56d2872fafa5965816d339f3cea9ff06e288c1d1 /include | |
parent | 0e1a77ccdbc4ca59ccaf84168a0c3c1df4fadfc0 (diff) |
[IA64] pvops: preparation: introduce ia64_get_psr_i() to make kernel paravirtualization friendly.
__local_irq_save() and local_save_flags() are used to mask interruptions.
They read all psr bits that requres whole bit emulation.
On the other hand, reading only psr.i, the single bit, can be virtualized
cheaply.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ia64/intrinsics.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/system.h | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/asm-ia64/intrinsics.h b/include/asm-ia64/intrinsics.h index 9b83f8f01678..a3b96892f83f 100644 --- a/include/asm-ia64/intrinsics.h +++ b/include/asm-ia64/intrinsics.h | |||
@@ -18,6 +18,8 @@ | |||
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) | ||
22 | |||
21 | #define ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4) \ | 23 | #define ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4) \ |
22 | do { \ | 24 | do { \ |
23 | ia64_set_rr(0x0000000000000000UL, (val0)); \ | 25 | ia64_set_rr(0x0000000000000000UL, (val0)); \ |
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 0db8c9812ceb..927a381c20ca 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -123,10 +123,16 @@ extern struct ia64_boot_param { | |||
123 | * write a floating-point register right before reading the PSR | 123 | * write a floating-point register right before reading the PSR |
124 | * and that writes to PSR.mfl | 124 | * and that writes to PSR.mfl |
125 | */ | 125 | */ |
126 | #ifdef CONFIG_PARAVIRT | ||
127 | #define __local_save_flags() ia64_get_psr_i() | ||
128 | #else | ||
129 | #define __local_save_flags() ia64_getreg(_IA64_REG_PSR) | ||
130 | #endif | ||
131 | |||
126 | #define __local_irq_save(x) \ | 132 | #define __local_irq_save(x) \ |
127 | do { \ | 133 | do { \ |
128 | ia64_stop(); \ | 134 | ia64_stop(); \ |
129 | (x) = ia64_getreg(_IA64_REG_PSR); \ | 135 | (x) = __local_save_flags(); \ |
130 | ia64_stop(); \ | 136 | ia64_stop(); \ |
131 | ia64_rsm(IA64_PSR_I); \ | 137 | ia64_rsm(IA64_PSR_I); \ |
132 | } while (0) | 138 | } while (0) |
@@ -174,7 +180,7 @@ do { \ | |||
174 | #endif /* !CONFIG_IA64_DEBUG_IRQ */ | 180 | #endif /* !CONFIG_IA64_DEBUG_IRQ */ |
175 | 181 | ||
176 | #define local_irq_enable() ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); }) | 182 | #define local_irq_enable() ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); }) |
177 | #define local_save_flags(flags) ({ ia64_stop(); (flags) = ia64_getreg(_IA64_REG_PSR); }) | 183 | #define local_save_flags(flags) ({ ia64_stop(); (flags) = __local_save_flags(); }) |
178 | 184 | ||
179 | #define irqs_disabled() \ | 185 | #define irqs_disabled() \ |
180 | ({ \ | 186 | ({ \ |