Skip to content

Commit

Permalink
arch: remove unused macro/function thread_saved_pc()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tklauser authored and torvalds committed Jun 28, 2017
1 parent e547204 commit 6474924
Show file tree
Hide file tree
Showing 41 changed files with 0 additions and 270 deletions.
2 changes: 0 additions & 2 deletions arch/arc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ struct task_struct;
#define TSK_K_BLINK(tsk) TSK_K_REG(tsk, 4)
#define TSK_K_FP(tsk) TSK_K_REG(tsk, 0)

#define thread_saved_pc(tsk) TSK_K_BLINK(tsk)

extern void start_thread(struct pt_regs * regs, unsigned long pc,
unsigned long usp);

Expand Down
5 changes: 0 additions & 5 deletions arch/blackfin/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}

/*
* Return saved PC of a blocked thread.
*/
#define thread_saved_pc(tsk) (tsk->thread.pc)

unsigned long get_wchan(struct task_struct *p);

#define KSTK_EIP(tsk) \
Expand Down
5 changes: 0 additions & 5 deletions arch/c6x/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ static inline void release_thread(struct task_struct *dead_task)
#define copy_segments(tsk, mm) do { } while (0)
#define release_segments(mm) do { } while (0)

/*
* saved PC of a blocked thread.
*/
#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)

/*
* saved kernel SP and DP of a blocked thread.
*/
Expand Down
8 changes: 0 additions & 8 deletions arch/cris/arch-v10/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ void hard_reset_now (void)
while(1) /* waiting for RETRIBUTION! */ ;
}

/*
* Return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *t)
{
return task_pt_regs(t)->irp;
}

/* setup the child's kernel stack with a pt_regs and switch_stack on it.
* it will be un-nested during _resume and _ret_from_sys_call when the
* new thread is scheduled.
Expand Down
8 changes: 0 additions & 8 deletions arch/cris/arch-v32/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@ hard_reset_now(void)
; /* Wait for reset. */
}

/*
* Return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *t)
{
return task_pt_regs(t)->erp;
}

/*
* Setup the child's kernel stack with a pt_regs and call switch_stack() on it.
* It will be unnested during _resume and _ret_from_sys_call when the new thread
Expand Down
2 changes: 0 additions & 2 deletions arch/cris/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ unsigned long get_wchan(struct task_struct *p);

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

extern unsigned long thread_saved_pc(struct task_struct *tsk);

/* Free all resources held by a thread. */
static inline void release_thread(struct task_struct *dead_task)
{
Expand Down
5 changes: 0 additions & 5 deletions arch/frv/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ...
#define release_segments(mm) do { } while (0)
#define forget_segments() do { } while (0)

/*
* Return saved PC of a blocked thread.
*/
extern unsigned long thread_saved_pc(struct task_struct *tsk);

unsigned long get_wchan(struct task_struct *p);

#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)
Expand Down
9 changes: 0 additions & 9 deletions arch/frv/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,6 @@ unsigned long get_wchan(struct task_struct *p)
return 0;
}

unsigned long thread_saved_pc(struct task_struct *tsk)
{
/* Check whether the thread is blocked in resume() */
if (in_sched_functions(tsk->thread.pc))
return ((unsigned long *)tsk->thread.fp)[2];
else
return tsk->thread.pc;
}

int elf_check_arch(const struct elf32_hdr *hdr)
{
unsigned long hsr0 = __get_HSR(0);
Expand Down
4 changes: 0 additions & 4 deletions arch/h8300/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}

/*
* Return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *tsk);
unsigned long get_wchan(struct task_struct *p);

#define KSTK_EIP(tsk) \
Expand Down
5 changes: 0 additions & 5 deletions arch/h8300/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ int copy_thread(unsigned long clone_flags,
return 0;
}

unsigned long thread_saved_pc(struct task_struct *tsk)
{
return ((struct pt_regs *)tsk->thread.esp0)->pc;
}

unsigned long get_wchan(struct task_struct *p)
{
unsigned long fp, pc;
Expand Down
3 changes: 0 additions & 3 deletions arch/hexagon/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
/* task_struct, defined elsewhere, is the "process descriptor" */
struct task_struct;

/* this is defined in arch/process.c */
extern unsigned long thread_saved_pc(struct task_struct *tsk);

extern void start_thread(struct pt_regs *, unsigned long, unsigned long);

/*
Expand Down
8 changes: 0 additions & 8 deletions arch/hexagon/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ void arch_cpu_idle(void)
local_irq_enable();
}

/*
* Return saved PC of a blocked thread
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
return 0;
}

/*
* Copy architecture-specific thread state
*/
Expand Down
17 changes: 0 additions & 17 deletions arch/ia64/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,23 +601,6 @@ ia64_set_unat (__u64 *unat, void *spill_addr, unsigned long nat)
*unat = (*unat & ~mask) | (nat << bit);
}

/*
* Return saved PC of a blocked thread.
* Note that the only way T can block is through a call to schedule() -> switch_to().
*/
static inline unsigned long
thread_saved_pc (struct task_struct *t)
{
struct unw_frame_info info;
unsigned long ip;

unw_init_from_blocked_task(&info, t);
if (unw_unwind(&info) < 0)
return 0;
unw_get_ip(&info, &ip);
return ip;
}

/*
* Get the current instruction/program counter value.
*/
Expand Down
2 changes: 0 additions & 2 deletions arch/m32r/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ extern void release_thread(struct task_struct *);
extern void copy_segments(struct task_struct *p, struct mm_struct * mm);
extern void release_segments(struct mm_struct * mm);

