diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-11-18 04:48:22 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-11-18 04:48:22 -0500 |
commit | b60705765a635728187e5cea5f36914886675013 (patch) | |
tree | 400a8fd966f117140511bf4606f96084c208c14f /arch/blackfin/include/asm/system.h | |
parent | b1271d31a59e73a70284c2cdcbe2b0589f6479c7 (diff) |
Blackfin arch: move out irq related functions
move irq related functions into asm/irq.h and out of the mondo asm/system.h
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/include/asm/system.h')
-rw-r--r-- | arch/blackfin/include/asm/system.h | 92 |
1 files changed, 2 insertions, 90 deletions
diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h index 6b368faf30c3..e8bcfa4ee5c0 100644 --- a/arch/blackfin/include/asm/system.h +++ b/arch/blackfin/include/asm/system.h | |||
@@ -39,95 +39,7 @@ | |||
39 | #include <mach/anomaly.h> | 39 | #include <mach/anomaly.h> |
40 | #include <asm/pda.h> | 40 | #include <asm/pda.h> |
41 | #include <asm/processor.h> | 41 | #include <asm/processor.h> |
42 | 42 | #include <asm/irq.h> | |
43 | /* Forward decl needed due to cdef inter dependencies */ | ||
44 | static inline uint32_t __pure bfin_dspid(void); | ||
45 | #define blackfin_core_id() (bfin_dspid() & 0xff) | ||
46 | |||
47 | /* | ||
48 | * Interrupt configuring macros. | ||
49 | */ | ||
50 | #define local_irq_disable() \ | ||
51 | do { \ | ||
52 | int __tmp_dummy; \ | ||
53 | __asm__ __volatile__( \ | ||
54 | "cli %0;" \ | ||
55 | : "=d" (__tmp_dummy) \ | ||
56 | ); \ | ||
57 | } while (0) | ||
58 | |||
59 | #if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE) | ||
60 | # define NOP_PAD_ANOMALY_05000244 "nop; nop;" | ||
61 | #else | ||
62 | # define NOP_PAD_ANOMALY_05000244 | ||
63 | #endif | ||
64 | |||
65 | #ifdef CONFIG_SMP | ||
66 | # define irq_flags cpu_pda[blackfin_core_id()].imask | ||
67 | #else | ||
68 | extern unsigned long irq_flags; | ||
69 | #endif | ||
70 | |||
71 | #define local_irq_enable() \ | ||
72 | __asm__ __volatile__( \ | ||
73 | "sti %0;" \ | ||
74 | : \ | ||
75 | : "d" (irq_flags) \ | ||
76 | ) | ||
77 | #define idle_with_irq_disabled() \ | ||
78 | __asm__ __volatile__( \ | ||
79 | NOP_PAD_ANOMALY_05000244 \ | ||
80 | ".align 8;" \ | ||
81 | "sti %0;" \ | ||
82 | "idle;" \ | ||
83 | : \ | ||
84 | : "d" (irq_flags) \ | ||
85 | ) | ||
86 | |||
87 | #ifdef CONFIG_DEBUG_HWERR | ||
88 | # define __save_and_cli(x) \ | ||
89 | __asm__ __volatile__( \ | ||
90 | "cli %0;" \ | ||
91 | "sti %1;" \ | ||
92 | : "=&d" (x) \ | ||
93 | : "d" (0x3F) \ | ||
94 | ) | ||
95 | #else | ||
96 | # define __save_and_cli(x) \ | ||
97 | __asm__ __volatile__( \ | ||
98 | "cli %0;" \ | ||
99 | : "=&d" (x) \ | ||
100 | ) | ||
101 | #endif | ||
102 | |||
103 | #define local_save_flags(x) \ | ||
104 | __asm__ __volatile__( \ | ||
105 | "cli %0;" \ | ||
106 | "sti %0;" \ | ||
107 | : "=d" (x) \ | ||
108 | ) | ||
109 | |||
110 | #ifdef CONFIG_DEBUG_HWERR | ||
111 | #define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0) | ||
112 | #else | ||
113 | #define irqs_enabled_from_flags(x) ((x) != 0x1f) | ||
114 | #endif | ||
115 | |||
116 | #define local_irq_restore(x) \ | ||
117 | do { \ | ||
118 | if (irqs_enabled_from_flags(x)) \ | ||
119 | local_irq_enable(); \ | ||
120 | } while (0) | ||
121 | |||
122 | /* For spinlocks etc */ | ||
123 | #define local_irq_save(x) __save_and_cli(x) | ||
124 | |||
125 | #define irqs_disabled() \ | ||
126 | ({ \ | ||
127 | unsigned long flags; \ | ||
128 | local_save_flags(flags); \ | ||
129 | !irqs_enabled_from_flags(flags); \ | ||
130 | }) | ||
131 | 43 | ||
132 | /* | 44 | /* |
133 | * Force strict CPU ordering. | 45 | * Force strict CPU ordering. |
@@ -279,7 +191,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | |||
279 | * ptr isn't the current task, in which case it does nothing. | 191 | * ptr isn't the current task, in which case it does nothing. |
280 | */ | 192 | */ |
281 | 193 | ||
282 | #include <asm/blackfin.h> | 194 | #include <asm/l1layout.h> |
283 | 195 | ||
284 | asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next); | 196 | asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next); |
285 | 197 | ||