#ifdef CONFIG_COLDFIRE
#include <asm/coldfire.h>
+#include <asm/mcfmmu.h>
#endif
/*
clrl %sp@- | stk_adj
pea -1:w | orig d0
movel %d0,%sp@- | d0
+#ifdef CONFIG_COLDFIRE
+ subal #(8*4), %sp
+ moveml %d1-%d5/%a0-%a1/%curptr,%sp@
+#else
moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
+#endif
.endm
.macro save_all_sys
clrl %sp@- | stk_adj
movel %d0,%sp@- | orig d0
movel %d0,%sp@- | d0
+#ifdef CONFIG_COLDFIRE
+ subal #(8*4), %sp
+ moveml %d1-%d5/%a0-%a1/%curptr,%sp@
+#else
moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
+#endif
.endm
.macro restore_all
+#ifdef CONFIG_COLDFIRE
+ moveml %sp@,%a0-%a1/%curptr/%d1-%d5
+ addal #(8*4), %sp
+#else
moveml %sp@+,%a0-%a1/%curptr/%d1-%d5
+#endif
movel %sp@+,%d0
addql #4,%sp | orig d0
addl %sp@+,%sp | stk adj
#define RESTORE_SWITCH_STACK restore_switch_stack
#define GET_CURRENT(tmp) get_current tmp
+#ifdef CONFIG_COLDFIRE
+
+.macro save_switch_stack
+ subal #(6*4), %sp
+ moveml %a3-%a6/%d6-%d7,%sp@
+.endm
+
+.macro restore_switch_stack
+ moveml %sp@,%a3-%a6/%d6-%d7
+ addal #(6*4), %sp
+.endm
+
+.macro get_current reg=%d0
+ movel %sp,\reg
+ andl #-THREAD_SIZE,\reg
+ movel \reg,%curptr
+ movel %curptr@,%curptr
+.endm
+
+#else
+
.macro save_switch_stack
moveml %a3-%a6/%d6-%d7,%sp@-
.endm
movel %curptr@,%curptr
.endm
+#endif
+
+
+
#else /* C source */
#define STR(X) STR1(X)
#define STR1(X) #X
+#ifdef CONFIG_COLDFIRE
+
+#define SAVE_ALL_INT \
+ "clrl %%sp@-;" /* stk_adj */ \
+ "pea -1:w;" /* orig d0 = -1 */ \
+ "movel %%d0,%%sp@-;" /* d0 */ \
+ "subal #(8*4),%sp" \
+ "moveml %%d1-%%d5/%%a0-%%a2,%%sp@"
+#define GET_CURRENT(tmp) \
+ "movel %%sp,"#tmp"\n\t" \
+ "andl #-"STR(THREAD_SIZE)","#tmp"\n\t" \
+ "movel "#tmp",%%a2\n\t"
+
+#else
+
#define SAVE_ALL_INT \
"clrl %%sp@-;" /* stk_adj */ \
"pea -1:w;" /* orig d0 = -1 */ \
#endif
+#endif
+
#endif /* __M68K_ENTRY_H */