Skip to content

Instantly share code, notes, and snippets.

@dileks
Created April 13, 2011 12:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dileks/917465 to your computer and use it in GitHub Desktop.
Save dileks/917465 to your computer and use it in GitHub Desktop.
ptrace-fix (was in kernel GIT repo, but removed)
From f1bafcca7344c48373b8a2c4efe88ae9cc893eea Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Mon, 11 Apr 2011 23:56:10 +0200
Subject: [PATCH 1/2] x86, clang: Remove asmregparm from
syscall_trace_{enter,leave}()
This patch fixes the following build error:
CC arch/x86/kernel/ptrace.o
arch/x86/kernel/ptrace.c:1350:17: error: function declared with with regparm(3) attribute was previously declared without the regparm attribute
asmregparm long syscall_trace_enter(struct pt_regs *regs)
^
arch/x86/include/asm/ptrace.h:146:13: note: previous declaration is here
extern long syscall_trace_enter(struct pt_regs *);
^
arch/x86/kernel/ptrace.c:1395:17: error: function declared with with regparm(3) attribute was previously declared without the regparm attribute
asmregparm void syscall_trace_leave(struct pt_regs *regs)
^
arch/x86/include/asm/ptrace.h:147:13: note: previous declaration is here
extern void syscall_trace_leave(struct pt_regs *);
^
2 errors generated.
---
arch/x86/kernel/ptrace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 45892dc..8e83bfb 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -1347,7 +1347,7 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,
* We must return the syscall number to actually look up in the table.
* This can be -1L to skip running any syscall at all.
*/
-asmregparm long syscall_trace_enter(struct pt_regs *regs)
+long syscall_trace_enter(struct pt_regs *regs)
{
long ret = 0;
@@ -1392,7 +1392,7 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs)
return ret ?: regs->orig_ax;
}
-asmregparm void syscall_trace_leave(struct pt_regs *regs)
+void syscall_trace_leave(struct pt_regs *regs)
{
bool step;
--
1.7.4.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment