7 #include <asm/thread_info.h>
10 #ifdef CONFIG_COLDFIRE
11 #include <asm/coldfire.h>
12 #include <asm/mcfmmu.h>
16 * Stack layout in 'ret_from_exception':
18 * This allows access to the syscall arguments in registers d1-d5
30 * 28(sp) - stack adjustment
33 * 32(sp) - format & vector
34 * 36(sp) - MMUSR (Coldfire only)
35 * 3A(sp) - MMUAR (Coldfire only)
39 * 97/05/14 Andreas: Register %a2 is now set to the current task throughout
43 /* the following macro is used when enabling interrupts */
44 #if defined(MACH_ATARI_ONLY)
45 /* block out HSYNC on the atari */
46 #define ALLOWINT (~0x400)
47 #define MAX_NOINT_IPL 3
49 /* portable version */
50 #define ALLOWINT (~0x700)
51 #define MAX_NOINT_IPL 0
52 #endif /* machine compilation types */
58 LFLUSH_I_AND_D = 0x00000808
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
75 #ifdef CONFIG_COLDFIRE
82 #ifdef CONFIG_COLDFIRE
84 moveml %d1-%d5/%a0-%a1/%curptr,%sp@
86 moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
91 #ifdef CONFIG_COLDFIRE
96 movel %d0,%sp@- | orig d0
98 #ifdef CONFIG_COLDFIRE
100 moveml %d1-%d5/%a0-%a1/%curptr,%sp@
102 moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
107 #ifdef CONFIG_COLDFIRE
108 moveml %sp@,%a0-%a1/%curptr/%d1-%d5
111 moveml %sp@+,%a0-%a1/%curptr/%d1-%d5
114 addql #4,%sp | orig d0
115 addl %sp@+,%sp | stk adj
116 #ifdef CONFIG_COLDFIRE
117 addql #8,%sp | MMUAR & MMUSR
122 #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
124 #define SAVE_SWITCH_STACK save_switch_stack
125 #define RESTORE_SWITCH_STACK restore_switch_stack
126 #define GET_CURRENT(tmp) get_current tmp
128 #ifdef CONFIG_COLDFIRE
130 .macro save_switch_stack
132 moveml %a3-%a6/%d6-%d7,%sp@
135 .macro restore_switch_stack
136 moveml %sp@,%a3-%a6/%d6-%d7
140 .macro get_current reg=%d0
142 andl #-THREAD_SIZE,\reg
144 movel %curptr@,%curptr
149 .macro save_switch_stack
150 moveml %a3-%a6/%d6-%d7,%sp@-
153 .macro restore_switch_stack
154 moveml %sp@+,%a3-%a6/%d6-%d7
157 .macro get_current reg=%d0
159 andw #-THREAD_SIZE,\reg
161 movel %curptr@,%curptr
170 #define STR(X) STR1(X)
173 #ifdef CONFIG_COLDFIRE
175 #define SAVE_ALL_INT \
176 "clrl %%sp@-;" /* stk_adj */ \
177 "pea -1:w;" /* orig d0 = -1 */ \
178 "movel %%d0,%%sp@-;" /* d0 */ \
180 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@"
181 #define GET_CURRENT(tmp) \
182 "movel %%sp,"#tmp"\n\t" \
183 "andl #-"STR(THREAD_SIZE)","#tmp"\n\t" \
184 "movel "#tmp",%%a2\n\t"
188 #define SAVE_ALL_INT \
189 "clrl %%sp@-;" /* stk_adj */ \
190 "pea -1:w;" /* orig d0 = -1 */ \
191 "movel %%d0,%%sp@-;" /* d0 */ \
192 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
193 #define GET_CURRENT(tmp) \
194 "movel %%sp,"#tmp"\n\t" \
195 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
196 "movel "#tmp",%%a2\n\t" \
203 #endif /* __M68K_ENTRY_H */