diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-11-18 12:48:22 +0300 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-11-18 12:48:22 +0300 |
commit | b60705765a635728187e5cea5f36914886675013 (patch) | |
tree | 400a8fd966f117140511bf4606f96084c208c14f | |
parent | b1271d31a59e73a70284c2cdcbe2b0589f6479c7 (diff) | |
download | linux-b60705765a635728187e5cea5f36914886675013.tar.xz |
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>
-rw-r--r-- | arch/blackfin/include/asm/irq.h | 92 | ||||
-rw-r--r-- | arch/blackfin/include/asm/pda.h | 2 | ||||
-rw-r--r-- | arch/blackfin/include/asm/system.h | 92 | ||||
-rw-r--r-- | arch/blackfin/kernel/vmlinux.lds.S | 1 | ||||
-rw-r--r-- | arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/include/mach/cdefBF532.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/include/mach/cdefBF534.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf538/include/mach/cdefBF538.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/include/mach/cdefBF561.h | 2 |
11 files changed, 101 insertions, 100 deletions
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h index 9377816fa18a..e43c20583fcd 100644 --- a/arch/blackfin/include/asm/irq.h +++ b/arch/blackfin/include/asm/irq.h @@ -19,11 +19,101 @@ /* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/ #include <mach/irq.h> -#include <asm/ptrace.h> +#include <asm/pda.h> +#include <asm/processor.h> static __inline__ int irq_canonicalize(int irq) { return irq; } +/* + * Interrupt configuring macros. + */ +#define local_irq_disable() \ + do { \ + int __tmp_dummy; \ + __asm__ __volatile__( \ + "cli %0;" \ + : "=d" (__tmp_dummy) \ + ); \ + } while (0) + +#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE) +# define NOP_PAD_ANOMALY_05000244 "nop; nop;" +#else +# define NOP_PAD_ANOMALY_05000244 +#endif + +#ifdef CONFIG_SMP +/* Forward decl needed due to cdef inter dependencies */ +static inline uint32_t __pure bfin_dspid(void); +# define blackfin_core_id() (bfin_dspid() & 0xff) +# define irq_flags cpu_pda[blackfin_core_id()].imask +#else +extern unsigned long irq_flags; +#endif + +#define local_irq_enable() \ + __asm__ __volatile__( \ + "sti %0;" \ + : \ + : "d" (irq_flags) \ + ) + +#define idle_with_irq_disabled() \ + __asm__ __volatile__( \ + NOP_PAD_ANOMALY_05000244 \ + ".align 8;" \ + "sti %0;" \ + "idle;" \ + : \ + : "d" (irq_flags) \ + ) + +#ifdef CONFIG_DEBUG_HWERR +# define __save_and_cli(x) \ + __asm__ __volatile__( \ + "cli %0;" \ + "sti %1;" \ + : "=&d" (x) \ + : "d" (0x3F) \ + ) +#else +# define __save_and_cli(x) \ + __asm__ __volatile__( \ + "cli %0;" \ + : "=&d" (x) \ + ) +#endif + +#define local_save_flags(x) \ + __asm__ __volatile__( \ + "cli %0;" \ + "sti %0;" \ + : "=d" (x) \ + ) + +#ifdef CONFIG_DEBUG_HWERR +#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0) +#else +#define irqs_enabled_from_flags(x) ((x) != 0x1f) +#endif + +#define local_irq_restore(x) \ + do { \ + if (irqs_enabled_from_flags(x)) \ + local_irq_enable(); \ + } while (0) + +/* For spinlocks etc */ +#define local_irq_save(x) __save_and_cli(x) + +#define irqs_disabled() \ +({ \ + unsigned long flags; \ + local_save_flags(flags); \ + !irqs_enabled_from_flags(flags); \ +}) + #endif /* _BFIN_IRQ_H_ */ diff --git a/arch/blackfin/include/asm/pda.h b/arch/blackfin/include/asm/pda.h index a24d130c30f0..bd8d4a7efeb2 100644 --- a/arch/blackfin/include/asm/pda.h +++ b/arch/blackfin/include/asm/pda.h @@ -23,7 +23,7 @@ #ifndef _ASM_BLACKFIN_PDA_H #define _ASM_BLACKFIN_PDA_H -#include <asm/mem_map.h> +#include <mach/anomaly.h> #ifndef __ASSEMBLY__ 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 @@ #include <mach/anomaly.h> #include <asm/pda.h> #include <asm/processor.h> - -/* Forward decl needed due to cdef inter dependencies */ -static inline uint32_t __pure bfin_dspid(void); -#define blackfin_core_id() (bfin_dspid() & 0xff) - -/* - * Interrupt configuring macros. - */ -#define local_irq_disable() \ - do { \ - int __tmp_dummy; \ - __asm__ __volatile__( \ - "cli %0;" \ - : "=d" (__tmp_dummy) \ - ); \ - } while (0) - -#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE) -# define NOP_PAD_ANOMALY_05000244 "nop; nop;" -#else -# define NOP_PAD_ANOMALY_05000244 -#endif - -#ifdef CONFIG_SMP -# define irq_flags cpu_pda[blackfin_core_id()].imask -#else -extern unsigned long irq_flags; -#endif - -#define local_irq_enable() \ - __asm__ __volatile__( \ - "sti %0;" \ - : \ - : "d" (irq_flags) \ - ) -#define idle_with_irq_disabled() \ - __asm__ __volatile__( \ - NOP_PAD_ANOMALY_05000244 \ - ".align 8;" \ - "sti %0;" \ - "idle;" \ - : \ - : "d" (irq_flags) \ - ) - -#ifdef CONFIG_DEBUG_HWERR -# define __save_and_cli(x) \ - __asm__ __volatile__( \ - "cli %0;" \ - "sti %1;" \ - : "=&d" (x) \ - : "d" (0x3F) \ - ) -#else -# define __save_and_cli(x) \ - __asm__ __volatile__( \ - "cli %0;" \ - : "=&d" (x) \ - ) -#endif - -#define local_save_flags(x) \ - __asm__ __volatile__( \ - "cli %0;" \ - "sti %0;" \ - : "=d" (x) \ - ) - -#ifdef CONFIG_DEBUG_HWERR -#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0) -#else -#define irqs_enabled_from_flags(x) ((x) != 0x1f) -#endif - -#define local_irq_restore(x) \ - do { \ - if (irqs_enabled_from_flags(x)) \ - local_irq_enable(); \ - } while (0) - -/* For spinlocks etc */ -#define local_irq_save(x) __save_and_cli(x) - -#define irqs_disabled() \ -({ \ - unsigned long flags; \ - local_save_flags(flags); \ - !irqs_enabled_from_flags(flags); \ -}) +#include <asm/irq.h> /* * Force strict CPU ordering. @@ -279,7 +191,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, * ptr isn't the current task, in which case it does nothing. */ -#include <asm/blackfin.h> +#include <asm/l1layout.h> asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next); diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 2a485352ec14..3a1f73794aa8 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -109,7 +109,6 @@ SECTIONS #endif DATA_DATA - *(.data) CONSTRUCTORS /* make sure the init_task is aligned to the diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h b/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h index 45a7ff88d863..9fbcd2221986 100644 --- a/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h +++ b/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h @@ -1153,7 +1153,7 @@ #define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val) /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> /* Writing to PLL_CTL initiates a PLL relock sequence. */ static __inline__ void bfin_write_PLL_CTL(unsigned int val) diff --git a/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h b/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h index 008603f332a6..8a374c358edf 100644 --- a/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h +++ b/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h @@ -1153,7 +1153,7 @@ #define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val) /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> /* Writing to PLL_CTL initiates a PLL relock sequence. */ static __inline__ void bfin_write_PLL_CTL(unsigned int val) diff --git a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h index b148d2b7e479..d7b08f638ea4 100644 --- a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h +++ b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h @@ -677,7 +677,7 @@ #define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val) /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> #if ANOMALY_05000311 #define BFIN_WRITE_FIO_FLAG(name) \ diff --git a/arch/blackfin/mach-bf537/include/mach/cdefBF534.h b/arch/blackfin/mach-bf537/include/mach/cdefBF534.h index 76135607e35b..f3416923be69 100644 --- a/arch/blackfin/mach-bf537/include/mach/cdefBF534.h +++ b/arch/blackfin/mach-bf537/include/mach/cdefBF534.h @@ -1773,7 +1773,7 @@ #define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val) /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> /* Writing to PLL_CTL initiates a PLL relock sequence. */ static __inline__ void bfin_write_PLL_CTL(unsigned int val) diff --git a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h index 1d768a65d139..7e469b8d939c 100644 --- a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h +++ b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h @@ -2053,7 +2053,7 @@ #define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1, val) /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> /* Writing to PLL_CTL initiates a PLL relock sequence. */ static __inline__ void bfin_write_PLL_CTL(unsigned int val) diff --git a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h index c376fb7acda0..0a3b210daadf 100644 --- a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h +++ b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h @@ -2692,7 +2692,7 @@ #define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> /* Writing to PLL_CTL initiates a PLL relock sequence. */ static __inline__ void bfin_write_PLL_CTL(unsigned int val) diff --git a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h index eb349ca88cc4..b16875d735b3 100644 --- a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h +++ b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h @@ -1527,7 +1527,7 @@ #define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val) /* These need to be last due to the cdef/linux inter-dependencies */ -#include <asm/system.h> +#include <asm/irq.h> /* Writing to PLL_CTL initiates a PLL relock sequence. */ static __inline__ void bfin_write_PLL_CTL(unsigned int val) |