1 #ifndef __CF_M68K_ENTRY_H
2 #define __CF_M68K_ENTRY_H
6 #include <asm/coldfire.h>
8 #include <asm/asm-offsets.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
34 * 97/05/14 Andreas: Register %a2 is now set to the current task throughout
38 /* the following macro is used when enabling interrupts */
39 /* portable version */
40 #define ALLOWINT (~0x700)
41 #define MAX_NOINT_IPL 0
47 LFLUSH_I_AND_D = 0x00000808
50 /* process bits for task_struct.ptrace */
58 #define SAVE_ALL_INT save_all_int
59 #define SAVE_ALL_SYS save_all_sys
60 #define RESTORE_ALL restore_all
62 * This defines the normal kernel pt-regs layout.
64 * regs a3-a6 and d6-d7 are preserved by C code
65 * the kernel doesn't mess with usp unless it needs to
69 * a -1 in the orig_d0 field signifies
70 * that the stack frame is NOT for syscall
79 moveml %d1-%d5/%a0-%a1/%curptr,%sp@
86 movel %d0,%sp@- | orig d0
89 moveml %d1-%d5/%a0-%a1/%curptr,%sp@
93 moveml %sp@,%a0-%a1/%curptr/%d1-%d5
96 addql #4,%sp | orig d0
97 addl %sp@+,%sp | stk_adj
98 addql #8,%sp | MMUAR & MMUSR
102 #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
104 #define SAVE_SWITCH_STACK save_switch_stack
105 #define RESTORE_SWITCH_STACK restore_switch_stack
106 #define GET_CURRENT(tmp) get_current tmp
108 .macro save_switch_stack
110 moveml %a3-%a6/%d6-%d7,%sp@
113 .macro restore_switch_stack
114 moveml %sp@,%a3-%a6/%d6-%d7
118 .macro get_current reg=%d0
120 andl #-THREAD_SIZE,\reg
122 movel %curptr@,%curptr
127 #define STR(X) STR1(X)
130 #define PT_OFF_ORIG_D0 0x24
131 #define PT_OFF_FORMATVEC 0x32
132 #define PT_OFF_SR 0x2C
133 #define SAVE_ALL_INT \
134 "clrl %%sp@-;" /* stk_adj */ \
135 "pea -1:w;" /* orig d0 = -1 */ \
136 "movel %%d0,%%sp@-;" /* d0 */ \
138 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@"
139 #define GET_CURRENT(tmp) \
140 "movel %%sp,"#tmp"\n\t" \
141 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
142 "movel "#tmp",%%a2\n\t"
146 #endif /* __CF_M68K_ENTRY_H */