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 /* process bits for task_struct.ptrace */
61 #define SAVE_ALL_INT save_all_int
62 #define SAVE_ALL_SYS save_all_sys
63 #define RESTORE_ALL restore_all
65 * This defines the normal kernel pt-regs layout.
67 * regs a3-a6 and d6-d7 are preserved by C code
68 * the kernel doesn't mess with usp unless it needs to
72 * a -1 in the orig_d0 field signifies
73 * that the stack frame is NOT for syscall
79 moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
84 movel %d0,%sp@- | orig d0
86 moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
90 moveml %sp@+,%a0-%a1/%curptr/%d1-%d5
92 addql #4,%sp | orig d0
93 addl %sp@+,%sp | stk adj
97 #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
99 #define SAVE_SWITCH_STACK save_switch_stack
100 #define RESTORE_SWITCH_STACK restore_switch_stack
101 #define GET_CURRENT(tmp) get_current tmp
103 .macro save_switch_stack
104 moveml %a3-%a6/%d6-%d7,%sp@-
107 .macro restore_switch_stack
108 moveml %sp@+,%a3-%a6/%d6-%d7
111 .macro get_current reg=%d0
113 andw #-THREAD_SIZE,\reg
115 movel %curptr@,%curptr
120 #define STR(X) STR1(X)
123 #define SAVE_ALL_INT \
124 "clrl %%sp@-;" /* stk_adj */ \
125 "pea -1:w;" /* orig d0 = -1 */ \
126 "movel %%d0,%%sp@-;" /* d0 */ \
127 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
128 #define GET_CURRENT(tmp) \
129 "movel %%sp,"#tmp"\n\t" \
130 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
131 "movel "#tmp",%%a2\n\t" \
136 #endif /* __M68K_ENTRY_H */