Skip to content

Commit de0d22e

Browse files
nickdesaulnierstorvalds
authored andcommitted
treewide: remove current_text_addr
Prefer _THIS_IP_ defined in linux/kernel.h. Most definitions of current_text_addr were the same as _THIS_IP_, but a few archs had inline assembly instead. This patch removes the final call site of current_text_addr, making all of the definitions dead code. [akpm@linux-foundation.org: fix arch/csky/include/asm/processor.h] Link: http://lkml.kernel.org/r/20180911182413.180715-1-ndesaulniers@google.com Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 49ef341 commit de0d22e

29 files changed

Lines changed: 2 additions & 199 deletions

File tree

‎arch/alpha/include/asm/processor.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010

1111
#include <linux/personality.h> /* for ADDR_LIMIT_32BIT */
1212

13-
/*
14-
* Returns current instruction pointer ("program counter").
15-
*/
16-
#define current_text_addr() \
17-
({ void *__pc; __asm__ ("br %0,.+4" : "=r"(__pc)); __pc; })
18-
1913
/*
2014
* We have a 42-bit user address space: 4TB user VM...
2115
*/

‎arch/arc/include/asm/processor.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,6 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc,
9898

9999
extern unsigned int get_wchan(struct task_struct *p);
100100

101-
/*
102-
* Default implementation of macro that returns current
103-
* instruction pointer ("program counter").
104-
* Should the PC register be read instead ? This macro does not seem to
105-
* be used in many places so this wont be all that bad.
106-
*/
107-
#define current_text_addr() ({ __label__ _l; _l: &&_l; })
108-
109101
#endif /* !__ASSEMBLY__ */
110102

111103
/*

‎arch/arm/include/asm/processor.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
#ifndef __ASM_ARM_PROCESSOR_H
1212
#define __ASM_ARM_PROCESSOR_H
1313

14-
/*
15-
* Default implementation of macro that returns current
16-
* instruction pointer ("program counter").
17-
*/
18-
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
19-
2014
#ifdef __KERNEL__
2115

2216
#include <asm/hw_breakpoint.h>

‎arch/arm64/include/asm/processor.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
#define USER_DS (TASK_SIZE_64 - 1)
2626

2727
#ifndef __ASSEMBLY__
28-
29-
/*
30-
* Default implementation of macro that returns current
31-
* instruction pointer ("program counter").
32-
*/
33-
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
34-
3528
#ifdef __KERNEL__
3629

3730
#include <linux/build_bug.h>

‎arch/c6x/include/asm/processor.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@
1717
#include <asm/page.h>
1818
#include <asm/current.h>
1919

20-
/*
21-
* Default implementation of macro that returns current
22-
* instruction pointer ("program counter").
23-
*/
24-
#define current_text_addr() \
25-
({ \
26-
void *__pc; \
27-
asm("mvc .S2 pce1,%0\n" : "=b"(__pc)); \
28-
__pc; \
29-
})
30-
3120
/*
3221
* User space process size. This is mostly meaningless for NOMMU
3322
* but some C6X processors may have RAM addresses up to 0xFFFFFFFF.

‎arch/csky/include/asm/processor.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
#ifndef __ASM_CSKY_PROCESSOR_H
55
#define __ASM_CSKY_PROCESSOR_H
66

7-
/*
8-
* Default implementation of macro that returns current
9-
* instruction pointer ("program counter").
10-
*/
11-
#define current_text_addr() ({ __label__ _l; _l: &&_l; })
12-
137
#include <linux/bitops.h>
148
#include <asm/segment.h>
159
#include <asm/ptrace.h>

‎arch/h8300/include/asm/processor.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
#ifndef __ASM_H8300_PROCESSOR_H
1313
#define __ASM_H8300_PROCESSOR_H
1414

15-
/*
16-
* Default implementation of macro that returns current
17-
* instruction pointer ("program counter").
18-
*/
19-
#define current_text_addr() ({ __label__ _l; _l: &&_l; })
20-
2115
#include <linux/compiler.h>
2216
#include <asm/segment.h>
2317
#include <asm/ptrace.h>

‎arch/hexagon/include/asm/processor.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
#include <asm/registers.h>
2828
#include <asm/hexagon_vm.h>
2929

30-
/* must be a macro */
31-
#define current_text_addr() ({ __label__ _l; _l: &&_l; })
32-
3330
/* task_struct, defined elsewhere, is the "process descriptor" */
3431
struct task_struct;
3532

‎arch/ia64/include/asm/processor.h‎

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

605-
/*
606-
* Get the current instruction/program counter value.
607-
*/
608-
#define current_text_addr() \
609-
({ void *_pc; _pc = (void *)ia64_getreg(_IA64_REG_IP); _pc; })
610-
611605
static inline __u64
612606
ia64_get_ivr (void)
613607
{

‎arch/m68k/include/asm/processor.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
#ifndef __ASM_M68K_PROCESSOR_H
99
#define __ASM_M68K_PROCESSOR_H
1010

11-
/*
12-
* Default implementation of macro that returns current
13-
* instruction pointer ("program counter").
14-
*/
15-
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
16-
1711
#include <linux/thread_info.h>
1812
#include <asm/segment.h>
1913
#include <asm/fpu.h>

0 commit comments

Comments
 (0)