diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2012-09-05 10:31:00 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-09-13 22:52:09 -0400 |
commit | a5e37863ab31d78faddff15675c89979792bc0bd (patch) | |
tree | 419d5be632de58394bf726b59fe3475f06c3502d /arch | |
parent | ea632e9f12033346cc68247faa3b924d54936b8b (diff) |
ftrace/x86: Adjust x86 regs.ip as like as x86-64
Adjust x86 regs.ip to ip + MCOUNT_INSN_SIZE as like as
on x86-64. This helps us to consolidate codes which use
regs->ip on both of x86/x86-64.
Link: http://lkml.kernel.org/r/20120905143100.10329.60109.stgit@localhost.localdomain
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/entry_32.S | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 061ac17ee974..f438a44bf8f9 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1148,7 +1148,6 @@ ENTRY(ftrace_regs_caller) | |||
1148 | * ip location, and move flags into the return ip location. | 1148 | * ip location, and move flags into the return ip location. |
1149 | */ | 1149 | */ |
1150 | pushl 4(%esp) /* save return ip into ip slot */ | 1150 | pushl 4(%esp) /* save return ip into ip slot */ |
1151 | subl $MCOUNT_INSN_SIZE, (%esp) /* Adjust ip */ | ||
1152 | 1151 | ||
1153 | pushl $0 /* Load 0 into orig_ax */ | 1152 | pushl $0 /* Load 0 into orig_ax */ |
1154 | pushl %gs | 1153 | pushl %gs |
@@ -1169,6 +1168,7 @@ ENTRY(ftrace_regs_caller) | |||
1169 | movl $__KERNEL_CS,13*4(%esp) | 1168 | movl $__KERNEL_CS,13*4(%esp) |
1170 | 1169 | ||
1171 | movl 12*4(%esp), %eax /* Load ip (1st parameter) */ | 1170 | movl 12*4(%esp), %eax /* Load ip (1st parameter) */ |
1171 | subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */ | ||
1172 | movl 0x4(%ebp), %edx /* Load parent ip (2nd parameter) */ | 1172 | movl 0x4(%ebp), %edx /* Load parent ip (2nd parameter) */ |
1173 | leal function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */ | 1173 | leal function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */ |
1174 | pushl %esp /* Save pt_regs as 4th parameter */ | 1174 | pushl %esp /* Save pt_regs as 4th parameter */ |
@@ -1180,7 +1180,6 @@ GLOBAL(ftrace_regs_call) | |||
1180 | movl 14*4(%esp), %eax /* Move flags back into cs */ | 1180 | movl 14*4(%esp), %eax /* Move flags back into cs */ |
1181 | movl %eax, 13*4(%esp) /* Needed to keep addl from modifying flags */ | 1181 | movl %eax, 13*4(%esp) /* Needed to keep addl from modifying flags */ |
1182 | movl 12*4(%esp), %eax /* Get return ip from regs->ip */ | 1182 | movl 12*4(%esp), %eax /* Get return ip from regs->ip */ |
1183 | addl $MCOUNT_INSN_SIZE, %eax | ||
1184 | movl %eax, 14*4(%esp) /* Put return ip back for ret */ | 1183 | movl %eax, 14*4(%esp) /* Put return ip back for ret */ |
1185 | 1184 | ||
1186 | popl %ebx | 1185 | popl %ebx |