Skip to content

Commit e36f561

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-irqflags
* git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-irqflags: Fix IRQ flag handling naming MIPS: Add missing #inclusions of <linux/irq.h> smc91x: Add missing #inclusion of <linux/irq.h> Drop a couple of unnecessary asm/system.h inclusions SH: Add missing consts to sys_execve() declaration Blackfin: Rename IRQ flags handling functions Blackfin: Add missing dep to asm/irqflags.h Blackfin: Rename DES PC2() symbol to avoid collision Blackfin: Split the BF532 BFIN_*_FIO_FLAG() functions to their own header Blackfin: Split PLL code from mach-specific cdef headers
2 parents 70ada77 + df9ee29 commit e36f561

File tree

141 files changed

+2335
-1847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2335
-1847
lines changed

arch/alpha/include/asm/irqflags.h

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#ifndef __ALPHA_IRQFLAGS_H
2+
#define __ALPHA_IRQFLAGS_H
3+
4+
#include <asm/system.h>
5+
6+
#define IPL_MIN 0
7+
#define IPL_SW0 1
8+
#define IPL_SW1 2
9+
#define IPL_DEV0 3
10+
#define IPL_DEV1 4
11+
#define IPL_TIMER 5
12+
#define IPL_PERF 6
13+
#define IPL_POWERFAIL 6
14+
#define IPL_MCHECK 7
15+
#define IPL_MAX 7
16+
17+
#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
18+
#undef IPL_MIN
19+
#define IPL_MIN __min_ipl
20+
extern int __min_ipl;
21+
#endif
22+
23+
#define getipl() (rdps() & 7)
24+
#define setipl(ipl) ((void) swpipl(ipl))
25+
26+
static inline unsigned long arch_local_save_flags(void)
27+
{
28+
return rdps();
29+
}
30+
31+
static inline void arch_local_irq_disable(void)
32+
{
33+
setipl(IPL_MAX);
34+
barrier();
35+
}
36+
37+
static inline unsigned long arch_local_irq_save(void)
38+
{
39+
unsigned long flags = swpipl(IPL_MAX);
40+
barrier();
41+
return flags;
42+
}
43+
44+
static inline void arch_local_irq_enable(void)
45+
{
46+
barrier();
47+
setipl(IPL_MIN);
48+
}
49+
50+
static inline void arch_local_irq_restore(unsigned long flags)
51+
{
52+
barrier();
53+
setipl(flags);
54+
barrier();
55+
}
56+
57+
static inline bool arch_irqs_disabled_flags(unsigned long flags)
58+
{
59+
return flags == IPL_MAX;
60+
}
61+
62+
static inline bool arch_irqs_disabled(void)
63+
{
64+
return arch_irqs_disabled_flags(getipl());
65+
}
66+
67+
#endif /* __ALPHA_IRQFLAGS_H */

arch/alpha/include/asm/system.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -259,34 +259,6 @@ __CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long);
259259
__CALL_PAL_W1(wrusp, unsigned long);
260260
__CALL_PAL_W1(wrvptptr, unsigned long);
261261

262-
#define IPL_MIN 0
263-
#define IPL_SW0 1
264-
#define IPL_SW1 2
265-
#define IPL_DEV0 3
266-
#define IPL_DEV1 4
267-
#define IPL_TIMER 5
268-
#define IPL_PERF 6
269-
#define IPL_POWERFAIL 6
270-
#define IPL_MCHECK 7
271-
#define IPL_MAX 7
272-
273-
#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
274-
#undef IPL_MIN
275-
#define IPL_MIN __min_ipl
276-
extern int __min_ipl;
277-
#endif
278-
279-
#define getipl() (rdps() & 7)
280-
#define setipl(ipl) ((void) swpipl(ipl))
281-
282-
#define local_irq_disable() do { setipl(IPL_MAX); barrier(); } while(0)
283-
#define local_irq_enable() do { barrier(); setipl(IPL_MIN); } while(0)
284-
#define local_save_flags(flags) ((flags) = rdps())
285-
#define local_irq_save(flags) do { (flags) = swpipl(IPL_MAX); barrier(); } while(0)
286-
#define local_irq_restore(flags) do { barrier(); setipl(flags); barrier(); } while(0)
287-
288-
#define irqs_disabled() (getipl() == IPL_MAX)
289-
290262
/*
291263
* TB routines..
292264
*/

arch/arm/include/asm/irqflags.h

Lines changed: 84 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,66 +10,85 @@
1010
*/
1111
#if __LINUX_ARM_ARCH__ >= 6
1212

