7 #include <asm/thread_info.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
36 /* the following macro is used when enabling interrupts */
37 #if defined(MACH_ATARI_ONLY)
38 /* block out HSYNC on the atari */
39 #define ALLOWINT (~0x400)
40 #define MAX_NOINT_IPL 3
42 /* portable version */
43 #define ALLOWINT (~0x700)
44 #define MAX_NOINT_IPL 0
45 #endif /* machine compilation types */
51 LFLUSH_I_AND_D
= 0x00000808
53 #define SAVE_ALL_INT save_all_int
54 #define SAVE_ALL_SYS save_all_sys
55 #define RESTORE_ALL restore_all
57 * This defines the normal kernel pt-regs layout.
59 * regs a3-a6 and d6-d7 are preserved by C code
60 * the kernel doesn't mess with usp unless it needs to
64 * a -1 in the orig_d0 field signifies
65 * that the stack frame is NOT for syscall
71 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
76 movel
%d0
,%sp@
- | orig d0
78 moveml
%d1
-%d5
/%a0
-%a1
/%curptr
,%sp@
-
82 moveml
%sp@
+,%a0
-%a1
/%curptr
/%d1
-%d5
84 addql
#4,%sp | orig d0
85 addl
%sp@
+,%sp
| stk adj
89 #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
91 #define SAVE_SWITCH_STACK save_switch_stack
92 #define RESTORE_SWITCH_STACK restore_switch_stack
93 #define GET_CURRENT(tmp) get_current tmp
95 .macro save_switch_stack
96 moveml
%a3
-%a6
/%d6
-%d7
,%sp@
-
99 .macro restore_switch_stack
100 moveml
%sp@
+,%a3
-%a6
/%d6
-%d7
103 .macro get_current reg
=%d0
105 andw
#-THREAD_SIZE,\reg
107 movel
%curptr@
,%curptr
112 #define STR(X) STR1(X)
115 #define SAVE_ALL_INT \
116 "clrl %%sp@-;" /* stk_adj */ \
117 "pea -1:w;" /* orig d0 = -1 */ \
118 "movel %%d0,%%sp@-;" /* d0 */ \
119 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
120 #define GET_CURRENT(tmp) \
121 "movel %%sp,"#tmp"\n\t" \
122 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
123 "movel "#tmp",%%a2\n\t" \
128 #endif /* __M68K_ENTRY_H */