]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/mn10300/include/asm/frame.inc
MN10300: And Panasonic AM34 subarch and implement SMP
[mirror_ubuntu-artful-kernel.git] / arch / mn10300 / include / asm / frame.inc
index 5b1949bdf039a85854594e728dfe100e009b7ee3..406060e5e1c02364e4f0f10e619cb1f3f70c2891 100644 (file)
@@ -18,6 +18,9 @@
 #ifndef __ASM_OFFSETS_H__
 #include <asm/asm-offsets.h>
 #endif
+#ifdef CONFIG_SMP
+#include <proc/smp-regs.h>
+#endif
 
 #define pi break
 
        movm    [d2,d3,a2,a3,exreg0,exreg1,exother],(sp)
        mov     sp,fp                           # FRAME pointer in A3
        add     -12,sp                          # allow for calls to be made
+#ifdef CONFIG_SMP
+#ifdef CONFIG_PREEMPT /* FIXME */
+       mov     epsw,d2
+       and     ~EPSW_IE,epsw
+#endif
+       mov     (CPUID),a0
+       add     a0,a0
+       add     a0,a0
+       mov     (___frame,a0),a1
+       mov     a1,(REG_NEXT,fp)
+       mov     fp,(___frame,a0)
+#ifdef CONFIG_PREEMPT /* FIXME */
+       mov     d2,epsw
+#endif
+#else  /* CONFIG_SMP */
        mov     (__frame),a1
        mov     a1,(REG_NEXT,fp)
        mov     fp,(__frame)
+#endif /* CONFIG_SMP */
 
        and     ~EPSW_FE,epsw                   # disable the FPU inside the kernel
 
 .macro RESTORE_ALL
        # peel back the stack to the calling frame
        # - this permits execve() to discard extra frames due to kernel syscalls
+#ifdef  CONFIG_SMP
+#ifdef CONFIG_PREEMPT /* FIXME */
+       mov     epsw,d2
+       and     ~EPSW_IE,epsw
+#endif
+       mov     (CPUID),a0
+       add     a0,a0
+       add     a0,a0
+       mov     (___frame,a0),fp
+       mov     fp,sp
+       mov     (REG_NEXT,fp),d0                # userspace has regs->next == 0
+       mov     d0,(___frame,a0)
+#ifdef CONFIG_PREEMPT /* FIXME */
+       mov     d2,epsw
+#endif
+#else   /* CONFIG_SMP */
        mov     (__frame),fp
        mov     fp,sp
        mov     (REG_NEXT,fp),d0                # userspace has regs->next == 0
        mov     d0,(__frame)
+#endif  /* CONFIG_SMP */
 
 #ifndef CONFIG_MN10300_USING_JTAG
        mov     (REG_EPSW,fp),d0