4 #include <linux/config.h>
11 * Stack layout in 'ret_from_exception':
13 * This allows access to the syscall arguments in registers d1-d5
25 * 28(sp) - stack adjustment
28 * 32(sp) - format & vector
32 * 97/05/14 Andreas: Register %a2 is now set to the current task throughout
40 /* the following macro is used when enabling interrupts */
41 #if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
42 /* block out HSYNC on the atari */
43 #define ALLOWINT 0xfbff
44 #define MAX_NOINT_IPL 3
46 /* portable version */
47 #define ALLOWINT 0xf8ff
48 #define MAX_NOINT_IPL 0
49 #endif /* machine compilation types */
51 LFLUSH_I_AND_D
= 0x00000808
54 /* process bits for task_struct.flags */
62 #define SAVE_ALL_INT save_all_int
63 #define SAVE_ALL_SYS save_all_sys
64 #define RESTORE_ALL restore_all
66 * This defines the normal kernel pt-regs layout.
68 * regs a3-a6 and d6-d7 are preserved by C code
69 * the kernel doesn't mess with usp unless it needs to
73 * a -1 in the orig_d0 field signifies
74 * that the stack frame is NOT for syscall
80 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
85 movel
%d0
,%sp@
- | orig d0
87 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
90 /* Need to save the "missing" registers for kgdb...
96 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
97 moveml
%d6
-%d7
,kgdb_registers
+GDBOFFA_D6
98 moveml
%a3
-%a6
,kgdb_registers
+GDBOFFA_A3
103 movel
%d0
,%sp@
- | orig d0
105 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
106 moveml
%d6
-%d7
,kgdb_registers
+GDBOFFA_D6
107 moveml
%a3
-%a6
,kgdb_registers
+GDBOFFA_A3
112 moveml
%sp@
+,%a0
-%a1
/%curptr
/%d1
-%d5
114 addql
#4,%sp | orig d0
115 addl
%sp@
+,%sp
| stk adj
119 #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
121 #define SAVE_SWITCH_STACK save_switch_stack
122 #define RESTORE_SWITCH_STACK restore_switch_stack
123 #define GET_CURRENT(tmp) get_current tmp
125 .macro save_switch_stack
126 moveml
%a3
-%a6
/%d6
-%d7
,%sp@
-
129 .macro restore_switch_stack
130 moveml
%sp@
+,%a3
-%a6
/%d6
-%d7
133 .macro get_current reg
=%d0
141 #define STR(X) STR1(X)
144 #define PT_OFF_ORIG_D0 0x24
145 #define PT_OFF_FORMATVEC 0x32
146 #define PT_OFF_SR 0x2C
148 #define SAVE_ALL_INT \
149 "clrl %%sp@-;" /* stk_adj */ \
150 "pea -1:w;" /* orig d0 = -1 */ \
151 "movel %%d0,%%sp@-;" /* d0 */ \
152 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
154 #define SAVE_ALL_INT \
155 "clrl %%sp@-\n\t" /* stk_adj */ \
156 "pea -1:w\n\t" /* orig d0 = -1 */ \
157 "movel %%d0,%%sp@-\n\t" /* d0 */ \
158 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-\n\t" \
159 "moveml %%d6-%%d7,kgdb_registers+"STR(GDBOFFA_D6)"\n\t" \
160 "moveml %%a3-%%a6,kgdb_registers+"STR(GDBOFFA_A3)
162 #define GET_CURRENT(tmp) \
163 "movel %%sp,"#tmp"\n\t" \
164 "andw #-8192,"#tmp"\n\t" \
169 #endif /* __M68K_ENTRY_H */