diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-23 08:41:23 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2011-09-21 11:52:04 -0400 |
| commit | 49de830ad7b94d05f6dbfbae97a03f80169a7462 (patch) | |
| tree | 1147ea12f6a7bfd0ba2c12e57fe5c6948f506823 /arch/mips | |
| parent | 20ef5d3a23d5aacb85d0a2808d949e3daf83cd20 (diff) | |
MIPS: Ftrace: Fix the CONFIG_DYNAMIC_FTRACE=n compile
arch/mips/kernel/ftrace.c: In function ‘ftrace_get_parent_ra_addr’:
arch/mips/kernel/ftrace.c:212: error: implicit declaration of function ‘in_kernel_space’
arch/mips/kernel/ftrace.c: In function ‘prepare_ftrace_return’:
arch/mips/kernel/ftrace.c:314: error: ‘MCOUNT_OFFSET_INSNS’ undeclared (first use in this function)
arch/mips/kernel/ftrace.c:314: error: (Each undeclared identifier is reported only once
arch/mips/kernel/ftrace.c:314: error: for each function it appears in.)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2634/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
| -rw-r--r-- | arch/mips/kernel/ftrace.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index feb8021a305f..6a2d758dd8e9 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
| @@ -19,6 +19,26 @@ | |||
| 19 | 19 | ||
| 20 | #include <asm-generic/sections.h> | 20 | #include <asm-generic/sections.h> |
| 21 | 21 | ||
| 22 | #if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT) | ||
| 23 | #define MCOUNT_OFFSET_INSNS 5 | ||
| 24 | #else | ||
| 25 | #define MCOUNT_OFFSET_INSNS 4 | ||
| 26 | #endif | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Check if the address is in kernel space | ||
| 30 | * | ||
| 31 | * Clone core_kernel_text() from kernel/extable.c, but doesn't call | ||
| 32 | * init_kernel_text() for Ftrace doesn't trace functions in init sections. | ||
| 33 | */ | ||
| 34 | static inline int in_kernel_space(unsigned long ip) | ||
| 35 | { | ||
| 36 | if (ip >= (unsigned long)_stext && | ||
| 37 | ip <= (unsigned long)_etext) | ||
| 38 | return 1; | ||
| 39 | return 0; | ||
| 40 | } | ||
| 41 | |||
| 22 | #ifdef CONFIG_DYNAMIC_FTRACE | 42 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 23 | 43 | ||
| 24 | #define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */ | 44 | #define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */ |
| @@ -54,20 +74,6 @@ static inline void ftrace_dyn_arch_init_insns(void) | |||
| 54 | #endif | 74 | #endif |
| 55 | } | 75 | } |
| 56 | 76 | ||
| 57 | /* | ||
| 58 | * Check if the address is in kernel space | ||
| 59 | * | ||
| 60 | * Clone core_kernel_text() from kernel/extable.c, but doesn't call | ||
| 61 | * init_kernel_text() for Ftrace doesn't trace functions in init sections. | ||
| 62 | */ | ||
| 63 | static inline int in_kernel_space(unsigned long ip) | ||
| 64 | { | ||
| 65 | if (ip >= (unsigned long)_stext && | ||
| 66 | ip <= (unsigned long)_etext) | ||
| 67 | return 1; | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | static int ftrace_modify_code(unsigned long ip, unsigned int new_code) | 77 | static int ftrace_modify_code(unsigned long ip, unsigned int new_code) |
| 72 | { | 78 | { |
| 73 | int faulted; | 79 | int faulted; |
| @@ -112,11 +118,6 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code) | |||
| 112 | * 1: offset = 4 instructions | 118 | * 1: offset = 4 instructions |
| 113 | */ | 119 | */ |
| 114 | 120 | ||
| 115 | #if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT) | ||
| 116 | #define MCOUNT_OFFSET_INSNS 5 | ||
| 117 | #else | ||
| 118 | #define MCOUNT_OFFSET_INSNS 4 | ||
| 119 | #endif | ||
| 120 | #define INSN_B_1F (0x10000000 | MCOUNT_OFFSET_INSNS) | 121 | #define INSN_B_1F (0x10000000 | MCOUNT_OFFSET_INSNS) |
| 121 | 122 | ||
| 122 | int ftrace_make_nop(struct module *mod, | 123 | int ftrace_make_nop(struct module *mod, |
