aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2017-06-28 09:30:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-06-28 19:13:57 -0400
commit6474924e2b5ddb0030c355558966adcbe3b49022 (patch)
treec217bdbd7999bd6a9d45e220a5f6efdd828f8df3
parente547204f1f4f314a7352f7b93332fdc1a2e4b24c (diff)
arch: remove unused macro/function thread_saved_pc()
The only user of thread_saved_pc() in non-arch-specific code was removed in commit 8243d5597793 ("sched/core: Remove pointless printout in sched_show_task()"). Remove the implementations as well. Some architectures use thread_saved_pc() in their arch-specific code. Leave their thread_saved_pc() intact. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arc/include/asm/processor.h2
-rw-r--r--arch/blackfin/include/asm/processor.h5
-rw-r--r--arch/c6x/include/asm/processor.h5
-rw-r--r--arch/cris/arch-v10/kernel/process.c8
-rw-r--r--arch/cris/arch-v32/kernel/process.c8
-rw-r--r--arch/cris/include/asm/processor.h2
-rw-r--r--arch/frv/include/asm/processor.h5
-rw-r--r--arch/frv/kernel/process.c9
-rw-r--r--arch/h8300/include/asm/processor.h4
-rw-r--r--arch/h8300/kernel/process.c5
-rw-r--r--arch/hexagon/include/asm/processor.h3
-rw-r--r--arch/hexagon/kernel/process.c8
-rw-r--r--arch/ia64/include/asm/processor.h17
-rw-r--r--arch/m32r/include/asm/processor.h2
-rw-r--r--arch/m32r/kernel/process.c8
-rw-r--r--arch/m68k/include/asm/processor.h2
-rw-r--r--arch/m68k/kernel/process.c14
-rw-r--r--arch/microblaze/include/asm/processor.h6
-rw-r--r--arch/microblaze/kernel/process.c17
-rw-r--r--arch/mn10300/include/asm/processor.h5
-rw-r--r--arch/mn10300/kernel/process.c8
-rw-r--r--arch/nios2/include/asm/processor.h3
-rw-r--r--arch/openrisc/include/asm/processor.h5
-rw-r--r--arch/openrisc/kernel/process.c5
-rw-r--r--arch/parisc/include/asm/processor.h5
-rw-r--r--arch/parisc/kernel/process.c5
-rw-r--r--arch/powerpc/include/asm/processor.h6
-rw-r--r--arch/s390/include/asm/processor.h5
-rw-r--r--arch/s390/kernel/process.c25
-rw-r--r--arch/score/include/asm/processor.h1
-rw-r--r--arch/score/kernel/process.c5
-rw-r--r--arch/sparc/include/asm/processor_32.h3
-rw-r--r--arch/sparc/include/asm/processor_64.h2
-rw-r--r--arch/sparc/kernel/process_32.c8
-rw-r--r--arch/sparc/kernel/process_64.c19
-rw-r--r--arch/tile/include/asm/processor.h7
-rw-r--r--arch/um/include/asm/processor-generic.h2
-rw-r--r--arch/um/kernel/um_arch.c6
-rw-r--r--arch/x86/include/asm/processor.h2
-rw-r--r--arch/x86/kernel/process.c11
-rw-r--r--arch/xtensa/include/asm/processor.h2
41 files changed, 0 insertions, 270 deletions
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h
index 6e1242da0159..4104a0839214 100644
--- a/arch/arc/include/asm/processor.h
+++ b/arch/arc/include/asm/processor.h
@@ -86,8 +86,6 @@ struct task_struct;
86#define TSK_K_BLINK(tsk) TSK_K_REG(tsk, 4) 86#define TSK_K_BLINK(tsk) TSK_K_REG(tsk, 4)
87#define TSK_K_FP(tsk) TSK_K_REG(tsk, 0) 87#define TSK_K_FP(tsk) TSK_K_REG(tsk, 0)
88 88
89#define thread_saved_pc(tsk) TSK_K_BLINK(tsk)
90
91extern void start_thread(struct pt_regs * regs, unsigned long pc, 89extern void start_thread(struct pt_regs * regs, unsigned long pc,
92 unsigned long usp); 90 unsigned long usp);
93 91
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index 85d4af97c986..dbdbb8a558df 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -75,11 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
75{ 75{
76} 76}
77 77
78/*
79 * Return saved PC of a blocked thread.
80 */
81#define thread_saved_pc(tsk) (tsk->thread.pc)
82
83unsigned long get_wchan(struct task_struct *p); 78unsigned long get_wchan(struct task_struct *p);
84 79
85#define KSTK_EIP(tsk) \ 80#define KSTK_EIP(tsk) \
diff --git a/arch/c6x/include/asm/processor.h b/arch/c6x/include/asm/processor.h
index b9eb3da7f278..7c87b5be53b5 100644
--- a/arch/c6x/include/asm/processor.h
+++ b/arch/c6x/include/asm/processor.h
@@ -96,11 +96,6 @@ static inline void release_thread(struct task_struct *dead_task)
96#define release_segments(mm) do { } while (0) 96#define release_segments(mm) do { } while (0)
97 97
98/* 98/*
99 * saved PC of a blocked thread.
100 */
101#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
102
103/*
104 * saved kernel SP and DP of a blocked thread. 99 * saved kernel SP and DP of a blocked thread.
105 */ 100 */
106#ifdef _BIG_ENDIAN 101#ifdef _BIG_ENDIAN
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index e299d30105b5..a2cdb1521aca 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -69,14 +69,6 @@ void hard_reset_now (void)
69 while(1) /* waiting for RETRIBUTION! */ ; 69 while(1) /* waiting for RETRIBUTION! */ ;
70} 70}
71 71
72/*
73 * Return saved PC of a blocked thread.
74 */
75unsigned long thread_saved_pc(struct task_struct *t)
76{
77 return task_pt_regs(t)->irp;
78}
79
80/* setup the child's kernel stack with a pt_regs and switch_stack on it. 72/* setup the child's kernel stack with a pt_regs and switch_stack on it.
81 * it will be un-nested during _resume and _ret_from_sys_call when the 73 * it will be un-nested during _resume and _ret_from_sys_call when the
82 * new thread is scheduled. 74 * new thread is scheduled.
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c
index c530a8fa87ce..fe87b383fbf3 100644
--- a/arch/cris/arch-v32/kernel/process.c
+++ b/arch/cris/arch-v32/kernel/process.c
@@ -85,14 +85,6 @@ hard_reset_now(void)
85} 85}
86 86
87/* 87/*
88 * Return saved PC of a blocked thread.
89 */
90unsigned long thread_saved_pc(struct task_struct *t)
91{
92 return task_pt_regs(t)->erp;
93}
94
95/*
96 * Setup the child's kernel stack with a pt_regs and call switch_stack() on it. 88 * Setup the child's kernel stack with a pt_regs and call switch_stack() on it.
97 * It will be unnested during _resume and _ret_from_sys_call when the new thread 89 * It will be unnested during _resume and _ret_from_sys_call when the new thread
98 * is scheduled. 90 * is scheduled.
diff --git a/arch/cris/include/asm/processor.h b/arch/cris/include/asm/processor.h
index 15b815df29c1..bc2729e4b2c9 100644
--- a/arch/cris/include/asm/processor.h
+++ b/arch/cris/include/asm/processor.h
@@ -52,8 +52,6 @@ unsigned long get_wchan(struct task_struct *p);
52 52
53#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 53#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
54 54
55extern unsigned long thread_saved_pc(struct task_struct *tsk);
56
57/* Free all resources held by a thread. */ 55/* Free all resources held by a thread. */
58static inline void release_thread(struct task_struct *dead_task) 56static inline void release_thread(struct task_struct *dead_task)
59{ 57{
diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h
index ddaeb9cc9143..e4d08d74ed9f 100644
--- a/arch/frv/include/asm/processor.h
+++ b/arch/frv/include/asm/processor.h
@@ -96,11 +96,6 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ...
96#define release_segments(mm) do { } while (0) 96#define release_segments(mm) do { } while (0)
97#define forget_segments() do { } while (0) 97#define forget_segments() do { } while (0)
98 98
99/*
100 * Return saved PC of a blocked thread.
101 */
102extern unsigned long thread_saved_pc(struct task_struct *tsk);
103
104unsigned long get_wchan(struct task_struct *p); 99unsigned long get_wchan(struct task_struct *p);
105 100
106#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc) 101#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 5a4c92abc99e..a957b374e3a6 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -198,15 +198,6 @@ unsigned long get_wchan(struct task_struct *p)
198 return 0; 198 return 0;
199} 199}
200 200
201unsigned long thread_saved_pc(struct task_struct *tsk)
202{
203 /* Check whether the thread is blocked in resume() */
204 if (in_sched_functions(tsk->thread.pc))
205 return ((unsigned long *)tsk->thread.fp)[2];
206 else
207 return tsk->thread.pc;
208}
209
210int elf_check_arch(const struct elf32_hdr *hdr) 201int elf_check_arch(const struct elf32_hdr *hdr)
211{ 202{
212 unsigned long hsr0 = __get_HSR(0); 203 unsigned long hsr0 = __get_HSR(0);
diff --git a/arch/h8300/include/asm/processor.h b/arch/h8300/include/asm/processor.h
index 65132d7ae9e5..afa53147e66a 100644
--- a/arch/h8300/include/asm/processor.h
+++ b/arch/h8300/include/asm/processor.h
@@ -110,10 +110,6 @@ static inline void release_thread(struct task_struct *dead_task)
110{ 110{
111} 111}
112 112
113/*
114 * Return saved PC of a blocked thread.
115 */
116unsigned long thread_saved_pc(struct task_struct *tsk);
117unsigned long get_wchan(struct task_struct *p); 113unsigned long get_wchan(struct task_struct *p);
118 114
119#define KSTK_EIP(tsk) \ 115#define KSTK_EIP(tsk) \
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 0f5db5bb561b..d1ddcabbbe83 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -129,11 +129,6 @@ int copy_thread(unsigned long clone_flags,
129 return 0; 129 return 0;
130} 130}
131 131
132unsigned long thread_saved_pc(struct task_struct *tsk)
133{
134 return ((struct pt_regs *)tsk->thread.esp0)->pc;
135}
136
137unsigned long get_wchan(struct task_struct *p) 132unsigned long get_wchan(struct task_struct *p)
138{ 133{
139 unsigned long fp, pc; 134 unsigned long fp, pc;
diff --git a/arch/hexagon/include/asm/processor.h b/arch/hexagon/include/asm/processor.h
index 45a825402f63..ce67940860a5 100644
--- a/arch/hexagon/include/asm/processor.h
+++ b/arch/hexagon/include/asm/processor.h
@@ -33,9 +33,6 @@
33/* task_struct, defined elsewhere, is the "process descriptor" */ 33/* task_struct, defined elsewhere, is the "process descriptor" */
34struct task_struct; 34struct task_struct;
35 35
36/* this is defined in arch/process.c */
37extern unsigned long thread_saved_pc(struct task_struct *tsk);
38
39extern void start_thread(struct pt_regs *, unsigned long, unsigned long); 36extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
40 37
41/* 38/*
diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index de715bab7956..656050c2e6a0 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -61,14 +61,6 @@ void arch_cpu_idle(void)
61} 61}
62 62
63/* 63/*
64 * Return saved PC of a blocked thread
65 */
66unsigned long thread_saved_pc(struct task_struct *tsk)
67{
68 return 0;
69}
70
71/*
72 * Copy architecture-specific thread state 64 * Copy architecture-specific thread state
73 */ 65 */
74int copy_thread(unsigned long clone_flags, unsigned long usp, 66int copy_thread(unsigned long clone_flags, unsigned long usp,
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index 26a63d69c599..ab982f07ea68 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -602,23 +602,6 @@ ia64_set_unat (__u64 *unat, void *spill_addr, unsigned long nat)
602} 602}
603 603
604/* 604/*
605 * Return saved PC of a blocked thread.
606 * Note that the only way T can block is through a call to schedule() -> switch_to().
607 */
608static inline unsigned long
609thread_saved_pc (struct task_struct *t)
610{
611 struct unw_frame_info info;
612 unsigned long ip;
613
614 unw_init_from_blocked_task(&info, t);
615 if (unw_unwind(&info) < 0)
616 return 0;
617 unw_get_ip(&info, &ip);
618 return ip;
619}
620
621/*
622 * Get the current instruction/program counter value. 605 * Get the current instruction/program counter value.
623 */ 606 */
624#define current_text_addr() \ 607#define current_text_addr() \
diff --git a/arch/m32r/include/asm/processor.h b/arch/m32r/include/asm/processor.h
index 5767367550c6..657874eeeccc 100644
--- a/arch/m32r/include/asm/processor.h
+++ b/arch/m32r/include/asm/processor.h
@@ -122,8 +122,6 @@ extern void release_thread(struct task_struct *);
122extern void copy_segments(struct task_struct *p, struct mm_struct * mm); 122extern void copy_segments(struct task_struct *p, struct mm_struct * mm);
123extern void release_segments(struct mm_struct * mm); 123extern void release_segments(struct mm_struct * mm);
124 124
125extern unsigned long thread_saved_pc(struct task_struct *);
126
127/* Copy and release all segment info associated with a VM */ 125/* Copy and release all segment info associated with a VM */
128#define copy_segments(p, mm) do { } while (0) 126#define copy_segments(p, mm) do { } while (0)
129#define release_segments(mm) do { } while (0) 127#define release_segments(mm) do { } while (0)
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index d8ffcfec599c..8cd7e03f4370 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -39,14 +39,6 @@
39 39
40#include <linux/err.h> 40#include <linux/err.h>
41 41
42/*
43 * Return saved PC of a blocked thread.
44 */
45unsigned long thread_saved_pc(struct task_struct *tsk)
46{
47 return tsk->thread.lr;
48}
49
50void (*pm_power_off)(void) = NULL; 42void (*pm_power_off)(void) = NULL;
51EXPORT_SYMBOL(pm_power_off); 43EXPORT_SYMBOL(pm_power_off);
52 44
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index 77239e81379b..94c36030440c 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -130,8 +130,6 @@ static inline void release_thread(struct task_struct *dead_task)
130{ 130{
131} 131}
132 132
133extern unsigned long thread_saved_pc(struct task_struct *tsk);
134
135unsigned long get_wchan(struct task_struct *p); 133unsigned long get_wchan(struct task_struct *p);
136 134
137#define KSTK_EIP(tsk) \ 135#define KSTK_EIP(tsk) \
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index e475c945c8b2..7df92f8b0781 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -40,20 +40,6 @@
40asmlinkage void ret_from_fork(void); 40asmlinkage void ret_from_fork(void);
41asmlinkage void ret_from_kernel_thread(void); 41asmlinkage void ret_from_kernel_thread(void);
42 42
43
44/*
45 * Return saved PC from a blocked thread
46 */
47unsigned long thread_saved_pc(struct task_struct *tsk)
48{
49 struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
50 /* Check whether the thread is blocked in resume() */
51 if (in_sched_functions(sw->retpc))
52 return ((unsigned long *)sw->a6)[1];
53 else
54 return sw->retpc;
55}
56
57void arch_cpu_idle(void) 43void arch_cpu_idle(void)
58{ 44{
59#if defined(MACH_ATARI_ONLY) 45#if defined(MACH_ATARI_ONLY)
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 37ef196e4519..330d556860ba 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -69,8 +69,6 @@ static inline void release_thread(struct task_struct *dead_task)
69{ 69{
70} 70}
71 71
72extern unsigned long thread_saved_pc(struct task_struct *t);
73
74extern unsigned long get_wchan(struct task_struct *p); 72extern unsigned long get_wchan(struct task_struct *p);
75 73
76# define KSTK_EIP(tsk) (0) 74# define KSTK_EIP(tsk) (0)
@@ -121,10 +119,6 @@ static inline void release_thread(struct task_struct *dead_task)
121{ 119{
122} 120}
123 121
124/* Return saved (kernel) PC of a blocked thread. */
125# define thread_saved_pc(tsk) \
126 ((tsk)->thread.regs ? (tsk)->thread.regs->r15 : 0)
127
128unsigned long get_wchan(struct task_struct *p); 122unsigned long get_wchan(struct task_struct *p);
129 123
130/* The size allocated for kernel stacks. This _must_ be a power of two! */ 124/* The size allocated for kernel stacks. This _must_ be a power of two! */
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index e92a817e645f..6527ec22f158 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -119,23 +119,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
119 return 0; 119 return 0;
120} 120}
121 121
122#ifndef CONFIG_MMU
123/*
124 * Return saved PC of a blocked thread.
125 */
126unsigned long thread_saved_pc(struct task_struct *tsk)
127{
128 struct cpu_context *ctx =
129 &(((struct thread_info *)(tsk->stack))->cpu_context);
130
131 /* Check whether the thread is blocked in resume() */
132 if (in_sched_functions(ctx->r15))
133 return (unsigned long)ctx->r15;
134 else
135 return ctx->r14;
136}
137#endif
138
139unsigned long get_wchan(struct task_struct *p) 122unsigned long get_wchan(struct task_struct *p)
140{ 123{
141/* TBD (used by procfs) */ 124/* TBD (used by procfs) */
diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h
index 18e17abf7664..3ae479117b42 100644
--- a/arch/mn10300/include/asm/processor.h
+++ b/arch/mn10300/include/asm/processor.h
@@ -132,11 +132,6 @@ static inline void start_thread(struct pt_regs *regs,
132/* Free all resources held by a thread. */ 132/* Free all resources held by a thread. */
133extern void release_thread(struct task_struct *); 133extern void release_thread(struct task_struct *);
134 134
135/*
136 * Return saved PC of a blocked thread.
137 */
138extern unsigned long thread_saved_pc(struct task_struct *tsk);
139
140unsigned long get_wchan(struct task_struct *p); 135unsigned long get_wchan(struct task_struct *p);
141 136
142#define task_pt_regs(task) ((task)->thread.uregs) 137#define task_pt_regs(task) ((task)->thread.uregs)
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index c9fa42619c6a..89e8027e07fb 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -40,14 +40,6 @@
40#include "internal.h" 40#include "internal.h"
41 41
42/* 42/*
43 * return saved PC of a blocked thread.
44 */
45unsigned long thread_saved_pc(struct task_struct *tsk)
46{
47 return ((unsigned long *) tsk->thread.sp)[3];
48}
49
50/*
51 * power off function, if any 43 * power off function, if any
52 */ 44 */
53void (*pm_power_off)(void); 45void (*pm_power_off)(void);
diff --git a/arch/nios2/include/asm/processor.h b/arch/nios2/include/asm/processor.h
index 3bbbc3d798e5..4944e2e1d8b0 100644
--- a/arch/nios2/include/asm/processor.h
+++ b/arch/nios2/include/asm/processor.h
@@ -75,9 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
75{ 75{
76} 76}
77 77
78/* Return saved PC of a blocked thread. */
79#define thread_saved_pc(tsk) ((tsk)->thread.kregs->ea)
80
81extern unsigned long get_wchan(struct task_struct *p); 78extern unsigned long get_wchan(struct task_struct *p);
82 79
83#define task_pt_regs(p) \ 80#define task_pt_regs(p) \
diff --git a/arch/openrisc/include/asm/processor.h b/arch/openrisc/include/asm/processor.h
index a908e6c30a00..396d8f306c21 100644
--- a/arch/openrisc/include/asm/processor.h
+++ b/arch/openrisc/include/asm/processor.h
@@ -84,11 +84,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
84void release_thread(struct task_struct *); 84void release_thread(struct task_struct *);
85unsigned long get_wchan(struct task_struct *p); 85unsigned long get_wchan(struct task_struct *p);
86 86
87/*
88 * Return saved PC of a blocked thread. For now, this is the "user" PC
89 */
90extern unsigned long thread_saved_pc(struct task_struct *t);
91
92#define init_stack (init_thread_union.stack) 87#define init_stack (init_thread_union.stack)
93 88
94#define cpu_relax() barrier() 89#define cpu_relax() barrier()
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index 106859ae27ff..f9b77003f113 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -110,11 +110,6 @@ void show_regs(struct pt_regs *regs)
110 show_registers(regs); 110 show_registers(regs);
111} 111}
112 112
113unsigned long thread_saved_pc(struct task_struct *t)
114{
115 return (unsigned long)user_regs(t->stack)->pc;
116}
117
118void release_thread(struct task_struct *dead_task) 113void release_thread(struct task_struct *dead_task)
119{ 114{
120} 115}
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index a3661ee6b060..4c6694b4e77e 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -163,12 +163,7 @@ struct thread_struct {
163 .flags = 0 \ 163 .flags = 0 \
164 } 164 }
165 165
166/*
167 * Return saved PC of a blocked thread. This is used by ps mostly.
168 */
169
170struct task_struct; 166struct task_struct;
171unsigned long thread_saved_pc(struct task_struct *t);
172void show_trace(struct task_struct *task, unsigned long *stack); 167void show_trace(struct task_struct *task, unsigned long *stack);
173 168
174/* 169/*
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 4516a5b53f38..b64d7d21646e 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -239,11 +239,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
239 return 0; 239 return 0;
240} 240}
241 241
242unsigned long thread_saved_pc(struct task_struct *t)
243{
244 return t->thread.regs.kpc;
245}
246
247unsigned long 242unsigned long
248get_wchan(struct task_struct *p) 243get_wchan(struct task_struct *p)
249{ 244{
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index bb99b651085a..1189d04f3bd1 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -378,12 +378,6 @@ struct thread_struct {
378} 378}
379#endif 379#endif
380 380
381/*
382 * Return saved PC of a blocked thread. For now, this is the "user" PC
383 */
384#define thread_saved_pc(tsk) \
385 ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0)
386
387#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.regs) 381#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.regs)
388 382
389unsigned long get_wchan(struct task_struct *p); 383unsigned long get_wchan(struct task_struct *p);
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 60d395fdc864..aeac013968f2 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -221,11 +221,6 @@ extern void release_thread(struct task_struct *);
221/* Free guarded storage control block for current */ 221/* Free guarded storage control block for current */
222void exit_thread_gs(void); 222void exit_thread_gs(void);
223 223
224/*
225 * Return saved PC of a blocked thread.
226 */
227extern unsigned long thread_saved_pc(struct task_struct *t);
228
229unsigned long get_wchan(struct task_struct *p); 224unsigned long get_wchan(struct task_struct *p);
230#define task_pt_regs(tsk) ((struct pt_regs *) \ 225#define task_pt_regs(tsk) ((struct pt_regs *) \
231 (task_stack_page(tsk) + THREAD_SIZE) - 1) 226 (task_stack_page(tsk) + THREAD_SIZE) - 1)
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 999d7154bbdc..bb32b8618bf6 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -41,31 +41,6 @@
41 41
42asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 42asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
43 43
44/*
45 * Return saved PC of a blocked thread. used in kernel/sched.
46 * resume in entry.S does not create a new stack frame, it
47 * just stores the registers %r6-%r15 to the frame given by
48 * schedule. We want to return the address of the caller of
49 * schedule, so we have to walk the backchain one time to
50 * find the frame schedule() store its return address.
51 */
52unsigned long thread_saved_pc(struct task_struct *tsk)
53{
54 struct stack_frame *sf, *low, *high;
55
56 if (!tsk || !task_stack_page(tsk))
57 return 0;
58 low = task_stack_page(tsk);
59 high = (struct stack_frame *) task_pt_regs(tsk);
60 sf = (struct stack_frame *) tsk->thread.ksp;
61 if (sf <= low || sf > high)
62 return 0;
63 sf = (struct stack_frame *) sf->back_chain;
64 if (sf <= low || sf > high)
65 return 0;
66 return sf->gprs[8];
67}
68
69extern void kernel_thread_starter(void); 44extern void kernel_thread_starter(void);
70 45
71/* 46/*
diff --git a/arch/score/include/asm/processor.h b/arch/score/include/asm/processor.h
index d9a922d8711b..299274581968 100644
--- a/arch/score/include/asm/processor.h
+++ b/arch/score/include/asm/processor.h
@@ -13,7 +13,6 @@ struct task_struct;
13 */ 13 */
14extern void (*cpu_wait)(void); 14extern void (*cpu_wait)(void);
15 15
16extern unsigned long thread_saved_pc(struct task_struct *tsk);
17extern void start_thread(struct pt_regs *regs, 16extern void start_thread(struct pt_regs *regs,
18 unsigned long pc, unsigned long sp); 17 unsigned long pc, unsigned long sp);
19extern unsigned long get_wchan(struct task_struct *p); 18extern unsigned long get_wchan(struct task_struct *p);
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c
index eb64d7a677cb..6e20241a1ed4 100644
--- a/arch/score/kernel/process.c
+++ b/arch/score/kernel/process.c
@@ -101,11 +101,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
101 return 1; 101 return 1;
102} 102}
103 103
104unsigned long thread_saved_pc(struct task_struct *tsk)
105{
106 return task_pt_regs(tsk)->cp0_epc;
107}
108
109unsigned long get_wchan(struct task_struct *task) 104unsigned long get_wchan(struct task_struct *task)
110{ 105{
111 if (!task || task == current || task->state == TASK_RUNNING) 106 if (!task || task == current || task->state == TASK_RUNNING)
diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h
index dd27159819eb..b395e5620c0b 100644
--- a/arch/sparc/include/asm/processor_32.h
+++ b/arch/sparc/include/asm/processor_32.h
@@ -67,9 +67,6 @@ struct thread_struct {
67 .current_ds = KERNEL_DS, \ 67 .current_ds = KERNEL_DS, \
68} 68}
69 69
70/* Return saved PC of a blocked thread. */
71unsigned long thread_saved_pc(struct task_struct *t);
72
73/* Do necessary setup to start up a newly executed thread. */ 70/* Do necessary setup to start up a newly executed thread. */
74static inline void start_thread(struct pt_regs * regs, unsigned long pc, 71static inline void start_thread(struct pt_regs * regs, unsigned long pc,
75 unsigned long sp) 72 unsigned long sp)
diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h
index b58ee9018433..f04dc5a43062 100644
--- a/arch/sparc/include/asm/processor_64.h
+++ b/arch/sparc/include/asm/processor_64.h
@@ -89,9 +89,7 @@ struct thread_struct {
89#include <linux/types.h> 89#include <linux/types.h>
90#include <asm/fpumacro.h> 90#include <asm/fpumacro.h>
91 91
92/* Return saved PC of a blocked thread. */
93struct task_struct; 92struct task_struct;
94unsigned long thread_saved_pc(struct task_struct *);
95 93
96/* On Uniprocessor, even in RMO processes see TSO semantics */ 94/* On Uniprocessor, even in RMO processes see TSO semantics */
97#ifdef CONFIG_SMP 95#ifdef CONFIG_SMP
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index b6dac8e980f0..9245f93398c7 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -177,14 +177,6 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
177} 177}
178 178
179/* 179/*
180 * Note: sparc64 has a pretty intricated thread_saved_pc, check it out.
181 */
182unsigned long thread_saved_pc(struct task_struct *tsk)
183{
184 return task_thread_info(tsk)->kpc;
185}
186
187/*
188 * Free current thread data structures etc.. 180 * Free current thread data structures etc..
189 */ 181 */
190void exit_thread(struct task_struct *tsk) 182void exit_thread(struct task_struct *tsk)
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index 1badc493e62e..b96104da5bd6 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -400,25 +400,6 @@ core_initcall(sparc_sysrq_init);
400 400
401#endif 401#endif
402 402
403unsigned long thread_saved_pc(struct task_struct *tsk)
404{
405 struct thread_info *ti = task_thread_info(tsk);
406 unsigned long ret = 0xdeadbeefUL;
407
408 if (ti && ti->ksp) {
409 unsigned long *sp;
410 sp = (unsigned long *)(ti->ksp + STACK_BIAS);
411 if (((unsigned long)sp & (sizeof(long) - 1)) == 0UL &&
412 sp[14]) {
413 unsigned long *fp;
414 fp = (unsigned long *)(sp[14] + STACK_BIAS);
415 if (((unsigned long)fp & (sizeof(long) - 1)) == 0UL)
416 ret = fp[15];
417 }
418 }
419 return ret;
420}
421
422/* Free current thread data structures etc.. */ 403/* Free current thread data structures etc.. */
423void exit_thread(struct task_struct *tsk) 404void exit_thread(struct task_struct *tsk)
424{ 405{
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h
index 0bc9968b97a1..f71e5206650b 100644
--- a/arch/tile/include/asm/processor.h
+++ b/arch/tile/include/asm/processor.h
@@ -214,13 +214,6 @@ static inline void release_thread(struct task_struct *dead_task)
214 214
215extern void prepare_exit_to_usermode(struct pt_regs *regs, u32 flags); 215extern void prepare_exit_to_usermode(struct pt_regs *regs, u32 flags);
216 216
217
218/*
219 * Return saved (kernel) PC of a blocked thread.
220 * Only used in a printk() in kernel/sched/core.c, so don't work too hard.
221 */
222#define thread_saved_pc(t) ((t)->thread.pc)
223
224unsigned long get_wchan(struct task_struct *p); 217unsigned long get_wchan(struct task_struct *p);
225 218
226/* Return initial ksp value for given task. */ 219/* Return initial ksp value for given task. */
diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h
index 2d1e0dd5bb0b..f6d1a3f747a9 100644
--- a/arch/um/include/asm/processor-generic.h
+++ b/arch/um/include/asm/processor-generic.h
@@ -58,8 +58,6 @@ static inline void release_thread(struct task_struct *task)
58{ 58{
59} 59}
60 60
61extern unsigned long thread_saved_pc(struct task_struct *t);
62
63static inline void mm_copy_segments(struct mm_struct *from_mm, 61static inline void mm_copy_segments(struct mm_struct *from_mm,
64 struct mm_struct *new_mm) 62 struct mm_struct *new_mm)
65{ 63{
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 64a1fd06f3fd..7b5640117325 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -56,12 +56,6 @@ union thread_union cpu0_irqstack
56 __attribute__((__section__(".data..init_irqstack"))) = 56 __attribute__((__section__(".data..init_irqstack"))) =
57 { INIT_THREAD_INFO(init_task) }; 57 { INIT_THREAD_INFO(init_task) };
58 58
59unsigned long thread_saved_pc(struct task_struct *task)
60{
61 /* FIXME: Need to look up userspace_pid by cpu */
62 return os_process_pc(userspace_pid[0]);
63}
64
65/* Changed in setup_arch, which is called in early boot */ 59/* Changed in setup_arch, which is called in early boot */
66static char host_info[(__NEW_UTS_LEN + 1) * 5]; 60static char host_info[(__NEW_UTS_LEN + 1) * 5];
67 61
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 3cada998a402..a28b671f1549 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -860,8 +860,6 @@ extern unsigned long KSTK_ESP(struct task_struct *task);
860 860
861#endif /* CONFIG_X86_64 */ 861#endif /* CONFIG_X86_64 */
862 862
863extern unsigned long thread_saved_pc(struct task_struct *tsk);
864
865extern void start_thread(struct pt_regs *regs, unsigned long new_ip, 863extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
866 unsigned long new_sp); 864 unsigned long new_sp);
867 865
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 0bb88428cbf2..3ca198080ea9 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -545,17 +545,6 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
545} 545}
546 546
547/* 547/*
548 * Return saved PC of a blocked thread.
549 * What is this good for? it will be always the scheduler or ret_from_fork.
550 */
551unsigned long thread_saved_pc(struct task_struct *tsk)
552{
553 struct inactive_task_frame *frame =
554 (struct inactive_task_frame *) READ_ONCE(tsk->thread.sp);
555 return READ_ONCE_NOCHECK(frame->ret_addr);
556}
557
558/*
559 * Called from fs/proc with a reference on @p to find the function 548 * Called from fs/proc with a reference on @p to find the function
560 * which called into schedule(). This needs to be done carefully 549 * which called into schedule(). This needs to be done carefully
561 * because the task might wake up and we might look at a stack 550 * because the task might wake up and we might look at a stack
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index 003eeee3fbc6..30ee8c608853 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -213,8 +213,6 @@ struct mm_struct;
213#define release_segments(mm) do { } while(0) 213#define release_segments(mm) do { } while(0)
214#define forget_segments() do { } while (0) 214#define forget_segments() do { } while (0)
215 215
216#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
217
218extern unsigned long get_wchan(struct task_struct *p); 216extern unsigned long get_wchan(struct task_struct *p);
219 217
220#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 218#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)