Skip to content

Commit 6474924

Browse files
tklausertorvalds
authored andcommitted
arch: remove unused macro/function thread_saved_pc()
The only user of thread_saved_pc() in non-arch-specific code was removed in commit 8243d55 ("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 <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e547204 commit 6474924

File tree

41 files changed

+0
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+0
-270
lines changed

arch/arc/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ struct task_struct;
8686
#define TSK_K_BLINK(tsk) TSK_K_REG(tsk, 4)
8787
#define TSK_K_FP(tsk) TSK_K_REG(tsk, 0)
8888

89-
#define thread_saved_pc(tsk) TSK_K_BLINK(tsk)
90-
9189
extern void start_thread(struct pt_regs * regs, unsigned long pc,
9290
unsigned long usp);
9391

arch/blackfin/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
7575
{
7676
}
7777

78-
/*
79-
* Return saved PC of a blocked thread.
80-
*/
81-
#define thread_saved_pc(tsk) (tsk->thread.pc)
82-
8378
unsigned long get_wchan(struct task_struct *p);
8479

8580
#define KSTK_EIP(tsk) \

arch/c6x/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ static inline void release_thread(struct task_struct *dead_task)
9595
#define copy_segments(tsk, mm) do { } while (0)
9696
#define release_segments(mm) do { } while (0)
9797

98-
/*
99-
* saved PC of a blocked thread.
100-
*/
101-
#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
102-
10398
/*
10499
* saved kernel SP and DP of a blocked thread.
105100
*/

arch/cris/arch-v10/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ void hard_reset_now (void)
6969
while(1) /* waiting for RETRIBUTION! */ ;
7070
}
7171

72-
/*
73-
* Return saved PC of a blocked thread.
74-
*/
75-
unsigned long thread_saved_pc(struct task_struct *t)
76-
{
77-
return task_pt_regs(t)->irp;
78-
}
79-
8072
/* setup the child's kernel stack with a pt_regs and switch_stack on it.
8173
* it will be un-nested during _resume and _ret_from_sys_call when the
8274
* new thread is scheduled.

arch/cris/arch-v32/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ hard_reset_now(void)
8484
; /* Wait for reset. */
8585
}
8686

87-
/*
88-
* Return saved PC of a blocked thread.
89-
*/
90-
unsigned long thread_saved_pc(struct task_struct *t)
91-
{
92-
return task_pt_regs(t)->erp;
93-
}
94-
9587
/*
9688
* Setup the child's kernel stack with a pt_regs and call switch_stack() on it.
9789
* It will be unnested during _resume and _ret_from_sys_call when the new thread

arch/cris/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ unsigned long get_wchan(struct task_struct *p);
5252

5353
#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
5454

55-
extern unsigned long thread_saved_pc(struct task_struct *tsk);
56-
5755
/* Free all resources held by a thread. */
5856
static inline void release_thread(struct task_struct *dead_task)
5957
{

arch/frv/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ...
9696
#define release_segments(mm) do { } while (0)
9797
#define forget_segments() do { } while (0)
9898

99-
/*
100-
* Return saved PC of a blocked thread.
101-
*/
102-
extern unsigned long thread_saved_pc(struct task_struct *tsk);
103-
10499
unsigned long get_wchan(struct task_struct *p);
105100

106101
#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)

arch/frv/kernel/process.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,6 @@ unsigned long get_wchan(struct task_struct *p)
198198
return 0;
199199
}
200200

