blob: b30a2968e2741ab75356672581129945128e6525 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001#ifndef __BFIN_ENTRY_H
2#define __BFIN_ENTRY_H
3
4#include <asm/setup.h>
5#include <asm/page.h>
6
7#ifdef __ASSEMBLY__
8
9#define LFLUSH_I_AND_D 0x00000808
10#define LSIGTRAP 5
11
12/* process bits for task_struct.flags */
13#define PF_TRACESYS_OFF 3
14#define PF_TRACESYS_BIT 5
15#define PF_PTRACED_OFF 3
16#define PF_PTRACED_BIT 4
17#define PF_DTRACE_OFF 1
18#define PF_DTRACE_BIT 5
19
Bernd Schmidt0893f122008-05-07 11:41:26 +080020/*
21 * NOTE! The single-stepping code assumes that all interrupt handlers
22 * start by saving SYSCFG on the stack with their first instruction.
23 */
24
Bryan Wu1394f032007-05-06 14:50:22 -070025/* This one is used for exceptions, emulation, and NMI. It doesn't push
26 RETI and doesn't do cli. */
27#define SAVE_ALL_SYS save_context_no_interrupts
28/* This is used for all normal interrupts. It saves a minimum of registers
29 to the stack, loads the IRQ number, and jumps to common code. */
Yi Li6a01f232009-01-07 23:14:39 +080030#ifdef CONFIG_IPIPE
31# define LOAD_IPIPE_IPEND \
32 P0.l = lo(IPEND); \
33 P0.h = hi(IPEND); \
34 R1 = [P0];
35#else
36# define LOAD_IPIPE_IPEND
37#endif
Bryan Wu1394f032007-05-06 14:50:22 -070038#define INTERRUPT_ENTRY(N) \
39 [--sp] = SYSCFG; \
40 \
41 [--sp] = P0; /*orig_p0*/ \
42 [--sp] = R0; /*orig_r0*/ \
43 [--sp] = (R7:0,P5:0); \
44 R0 = (N); \
Yi Li6a01f232009-01-07 23:14:39 +080045 LOAD_IPIPE_IPEND \
Bryan Wu1394f032007-05-06 14:50:22 -070046 jump __common_int_entry;
47
48/* For timer interrupts, we need to save IPEND, since the user_mode
49 macro accesses it to determine where to account time. */
50#define TIMER_INTERRUPT_ENTRY(N) \
51 [--sp] = SYSCFG; \
52 \
53 [--sp] = P0; /*orig_p0*/ \
54 [--sp] = R0; /*orig_r0*/ \
55 [--sp] = (R7:0,P5:0); \
56 p0.l = lo(IPEND); \
57 p0.h = hi(IPEND); \
58 r1 = [p0]; \
59 R0 = (N); \
60 jump __common_int_entry;
61
62/* This one pushes RETI without using CLI. Interrupts are enabled. */
63#define SAVE_CONTEXT_SYSCALL save_context_syscall
64#define SAVE_CONTEXT save_context_with_interrupts
Bernd Schmidtdbdf20d2009-01-07 23:14:38 +080065#define SAVE_CONTEXT_CPLB save_context_cplb
Bryan Wu1394f032007-05-06 14:50:22 -070066
67#define RESTORE_ALL_SYS restore_context_no_interrupts
68#define RESTORE_CONTEXT restore_context_with_interrupts
Bernd Schmidtdbdf20d2009-01-07 23:14:38 +080069#define RESTORE_CONTEXT_CPLB restore_context_cplb
Bryan Wu1394f032007-05-06 14:50:22 -070070
71#endif /* __ASSEMBLY__ */
72#endif /* __BFIN_ENTRY_H */