extern unsigned long thread_saved_pc(struct task_struct *);

/* Copy and release all segment info associated with a VM */
#define copy_segments(p, mm) do { } while (0)
#define release_segments(mm) do { } while (0)
Expand Down
8 changes: 0 additions & 8 deletions arch/m32r/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@

#include <linux/err.h>

/*
* Return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
return tsk->thread.lr;
}

void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);

Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}

extern unsigned long thread_saved_pc(struct task_struct *tsk);

unsigned long get_wchan(struct task_struct *p);

#define KSTK_EIP(tsk) \
Expand Down
14 changes: 0 additions & 14 deletions arch/m68k/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@
asmlinkage void ret_from_fork(void);
asmlinkage void ret_from_kernel_thread(void);


/*
* Return saved PC from a blocked thread
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
/* Check whether the thread is blocked in resume() */
if (in_sched_functions(sw->retpc))
return ((unsigned long *)sw->a6)[1];
else
return sw->retpc;
}

void arch_cpu_idle(void)
{
#if defined(MACH_ATARI_ONLY)
Expand Down
6 changes: 0 additions & 6 deletions arch/microblaze/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}

extern unsigned long thread_saved_pc(struct task_struct *t);

extern unsigned long get_wchan(struct task_struct *p);

# define KSTK_EIP(tsk) (0)
Expand Down Expand Up @@ -121,10 +119,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}

/* Return saved (kernel) PC of a blocked thread. */
# define thread_saved_pc(tsk) \
((tsk)->thread.regs ? (tsk)->thread.regs->r15 : 0)

unsigned long get_wchan(struct task_struct *p);

/* The size allocated for kernel stacks. This _must_ be a power of two! */
Expand Down
17 changes: 0 additions & 17 deletions arch/microblaze/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
return 0;
}

#ifndef CONFIG_MMU
/*
* Return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
struct cpu_context *ctx =
&(((struct thread_info *)(tsk->stack))->cpu_context);

/* Check whether the thread is blocked in resume() */
if (in_sched_functions(ctx->r15))
return (unsigned long)ctx->r15;
else
return ctx->r14;
}
#endif

unsigned long get_wchan(struct task_struct *p)
{
/* TBD (used by procfs) */
Expand Down
5 changes: 0 additions & 5 deletions arch/mn10300/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ static inline void start_thread(struct pt_regs *regs,
/* Free all resources held by a thread. */
extern void release_thread(struct task_struct *);

/*
* Return saved PC of a blocked thread.
*/
extern unsigned long thread_saved_pc(struct task_struct *tsk);

unsigned long get_wchan(struct task_struct *p);

#define task_pt_regs(task) ((task)->thread.uregs)
Expand Down
8 changes: 0 additions & 8 deletions arch/mn10300/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@
#include <asm/gdb-stub.h>
#include "internal.h"

/*
* return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
return ((unsigned long *) tsk->thread.sp)[3];
}

/*
* power off function, if any
*/
Expand Down
3 changes: 0 additions & 3 deletions arch/nios2/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}

/* Return saved PC of a blocked thread. */
#define thread_saved_pc(tsk) ((tsk)->thread.kregs->ea)

extern unsigned long get_wchan(struct task_struct *p);

#define task_pt_regs(p) \
Expand Down
5 changes: 0 additions & 5 deletions arch/openrisc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
void release_thread(struct task_struct *);
unsigned long get_wchan(struct task_struct *p);

/*
* Return saved PC of a blocked thread. For now, this is the "user" PC
*/
extern unsigned long thread_saved_pc(struct task_struct *t);

#define init_stack (init_thread_union.stack)

#define cpu_relax() barrier()
Expand Down
5 changes: 0 additions & 5 deletions arch/openrisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ void show_regs(struct pt_regs *regs)
show_registers(regs);
}

unsigned long thread_saved_pc(struct task_struct *t)
{
return (unsigned long)user_regs(t->stack)->pc;
}

void release_thread(struct task_struct *dead_task)
{
}
Expand Down
5 changes: 0 additions & 5 deletions arch/parisc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,7 @@ struct thread_struct {
.flags = 0 \
}

/*
* Return saved PC of a blocked thread. This is used by ps mostly.
*/

struct task_struct;
unsigned long thread_saved_pc(struct task_struct *t);
void show_trace(struct task_struct *task, unsigned long *stack);

/*
Expand Down
5 changes: 0 additions & 5 deletions arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
return 0;
}

unsigned long thread_saved_pc(struct task_struct *t)
{
return t->thread.regs.kpc;
}

unsigned long
get_wchan(struct task_struct *p)
{
Expand Down
6 changes: 0 additions & 6 deletions arch/powerpc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,6 @@ struct thread_struct {
}
#endif

/*
* Return saved PC of a blocked thread. For now, this is the "user" PC
*/
#define thread_saved_pc(tsk) \
((tsk)->thread.regs? (tsk)->thread.regs->nip: 0)

#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.regs)

unsigned long get_wchan(struct task_struct *p);
Expand Down
5 changes: 0 additions & 5 deletions arch/s390/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ extern void release_thread(struct task_struct *);
/* Free guarded storage control block for current */
void exit_thread_gs(void);

/*
* Return saved PC of a blocked thread.
*/
extern unsigned long thread_saved_pc(struct task_struct *t);

unsigned long get_wchan(struct task_struct *p);
#define task_pt_regs(tsk) ((struct pt_regs *) \
(task_stack_page(tsk) + THREAD_SIZE) - 1)
Expand Down
Loading

0 comments on commit 6474924

Please sign in to comment.