201-
unsigned 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-
210201
int elf_check_arch(const struct elf32_hdr *hdr)
211202
{
212203
unsigned long hsr0 = __get_HSR(0);

arch/h8300/include/asm/processor.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ static inline void release_thread(struct task_struct *dead_task)
110110
{
111111
}
112112

113-
/*
114-
* Return saved PC of a blocked thread.
115-
*/
116-
unsigned long thread_saved_pc(struct task_struct *tsk);
117113
unsigned long get_wchan(struct task_struct *p);
118114

119115
#define KSTK_EIP(tsk) \

arch/h8300/kernel/process.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ int copy_thread(unsigned long clone_flags,
129129
return 0;
130130
}
131131

132-
unsigned long thread_saved_pc(struct task_struct *tsk)
133-
{
134-
return ((struct pt_regs *)tsk->thread.esp0)->pc;
135-
}
136-
137132
unsigned long get_wchan(struct task_struct *p)
138133
{
139134
unsigned long fp, pc;

arch/hexagon/include/asm/processor.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
/* task_struct, defined elsewhere, is the "process descriptor" */
3434
struct task_struct;
3535

36-
/* this is defined in arch/process.c */
37-
extern unsigned long thread_saved_pc(struct task_struct *tsk);
38-
3936
extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
4037

4138
/*

arch/hexagon/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ void arch_cpu_idle(void)
6060
local_irq_enable();
6161
}
6262

63-
/*
64-
* Return saved PC of a blocked thread
65-
*/
66-
unsigned long thread_saved_pc(struct task_struct *tsk)
67-
{
68-
return 0;
69-
}
70-
7163
/*
7264
* Copy architecture-specific thread state
7365
*/

arch/ia64/include/asm/processor.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -601,23 +601,6 @@ ia64_set_unat (__u64 *unat, void *spill_addr, unsigned long nat)
601601
*unat = (*unat & ~mask) | (nat << bit);
602602
}
603603

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-
*/
608-
static inline unsigned long
609-
thread_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-
621604
/*
622605
* Get the current instruction/program counter value.
623606
*/

arch/m32r/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ extern void release_thread(struct task_struct *);
122122
extern void copy_segments(struct task_struct *p, struct mm_struct * mm);
123123
extern void release_segments(struct mm_struct * mm);
124124

125-
extern unsigned long thread_saved_pc(struct task_struct *);
126-
127125
/* Copy and release all segment info associated with a VM */
128126
#define copy_segments(p, mm) do { } while (0)
129127
#define release_segments(mm) do { } while (0)

arch/m32r/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939

4040
#include <linux/err.h>
4141

42-
/*
43-
* Return saved PC of a blocked thread.
44-
*/
45-
unsigned long thread_saved_pc(struct task_struct *tsk)
46-
{
47-
return tsk->thread.lr;
48-
}
49-
5042
void (*pm_power_off)(void) = NULL;
5143
EXPORT_SYMBOL(pm_power_off);
5244

arch/m68k/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ static inline void release_thread(struct task_struct *dead_task)
130130
{
131131
}
132132

133-
extern unsigned long thread_saved_pc(struct task_struct *tsk);
134-
135133
unsigned long get_wchan(struct task_struct *p);
136134

137135
#define KSTK_EIP(tsk) \

arch/m68k/kernel/process.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,6 @@
4040
asmlinkage void ret_from_fork(void);
4141
asmlinkage void ret_from_kernel_thread(void);
4242

43-
44-
/*
45-
* Return saved PC from a blocked thread
46-
*/
47-
unsigned 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-
5743
void arch_cpu_idle(void)
5844
{
5945
#if defined(MACH_ATARI_ONLY)

arch/microblaze/include/asm/processor.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ static inline void release_thread(struct task_struct *dead_task)
6969
{
7070
}
7171

72-
extern unsigned long thread_saved_pc(struct task_struct *t);
73-
7472
extern unsigned long get_wchan(struct task_struct *p);
7573

7674
# define KSTK_EIP(tsk) (0)
@@ -121,10 +119,6 @@ static inline void release_thread(struct task_struct *dead_task)
121119
{
122120
}
123121

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-
128122
unsigned long get_wchan(struct task_struct *p);
129123

130124
/* The size allocated for kernel stacks. This _must_ be a power of two! */

arch/microblaze/kernel/process.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
119119
return 0;
120120
}
121121

122-
#ifndef CONFIG_MMU
123-
/*
124-
* Return saved PC of a blocked thread.
125-
*/
126-
unsigned 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-
139122
unsigned long get_wchan(struct task_struct *p)
140123
{
141124
/* TBD (used by procfs) */

arch/mn10300/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@ static inline void start_thread(struct pt_regs *regs,
132132
/* Free all resources held by a thread. */
133133
extern void release_thread(struct task_struct *);
134134

135-
/*
136-
* Return saved PC of a blocked thread.
137-
*/
138-
extern unsigned long thread_saved_pc(struct task_struct *tsk);
139-
140135
unsigned long get_wchan(struct task_struct *p);
141136

142137
#define task_pt_regs(task) ((task)->thread.uregs)

arch/mn10300/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
#include <asm/gdb-stub.h>
4040
#include "internal.h"
4141

42-
/*
43-
* return saved PC of a blocked thread.
44-
*/
45-
unsigned long thread_saved_pc(struct task_struct *tsk)
46-
{
47-
return ((unsigned long *) tsk->thread.sp)[3];
48-
}
49-
5042
/*
5143
* power off function, if any
5244
*/

arch/nios2/include/asm/processor.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
7575
{
7676
}
7777

78-
/* Return saved PC of a blocked thread. */
79-
#define thread_saved_pc(tsk) ((tsk)->thread.kregs->ea)
80-
8178
extern unsigned long get_wchan(struct task_struct *p);
8279

8380
#define task_pt_regs(p) \

arch/openrisc/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
8484
void release_thread(struct task_struct *);
8585
unsigned long get_wchan(struct task_struct *p);
8686

87-
/*
88-
* Return saved PC of a blocked thread. For now, this is the "user" PC
89-
*/
90-
extern unsigned long thread_saved_pc(struct task_struct *t);
91-
9287
#define init_stack (init_thread_union.stack)
9388

9489
#define cpu_relax() barrier()

arch/openrisc/kernel/process.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ void show_regs(struct pt_regs *regs)
110110
show_registers(regs);
111111
}
112112

113-
unsigned long thread_saved_pc(struct task_struct *t)
114-
{
115-
return (unsigned long)user_regs(t->stack)->pc;
116-
}
117-
118113
void release_thread(struct task_struct *dead_task)
119114
{
120115
}

arch/parisc/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,7 @@ struct thread_struct {
163163
.flags = 0 \
164164
}
165165

166-
/*
167-
* Return saved PC of a blocked thread. This is used by ps mostly.
168-
*/
169-
170166
struct task_struct;
171-
unsigned long thread_saved_pc(struct task_struct *t);
172167
void show_trace(struct task_struct *task, unsigned long *stack);
173168

174169
/*

arch/parisc/kernel/process.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
239239
return 0;
240240
}
241241

242-
unsigned long thread_saved_pc(struct task_struct *t)
243-
{
244-
return t->thread.regs.kpc;
245-
}
246-
247242
unsigned long
248243
get_wchan(struct task_struct *p)
249244
{

arch/powerpc/include/asm/processor.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,6 @@ struct thread_struct {
378378
}
379379
#endif
380380

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-
387381
#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.regs)
388382

389383
unsigned long get_wchan(struct task_struct *p);

arch/s390/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ extern void release_thread(struct task_struct *);
221221
/* Free guarded storage control block for current */
222222
void exit_thread_gs(void);
223223

224-
/*
225-
* Return saved PC of a blocked thread.
226-
*/
227-
extern unsigned long thread_saved_pc(struct task_struct *t);
228-
229224
unsigned long get_wchan(struct task_struct *p);
230225
#define task_pt_regs(tsk) ((struct pt_regs *) \
231226
(task_stack_page(tsk) + THREAD_SIZE) - 1)

0 commit comments

Comments
 (0)