diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2014-04-18 06:49:59 (GMT) |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2014-05-05 08:52:12 (GMT) |
commit | 2ab402dfd65d15a4b25a8756272ababe3ef76884 (patch) | |
tree | 7b8535d6b2998744c5a4136c29e3c73048d3f2e0 /arch/arc/kernel | |
parent | d75386363ee60eb51c933c7b5e536f3a502ad7d7 (diff) | |
download | linux-2ab402dfd65d15a4b25a8756272ababe3ef76884.tar.xz |
ARC: make start_thread() out-of-line
Helps move out ISA specific bits from a arch exported header
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel')
-rw-r--r-- | arch/arc/kernel/process.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c index 07a3a96..fdd8971 100644 --- a/arch/arc/kernel/process.c +++ b/arch/arc/kernel/process.c @@ -151,6 +151,29 @@ int copy_thread(unsigned long clone_flags, } /* + * 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 */ void flush_thread(void) |