4 #include <linux/config.h>
9 * Stack layout in 'ret_from_exception':
11 * This allows access to the syscall arguments in registers d1-d5
23 * 28(sp) - stack adjustment
26 * 32(sp) - format & vector
30 * 97/05/14 Andreas: Register %a2 is now set to the current task throughout
34 /* the following macro is used when enabling interrupts */
35 #if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
36 /* block out HSYNC on the atari */
37 #define ALLOWINT (~0x400)
38 #define MAX_NOINT_IPL 3
40 /* portable version */
41 #define ALLOWINT (~0x700)
42 #define MAX_NOINT_IPL 0
43 #endif /* machine compilation types */
49 LFLUSH_I_AND_D
= 0x00000808
52 /* process bits for task_struct.ptrace */
60 #define SAVE_ALL_INT save_all_int
61 #define SAVE_ALL_SYS save_all_sys
62 #define RESTORE_ALL restore_all
64 * This defines the normal kernel pt-regs layout.
66 * regs a3-a6 and d6-d7 are preserved by C code
67 * the kernel doesn't mess with usp unless it needs to
71 * a -1 in the orig_d0 field signifies
72 * that the stack frame is NOT for syscall
78 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
83 movel
%d0
,%sp@
- | orig d0
85 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
89 moveml
%sp@
+,%a0
-%a1
/%curptr
/%d1
-%d5
91 addql
#4,%sp | orig d0
92 addl
%sp@
+,%sp
| stk adj
96 #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
98 #define SAVE_SWITCH_STACK save_switch_stack
99 #define RESTORE_SWITCH_STACK restore_switch_stack
100 #define GET_CURRENT(tmp) get_current tmp
102 .macro save_switch_stack
103 moveml
%a3
-%a6
/%d6
-%d7
,%sp@
-
106 .macro restore_switch_stack
107 moveml
%sp@
+,%a3
-%a6
/%d6
-%d7
110 .macro get_current reg
=%d0
112 andw
#-THREAD_SIZE,\reg
114 movel
%curptr@
,%curptr
119 #define STR(X) STR1(X)
122 #define PT_OFF_ORIG_D0 0x24
123 #define PT_OFF_FORMATVEC 0x32
124 #define PT_OFF_SR 0x2C
125 #define SAVE_ALL_INT \
126 "clrl %%sp@-;" /* stk_adj */ \
127 "pea -1:w;" /* orig d0 = -1 */ \
128 "movel %%d0,%%sp@-;" /* d0 */ \
129 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
130 #define GET_CURRENT(tmp) \
131 "movel %%sp,"#tmp"\n\t" \
132 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
133 "movel "#tmp",%%a2\n\t" \
138 #endif /* __M68K_ENTRY_H */