]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blobdiff - arch/m68k/include/asm/entry_mm.h
Fixes (asm, entry, irq, linker, defconfig)
[mcf548x/linux.git] / arch / m68k / include / asm / entry_mm.h
index 2ffb1bea9283fdf010351a755a6cde7457d43aba..703301ee81dc8db69b83390ee866c489c7a83b46 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifdef CONFIG_COLDFIRE
 #include <asm/coldfire.h>
+#include <asm/mcfmmu.h>
 #endif
 
 /*
@@ -78,7 +79,12 @@ LFLUSH_I_AND_D = 0x00000808
        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
@@ -89,11 +95,21 @@ LFLUSH_I_AND_D = 0x00000808
        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
@@ -109,6 +125,27 @@ LFLUSH_I_AND_D = 0x00000808
 #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
@@ -124,11 +161,30 @@ LFLUSH_I_AND_D = 0x00000808
        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 */  \
@@ -142,4 +198,6 @@ LFLUSH_I_AND_D = 0x00000808
 
 #endif
 
+#endif
+
 #endif /* __M68K_ENTRY_H */