~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/ia64/include/asm/system.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
 */
108
108
#define set_mb(var, value)      do { (var) = (value); mb(); } while (0)
109
109
 
110
 
#define safe_halt()         ia64_pal_halt_light()    /* PAL_HALT_LIGHT */
111
 
 
112
110
/*
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.
116
114
 */
117
 
/* For spinlocks etc */
118
 
 
119
 
/*
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
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
 
 
132
 
#define __local_irq_save(x)                     \
133
 
do {                                            \
134
 
        ia64_stop();                            \
135
 
        (x) = __local_save_flags();             \
136
 
        ia64_stop();                            \
137
 
        ia64_rsm(IA64_PSR_I);                   \
138
 
} while (0)
139
 
 
140
 
#define __local_irq_disable()                   \
141
 
do {                                            \
142
 
        ia64_stop();                            \
143
 
        ia64_rsm(IA64_PSR_I);                   \
144
 
} while (0)
145
 
 
146
 
#define __local_irq_restore(x)  ia64_intrin_local_irq_restore((x) & IA64_PSR_I)
147
 
 
148
 
#ifdef CONFIG_IA64_DEBUG_IRQ
149
 
 
150
 
  extern unsigned long last_cli_ip;
151
 
 
152
 
# define __save_ip()            last_cli_ip = ia64_getreg(_IA64_REG_IP)
153
 
 
154
 
# define local_irq_save(x)                                      \
155
 
do {                                                            \
156
 
        unsigned long __psr;                                    \
157
 
                                                                \
158
 
        __local_irq_save(__psr);                                \
159
 
        if (__psr & IA64_PSR_I)                                 \
160
 
                __save_ip();                                    \
161
 
        (x) = __psr;                                            \
162
 
} while (0)
163
 
 
164
 
# define local_irq_disable()    do { unsigned long __x; local_irq_save(__x); } while (0)
165
 
 
166
 
# define local_irq_restore(x)                                   \
167
 
do {                                                            \
168
 
        unsigned long __old_psr, __psr = (x);                   \
169
 
                                                                \
170
 
        local_save_flags(__old_psr);                            \
171
 
        __local_irq_restore(__psr);                             \
172
 
        if ((__old_psr & IA64_PSR_I) && !(__psr & IA64_PSR_I))  \
173
 
                __save_ip();                                    \
174
 
} while (0)
175
 
 
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 */
181
 
 
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(); })
184
 
 
185
 
#define irqs_disabled()                         \
186
 
({                                              \
187
 
        unsigned long __ia64_id_flags;          \
188
 
        local_save_flags(__ia64_id_flags);      \
189
 
        (__ia64_id_flags & IA64_PSR_I) == 0;    \
190
 
})
191
115
 
192
116
#ifdef __KERNEL__
193
117
 
194
 
#ifdef CONFIG_IA32_SUPPORT
195
 
# define IS_IA32_PROCESS(regs)  (ia64_psr(regs)->is != 0)
196
 
#else
197
 
# define IS_IA32_PROCESS(regs)          0
198
 
struct task_struct;
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))){}
201
 
#endif
202
 
 
203
118
/*
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
233
148
 
234
149
#define IA64_HAS_EXTRA_STATE(t)                                                 \
235
150
        ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)       \
236
 
         || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE())
 
151
         || PERFMON_IS_SYSWIDE())
237
152
 
238
153
#define __switch_to(prev,next,last) do {                                                         \
239
154
        IA64_ACCOUNT_ON_SWITCH(prev, next);                                                      \
281
196
 
282
197
void default_idle(void);
283
198
 
284
 
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
285
 
extern void account_system_vtime(struct task_struct *);
286
 
#endif
287
 
 
288
199
#endif /* __KERNEL__ */
289
200
 
290
201
#endif /* __ASSEMBLY__ */