aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/include/asm
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-18 04:42:18 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-11 09:30:38 -0500
commitbf90e1eab682dcb79b7765989fb65835ce9d6165 (patch)
treecb1bb4364862d878e1d361d371f8392d08f606d7 /arch/arc/include/asm
parent4adeefe161a74369e44cc8e663f240ece0470dc3 (diff)
ARC: Process-creation/scheduling/idle-loop
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/arc/include/asm')
-rw-r--r--arch/arc/include/asm/arcregs.h20
-rw-r--r--arch/arc/include/asm/processor.h9
-rw-r--r--arch/arc/include/asm/ptrace.h8
-rw-r--r--arch/arc/include/asm/switch_to.h41
4 files changed, 72 insertions, 6 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 3fccb04e6d93..d76411882481 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -47,6 +47,17 @@
47#define AUX_ITRIGGER 0x40d 47#define AUX_ITRIGGER 0x40d
48#define AUX_IPULSE 0x415 48#define AUX_IPULSE 0x415
49 49
50/*
51 * Floating Pt Registers
52 * Status regs are read-only (build-time) so need not be saved/restored
53 */
54#define ARC_AUX_FP_STAT 0x300
55#define ARC_AUX_DPFP_1L 0x301
56#define ARC_AUX_DPFP_1H 0x302
57#define ARC_AUX_DPFP_2L 0x303
58#define ARC_AUX_DPFP_2H 0x304
59#define ARC_AUX_DPFP_STAT 0x305
60
50#ifndef __ASSEMBLY__ 61#ifndef __ASSEMBLY__
51 62
52/* 63/*
@@ -110,6 +121,15 @@
110 121
111#endif 122#endif
112 123
124#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
125/* These DPFP regs need to be saved/restored across ctx-sw */
126struct arc_fpu {
127 struct {
128 unsigned int l, h;
129 } aux_dpfp[2];
130};
131#endif
132
113#endif /* __ASEMBLY__ */ 133#endif /* __ASEMBLY__ */
114 134
115#endif /* __KERNEL__ */ 135#endif /* __KERNEL__ */
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h
index bf88cfbc9128..860252ec3fa7 100644
--- a/arch/arc/include/asm/processor.h
+++ b/arch/arc/include/asm/processor.h
@@ -29,6 +29,9 @@ struct thread_struct {
29 unsigned long callee_reg; /* pointer to callee regs */ 29 unsigned long callee_reg; /* pointer to callee regs */
30 unsigned long fault_address; /* dbls as brkpt holder as well */ 30 unsigned long fault_address; /* dbls as brkpt holder as well */
31 unsigned long cause_code; /* Exception Cause Code (ECR) */ 31 unsigned long cause_code; /* Exception Cause Code (ECR) */
32#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
33 struct arc_fpu fpu;
34#endif
32}; 35};
33 36
34#define INIT_THREAD { \ 37#define INIT_THREAD { \
@@ -54,12 +57,6 @@ unsigned long thread_saved_pc(struct task_struct *t);
54 57
55#define cpu_relax() do { } while (0) 58#define cpu_relax() do { } while (0)
56 59
57/*
58 * Create a new kernel thread
59 */
60
61extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);
62
63#define copy_segments(tsk, mm) do { } while (0) 60#define copy_segments(tsk, mm) do { } while (0)
64#define release_segments(mm) do { } while (0) 61#define release_segments(mm) do { } while (0)
65 62
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h
index 4c9359477ded..3afadefe335f 100644
--- a/arch/arc/include/asm/ptrace.h
+++ b/arch/arc/include/asm/ptrace.h
@@ -91,6 +91,14 @@ struct callee_regs {
91#define in_syscall(regs) (((regs->orig_r8) >= 0 && \ 91#define in_syscall(regs) (((regs->orig_r8) >= 0 && \
92 (regs->orig_r8 <= NR_syscalls)) ? 1 : 0) 92 (regs->orig_r8 <= NR_syscalls)) ? 1 : 0)
93 93
94#define current_pt_regs() \
95({ \
96 /* open-coded current_thread_info() */ \
97 register unsigned long sp asm ("sp"); \
98 unsigned long pg_start = (sp & ~(THREAD_SIZE - 1)); \
99 (struct pt_regs *)(pg_start + THREAD_SIZE - 4) - 1; \
100})
101
94#endif /* !__ASSEMBLY__ */ 102#endif /* !__ASSEMBLY__ */
95 103
96#endif /* __KERNEL__ */ 104#endif /* __KERNEL__ */
diff --git a/arch/arc/include/asm/switch_to.h b/arch/arc/include/asm/switch_to.h
new file mode 100644
index 000000000000..1b171ab5fec0
--- /dev/null
+++ b/arch/arc/include/asm/switch_to.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ASM_ARC_SWITCH_TO_H
10#define _ASM_ARC_SWITCH_TO_H
11
12#ifndef __ASSEMBLY__
13
14#include <linux/sched.h>
15
16#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
17
18extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
19#define ARC_FPU_PREV(p, n) fpu_save_restore(p, n)
20#define ARC_FPU_NEXT(t)
21
22#else
23
24#define ARC_FPU_PREV(p, n)
25#define ARC_FPU_NEXT(n)
26
27#endif /* !CONFIG_ARC_FPU_SAVE_RESTORE */
28
29struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);
30
31#define switch_to(prev, next, last) \
32do { \
33 ARC_FPU_PREV(prev, next); \
34 last = __switch_to(prev, next);\
35 ARC_FPU_NEXT(next); \
36 mb(); \
37} while (0)
38
39#endif
40
41#endif