13-
#define raw_local_irq_save(x) \
14-
({ \
15-
__asm__ __volatile__( \
16-
"mrs %0, cpsr @ local_irq_save\n" \
17-
"cpsid i" \
18-
: "=r" (x) : : "memory", "cc"); \
19-
})
13+
static inline unsigned long arch_local_irq_save(void)
14+
{
15+
unsigned long flags;
16+
17+
asm volatile(
18+
" mrs %0, cpsr @ arch_local_irq_save\n"
19+
" cpsid i"
20+
: "=r" (flags) : : "memory", "cc");
21+
return flags;
22+
}
23+
24+
static inline void arch_local_irq_enable(void)
25+
{
26+
asm volatile(
27+
" cpsie i @ arch_local_irq_enable"
28+
:
29+
:
30+
: "memory", "cc");
31+
}
32+
33+
static inline void arch_local_irq_disable(void)
34+
{
35+
asm volatile(
36+
" cpsid i @ arch_local_irq_disable"
37+
:
38+
:
39+
: "memory", "cc");
40+
}
2041

21-
#define raw_local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc")
22-
#define raw_local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc")
2342
#define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
2443
#define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
25-
2644
#else
2745

2846
/*
2947
* Save the current interrupt enable state & disable IRQs
3048
*/
31-
#define raw_local_irq_save(x) \
32-
({ \
33-
unsigned long temp; \
34-
(void) (&temp == &x); \
35-
__asm__ __volatile__( \
36-
"mrs %0, cpsr @ local_irq_save\n" \
37-
" orr %1, %0, #128\n" \
38-
" msr cpsr_c, %1" \
39-
: "=r" (x), "=r" (temp) \
40-
: \
41-
: "memory", "cc"); \
42-
})
43-
49+
static inline unsigned long arch_local_irq_save(void)
50+
{
51+
unsigned long flags, temp;
52+
53+
asm volatile(
54+
" mrs %0, cpsr @ arch_local_irq_save\n"
55+
" orr %1, %0, #128\n"
56+
" msr cpsr_c, %1"
57+
: "=r" (flags), "=r" (temp)
58+
:
59+
: "memory", "cc");
60+
return flags;
61+
}
62+
4463
/*
4564
* Enable IRQs
4665
*/
47-
#define raw_local_irq_enable() \
48-
({ \
49-
unsigned long temp; \
50-
__asm__ __volatile__( \
51-
"mrs %0, cpsr @ local_irq_enable\n" \
52-
" bic %0, %0, #128\n" \
53-
" msr cpsr_c, %0" \
54-
: "=r" (temp) \
55-
: \
56-
: "memory", "cc"); \
57-
})
66+
static inline void arch_local_irq_enable(void)
67+
{
68+
unsigned long temp;
69+
asm volatile(
70+
" mrs %0, cpsr @ arch_local_irq_enable\n"
71+
" bic %0, %0, #128\n"
72+
" msr cpsr_c, %0"
73+
: "=r" (temp)
74+
:
75+
: "memory", "cc");
76+
}
5877

5978
/*
6079
* Disable IRQs
6180
*/
62-
#define raw_local_irq_disable() \
63-
({ \
64-
unsigned long temp; \
65-
__asm__ __volatile__( \
66-
"mrs %0, cpsr @ local_irq_disable\n" \
67-
" orr %0, %0, #128\n" \
68-
" msr cpsr_c, %0" \
69-
: "=r" (temp) \
70-
: \
71-
: "memory", "cc"); \
72-
})
81+
static inline void arch_local_irq_disable(void)
82+
{
83+
unsigned long temp;
84+
asm volatile(
85+
" mrs %0, cpsr @ arch_local_irq_disable\n"
86+
" orr %0, %0, #128\n"
87+
" msr cpsr_c, %0"
88+
: "=r" (temp)
89+
:
90+
: "memory", "cc");
91+
}
7392

7493
/*
7594
* Enable FIQs
@@ -106,27 +125,31 @@
106125
/*
107126
* Save the current interrupt enable state.
108127
*/
109-
#define raw_local_save_flags(x) \
110-
({ \
111-
__asm__ __volatile__( \
112-
"mrs %0, cpsr @ local_save_flags" \
113-
: "=r" (x) : : "memory", "cc"); \
114-
})
128+
static inline unsigned long arch_local_save_flags(void)
129+
{
130+
unsigned long flags;
131+
asm volatile(
132+
" mrs %0, cpsr @ local_save_flags"
133+
: "=r" (flags) : : "memory", "cc");
134+
return flags;
135+
}
115136

116137
/*
117138
* restore saved IRQ & FIQ state
118139
*/
119-
#define raw_local_irq_restore(x) \
120-
__asm__ __volatile__( \
121-
"msr cpsr_c, %0 @ local_irq_restore\n" \
122-
: \
123-
: "r" (x) \
124-
: "memory", "cc")
140+
static inline void arch_local_irq_restore(unsigned long flags)
141+
{
142+
asm volatile(
143+
" msr cpsr_c, %0 @ local_irq_restore"
144+
:
145+
: "r" (flags)
146+
: "memory", "cc");
147+
}
125148

