diff options
Diffstat (limited to 'arch/x86/kernel/unwind_frame.c')
-rw-r--r-- | arch/x86/kernel/unwind_frame.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/unwind_frame.c b/arch/x86/kernel/unwind_frame.c index d05637726c10..4949bbc95f75 100644 --- a/arch/x86/kernel/unwind_frame.c +++ b/arch/x86/kernel/unwind_frame.c | |||
@@ -174,6 +174,7 @@ static bool is_last_task_frame(struct unwind_state *state) | |||
174 | * This determines if the frame pointer actually contains an encoded pointer to | 174 | * This determines if the frame pointer actually contains an encoded pointer to |
175 | * pt_regs on the stack. See ENCODE_FRAME_POINTER. | 175 | * pt_regs on the stack. See ENCODE_FRAME_POINTER. |
176 | */ | 176 | */ |
177 | #ifdef CONFIG_X86_64 | ||
177 | static struct pt_regs *decode_frame_pointer(unsigned long *bp) | 178 | static struct pt_regs *decode_frame_pointer(unsigned long *bp) |
178 | { | 179 | { |
179 | unsigned long regs = (unsigned long)bp; | 180 | unsigned long regs = (unsigned long)bp; |
@@ -183,6 +184,17 @@ static struct pt_regs *decode_frame_pointer(unsigned long *bp) | |||
183 | 184 | ||
184 | return (struct pt_regs *)(regs & ~0x1); | 185 | return (struct pt_regs *)(regs & ~0x1); |
185 | } | 186 | } |
187 | #else | ||
188 | static struct pt_regs *decode_frame_pointer(unsigned long *bp) | ||
189 | { | ||
190 | unsigned long regs = (unsigned long)bp; | ||
191 | |||
192 | if (regs & 0x80000000) | ||
193 | return NULL; | ||
194 | |||
195 | return (struct pt_regs *)(regs | 0x80000000); | ||
196 | } | ||
197 | #endif | ||
186 | 198 | ||
187 | #ifdef CONFIG_X86_32 | 199 | #ifdef CONFIG_X86_32 |
188 | #define KERNEL_REGS_SIZE (sizeof(struct pt_regs) - 2*sizeof(long)) | 200 | #define KERNEL_REGS_SIZE (sizeof(struct pt_regs) - 2*sizeof(long)) |