108
108
#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
110
#define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */
113
111
* The group barrier in front of the rsm & ssm are necessary to ensure
114
112
* that none of the previous instructions in the same group are
115
113
* affected by the rsm/ssm.
117
/* For spinlocks etc */
120
* - clearing psr.i is implicitly serialized (visible by next insn)
121
* - setting psr.i requires data serialization
122
* - we need a stop-bit before reading PSR because we sometimes
123
* write a floating-point register right before reading the PSR
124
* and that writes to PSR.mfl
126
#ifdef CONFIG_PARAVIRT
127
#define __local_save_flags() ia64_get_psr_i()
129
#define __local_save_flags() ia64_getreg(_IA64_REG_PSR)
132
#define __local_irq_save(x) \
135
(x) = __local_save_flags(); \
137
ia64_rsm(IA64_PSR_I); \
140
#define __local_irq_disable() \
143
ia64_rsm(IA64_PSR_I); \
146
#define __local_irq_restore(x) ia64_intrin_local_irq_restore((x) & IA64_PSR_I)
148
#ifdef CONFIG_IA64_DEBUG_IRQ
150
extern unsigned long last_cli_ip;
152
# define __save_ip() last_cli_ip = ia64_getreg(_IA64_REG_IP)
154
# define local_irq_save(x) \
156
unsigned long __psr; \
158
__local_irq_save(__psr); \
159
if (__psr & IA64_PSR_I) \
164
# define local_irq_disable() do { unsigned long __x; local_irq_save(__x); } while (0)
166
# define local_irq_restore(x) \
168
unsigned long __old_psr, __psr = (x); \
170
local_save_flags(__old_psr); \
171
__local_irq_restore(__psr); \
172
if ((__old_psr & IA64_PSR_I) && !(__psr & IA64_PSR_I)) \
176
#else /* !CONFIG_IA64_DEBUG_IRQ */
177
# define local_irq_save(x) __local_irq_save(x)
178
# define local_irq_disable() __local_irq_disable()
179
# define local_irq_restore(x) __local_irq_restore(x)
180
#endif /* !CONFIG_IA64_DEBUG_IRQ */
182
#define local_irq_enable() ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
183
#define local_save_flags(flags) ({ ia64_stop(); (flags) = __local_save_flags(); })
185
#define irqs_disabled() \
187
unsigned long __ia64_id_flags; \
188
local_save_flags(__ia64_id_flags); \
189
(__ia64_id_flags & IA64_PSR_I) == 0; \
192
116
#ifdef __KERNEL__
194
#ifdef CONFIG_IA32_SUPPORT
195
# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0)
197
# define IS_IA32_PROCESS(regs) 0
199
static inline void ia32_save_state(struct task_struct *t __attribute__((unused))){}
200
static inline void ia32_load_state(struct task_struct *t __attribute__((unused))){}
204
119
* Context switch from one thread to another. If the two threads have
205
120
* different address spaces, schedule() has already taken care of