2 * Copyright 2004-2009 Analog Devices Inc.
4 * Licensed under the GPL-2 or later.
10 #include <asm/setup.h>
15 #define LFLUSH_I_AND_D 0x00000808
18 /* process bits for task_struct.flags */
19 #define PF_TRACESYS_OFF 3
20 #define PF_TRACESYS_BIT 5
21 #define PF_PTRACED_OFF 3
22 #define PF_PTRACED_BIT 4
23 #define PF_DTRACE_OFF 1
24 #define PF_DTRACE_BIT 5
27 * NOTE! The single-stepping code assumes that all interrupt handlers
28 * start by saving SYSCFG on the stack with their first instruction.
31 /* This one is used for exceptions, emulation, and NMI. It doesn't push
32 RETI and doesn't do cli. */
33 #define SAVE_ALL_SYS save_context_no_interrupts
34 /* This is used for all normal interrupts. It saves a minimum of registers
35 to the stack, loads the IRQ number, and jumps to common code. */
37 # define LOAD_IPIPE_IPEND \
42 # define LOAD_IPIPE_IPEND
45 #if ANOMALY_05000283 || ANOMALY_05000315
46 # define ANOMALY_283_315_WORKAROUND(preg, dreg) \
48 preg.h = HI(CHIPID); \
49 preg.l = LO(CHIPID); \
54 # define ANOMALY_283_315_WORKAROUND(preg, dreg)
55 #endif /* ANOMALY_05000283 || ANOMALY_05000315 */
57 #ifndef CONFIG_EXACT_HWERR
58 /* As a debugging aid - we save IPEND when DEBUG_KERNEL is on,
59 * otherwise it is a waste of cycles.
61 # ifndef CONFIG_DEBUG_KERNEL
62 #define INTERRUPT_ENTRY(N) \
64 [--sp] = P0; /*orig_p0*/ \
65 [--sp] = R0; /*orig_r0*/ \
66 [--sp] = (R7:0,P5:0); \
69 jump __common_int_entry;
70 # else /* CONFIG_DEBUG_KERNEL */
71 #define INTERRUPT_ENTRY(N) \
73 [--sp] = P0; /*orig_p0*/ \
74 [--sp] = R0; /*orig_r0*/ \
75 [--sp] = (R7:0,P5:0); \
81 jump __common_int_entry;
82 # endif /* CONFIG_DEBUG_KERNEL */
84 /* For timer interrupts, we need to save IPEND, since the user_mode
85 *macro accesses it to determine where to account time.
87 #define TIMER_INTERRUPT_ENTRY(N) \
89 [--sp] = P0; /*orig_p0*/ \
90 [--sp] = R0; /*orig_r0*/ \
91 [--sp] = (R7:0,P5:0); \
96 jump __common_int_entry;
97 #else /* CONFIG_EXACT_HWERR is defined */
99 #define INTERRUPT_ENTRY(N) \
101 [--sp] = P0; /*orig_p0*/ \
102 [--sp] = R0; /*orig_r0*/ \
103 [--sp] = (R7:0,P5:0); \
105 ANOMALY_283_315_WORKAROUND(p0, r0) \
112 CC = BITTST(R0, EVT_IVHW_P); \
120 jump __common_int_entry; \
123 (R7:0, P5:0) = [SP++]; \
129 #define TIMER_INTERRUPT_ENTRY(N) \
131 [--sp] = P0; /*orig_p0*/ \
132 [--sp] = R0; /*orig_r0*/ \
133 [--sp] = (R7:0,P5:0); \
135 ANOMALY_283_315_WORKAROUND(p0, r0) \
142 CC = BITTST(R0, EVT_IVHW_P); \
149 jump __common_int_entry; \
152 (R7:0, P5:0) = [SP++]; \
157 #endif /* CONFIG_EXACT_HWERR */
159 /* This one pushes RETI without using CLI. Interrupts are enabled. */
160 #define SAVE_CONTEXT_SYSCALL save_context_syscall
161 #define SAVE_CONTEXT save_context_with_interrupts
162 #define SAVE_CONTEXT_CPLB save_context_cplb
164 #define RESTORE_ALL_SYS restore_context_no_interrupts
165 #define RESTORE_CONTEXT restore_context_with_interrupts
166 #define RESTORE_CONTEXT_CPLB restore_context_cplb
168 #endif /* __ASSEMBLY__ */
169 #endif /* __BFIN_ENTRY_H */