summaryrefslogtreecommitdiffstats
path: root/arch/mn10300/include/asm/frame.inc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-10-27 17:29:01 +0100
committerDavid Howells <dhowells@redhat.com>2010-10-27 17:29:01 +0100
commit7c7fcf762e405eb040ee10d22d656a791f616122 (patch)
tree2ec4f320fe2d348ffbdab6aebc9a36bcbf13da34 /arch/mn10300/include/asm/frame.inc
parenta5e03ca2fd57a5823b759981bff8d19b46ddad4d (diff)
MN10300: Save frame pointer in thread_info struct rather than global var
Save the current exception frame pointer in the thread_info struct rather than in a global variable as the latter makes SMP tricky, especially when preemption is also enabled. This also replaces __frame with current_frame() and rearranges header file inclusions to make it all compile. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Diffstat (limited to 'arch/mn10300/include/asm/frame.inc')
-rw-r--r--arch/mn10300/include/asm/frame.inc56
1 files changed, 13 insertions, 43 deletions
diff --git a/arch/mn10300/include/asm/frame.inc b/arch/mn10300/include/asm/frame.inc
index 406060e5e1c..2ee58e3eb6b 100644
--- a/arch/mn10300/include/asm/frame.inc
+++ b/arch/mn10300/include/asm/frame.inc
@@ -18,9 +18,7 @@
#ifndef __ASM_OFFSETS_H__
#include <asm/asm-offsets.h>
#endif
-#ifdef CONFIG_SMP
-#include <proc/smp-regs.h>
-#endif
+#include <asm/thread_info.h>
#define pi break
@@ -40,27 +38,15 @@
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
+ # push the exception frame onto the front of the list
+ GET_THREAD_INFO a1
+ mov (TI_frame,a1),a0
+ mov a0,(REG_NEXT,fp)
+ mov fp,(TI_frame,a1)
+
+ # disable the FPU inside the kernel
+ and ~EPSW_FE,epsw
# we may be holding current in E2
#ifdef CONFIG_MN10300_CURRENT_IN_E2
@@ -76,27 +62,11 @@
.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
+ GET_THREAD_INFO a0
+ mov (TI_frame,a0),fp
mov fp,sp
- mov (REG_NEXT,fp),d0 # userspace has regs->next == 0
- mov d0,(__frame)
-#endif /* CONFIG_SMP */
+ mov (REG_NEXT,fp),d0
+ mov d0,(TI_frame,a0) # userspace has regs->next == 0
#ifndef CONFIG_MN10300_USING_JTAG
mov (REG_EPSW,fp),d0