]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARC: make start_thread() out-of-line
authorVineet Gupta <vgupta@synopsys.com>
Fri, 18 Apr 2014 06:49:59 +0000 (12:19 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 5 May 2014 08:52:12 +0000 (14:22 +0530)
Helps move out ISA specific bits from a arch exported header

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/processor.h
arch/arc/kernel/process.c

index 15334ab66b56e110ac67152bac96317c3f8368ff..d99f9b37cd1540a14004e56a46d0e7be0584891b 100644 (file)
@@ -18,7 +18,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <asm/arcregs.h>       /* for STATUS_E1_MASK et all */
 #include <asm/ptrace.h>
 
 /* Arch specific stuff which needs to be saved per task.
@@ -41,15 +40,13 @@ struct thread_struct {
 /* Forward declaration, a strange C thing */
 struct task_struct;
 
-/*
- * Return saved PC of a blocked thread.
- */
+/* Return saved PC of a blocked thread  */
 unsigned long thread_saved_pc(struct task_struct *t);
 
 #define task_pt_regs(p) \
        ((struct pt_regs *)(THREAD_SIZE + (void *)task_stack_page(p)) - 1)
 
-/* Free all resources held by a thread. */
+/* Free all resources held by a thread */
 #define release_thread(thread) do { } while (0)
 
 /* Prepare to copy thread state - unlazy all lazy status */
@@ -82,26 +79,8 @@ unsigned long thread_saved_pc(struct task_struct *t);
 #define KSTK_BLINK(tsk) KSTK_REG(tsk, 4)
 #define KSTK_FP(tsk)    KSTK_REG(tsk, 0)
 
-/*
- * Do necessary setup to start up a newly executed thread.
- *
- * E1,E2 so that Interrupts are enabled in user mode
- * L set, so Loop inhibited to begin with
- * lp_start and lp_end seeded with bogus non-zero values so to easily catch
- * the ARC700 sr to lp_start hardware bug
- */
-#define start_thread(_regs, _pc, _usp)                         \
-do {                                                           \
-       set_fs(USER_DS); /* reads from user space */            \
-       (_regs)->ret = (_pc);                                   \
-       /* Interrupts enabled in User Mode */                   \
-       (_regs)->status32 = STATUS_U_MASK | STATUS_L_MASK       \
-               | STATUS_E1_MASK | STATUS_E2_MASK;              \
-       (_regs)->sp = (_usp);                                   \
-       /* bogus seed values for debugging */                   \
-       (_regs)->lp_start = 0x10;                               \
-       (_regs)->lp_end = 0x80;                                 \
-} while (0)
+extern void start_thread(struct pt_regs * regs, unsigned long pc,
+                        unsigned long usp);
 
 extern unsigned int get_wchan(struct task_struct *p);
 
index 07a3a968fe49a113e94c2a894895db09362108ac..fdd89715d2d3783f8a1302513c10a15d138ded91 100644 (file)
@@ -150,6 +150,29 @@ int copy_thread(unsigned long clone_flags,
        return 0;
 }
 
+/*
+ * Do necessary setup to start up a new user task
+ */
+void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
+{
+       set_fs(USER_DS); /* user space */
+
+       regs->sp = usp;
+       regs->ret = pc;
+
+       /*
+        * [U]ser Mode bit set
+        * [L] ZOL loop inhibited to begin with - cleared by a LP insn
+        * Interrupts enabled
+        */
+       regs->status32 = STATUS_U_MASK | STATUS_L_MASK |
+                        STATUS_E1_MASK | STATUS_E2_MASK;
+
+       /* bogus seed values for debugging */
+       regs->lp_start = 0x10;
+       regs->lp_end = 0x80;
+}
+
 /*
  * Some archs flush debug and FPU info here
  */