126-
#define raw_irqs_disabled_flags(flags) \
127-
({ \
128-
(int)((flags) & PSR_I_BIT); \
129-
})
149+
static inline int arch_irqs_disabled_flags(unsigned long flags)
150+
{
151+
return flags & PSR_I_BIT;
152+
}
130153

131154
#endif
132155
#endif

arch/avr32/include/asm/irqflags.h

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,54 @@
88
#ifndef __ASM_AVR32_IRQFLAGS_H
99
#define __ASM_AVR32_IRQFLAGS_H
1010

11+
#include <linux/types.h>
1112
#include <asm/sysreg.h>
1213

13-
static inline unsigned long __raw_local_save_flags(void)
14+
static inline unsigned long arch_local_save_flags(void)
1415
{
1516
return sysreg_read(SR);
1617
}
1718

18-
#define raw_local_save_flags(x) \
19-
do { (x) = __raw_local_save_flags(); } while (0)
20-
2119
/*
2220
* This will restore ALL status register flags, not only the interrupt
2321
* mask flag.
2422
*
2523
* The empty asm statement informs the compiler of this fact while
2624
* also serving as a barrier.
2725
*/
28-
static inline void raw_local_irq_restore(unsigned long flags)
26+
static inline void arch_local_irq_restore(unsigned long flags)
2927
{
3028
sysreg_write(SR, flags);
3129
asm volatile("" : : : "memory", "cc");
3230
}
3331

34-
static inline void raw_local_irq_disable(void)
32+
static inline void arch_local_irq_disable(void)
3533
{
3634
asm volatile("ssrf %0" : : "n"(SYSREG_GM_OFFSET) : "memory");
3735
}
3836

39-
static inline void raw_local_irq_enable(void)
37+
static inline void arch_local_irq_enable(void)
4038
{
4139
asm volatile("csrf %0" : : "n"(SYSREG_GM_OFFSET) : "memory");
4240
}
4341

44-
static inline int raw_irqs_disabled_flags(unsigned long flags)
42+
static inline bool arch_irqs_disabled_flags(unsigned long flags)
4543
{
4644
return (flags & SYSREG_BIT(GM)) != 0;
4745
}
4846

49-
static inline int raw_irqs_disabled(void)
47+
static inline bool arch_irqs_disabled(void)
5048
{
51-
unsigned long flags = __raw_local_save_flags();
52-
53-
return raw_irqs_disabled_flags(flags);
49+
return arch_irqs_disabled_flags(arch_local_save_flags());
5450
}
5551

56-
static inline unsigned long __raw_local_irq_save(void)
52+
static inline unsigned long arch_local_irq_save(void)
5753
{
58-
unsigned long flags = __raw_local_save_flags();
54+
unsigned long flags = arch_local_save_flags();
5955

60-
raw_local_irq_disable();
56+
arch_local_irq_disable();
6157

6258
return flags;
6359
}
6460

65-
#define raw_local_irq_save(flags) \
66-
do { (flags) = __raw_local_irq_save(); } while (0)
67-
6861
#endif /* __ASM_AVR32_IRQFLAGS_H */

arch/blackfin/include/asm/ipipe.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
#define prepare_arch_switch(next) \
5050
do { \
5151
ipipe_schedule_notify(current, next); \
52-
local_irq_disable_hw(); \
52+
hard_local_irq_disable(); \
5353
} while (0)
5454

5555
#define task_hijacked(p) \
5656
({ \
5757
int __x__ = __ipipe_root_domain_p; \
5858
__clear_bit(IPIPE_SYNC_FLAG, &ipipe_root_cpudom_var(status)); \
5959
if (__x__) \
60-
local_irq_enable_hw(); \
60+
hard_local_irq_enable(); \
6161
!__x__; \
6262
})
6363

@@ -167,7 +167,7 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul)
167167
#define __ipipe_run_isr(ipd, irq) \
168168
do { \
169169
if (!__ipipe_pipeline_head_p(ipd)) \
170-
local_irq_enable_hw(); \
170+
hard_local_irq_enable(); \
171171
if (ipd == ipipe_root_domain) { \
172172
if (unlikely(ipipe_virtual_irq_p(irq))) { \
173173
irq_enter(); \
@@ -183,7 +183,7 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul)
183183
__ipipe_run_irqtail(); \
184184
__set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
185185
} \
186-
local_irq_disable_hw(); \
186+
hard_local_irq_disable(); \
187187
} while (0)
188188

189189
#define __ipipe_syscall_watched_p(p, sc) \

0 commit comments

Comments
 (0)