All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Jeff Dike <jdike@addtoit.com>, lkml <linux-kernel@vger.kernel.org>
Cc: uml-devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: [uml-devel] [PATCH] x86, um: fix EXECUTE_SYSCALL macros
Date: Thu, 22 Jan 2009 16:29:06 +0100	[thread overview]
Message-ID: <497890C2.1040206@gmail.com> (raw)
In-Reply-To: <49773C2E.9090608@gmail.com>

Roel Kluin wrote:
> When these macros aren't called with regs, e.g. with foo
> this will incorectly expand to foo->foo.gp[*]
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> My other patch should probably as well have been sent to this list:
> http://lkml.org/lkml/2009/1/21/203
> 
there were more

Fix EXECUTE_SYSCALL macros. When called with a variable named other
than regs as second argument, this will result in a build failure.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/um/sys-i386/shared/sysdep/syscalls.h b/arch/um/sys-i386/shared/sysdep/syscalls.h
index 9056981..1cab192 100644
--- a/arch/um/sys-i386/shared/sysdep/syscalls.h
+++ b/arch/um/sys-i386/shared/sysdep/syscalls.h
@@ -17,9 +17,9 @@ extern syscall_handler_t old_mmap_i386;
 
 extern syscall_handler_t *sys_call_table[];
 
-#define EXECUTE_SYSCALL(syscall, regs) \
+#define EXECUTE_SYSCALL(syscall, _regs) \
 	((long (*)(struct syscall_args)) \
-	 (*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
+	 (*sys_call_table[syscall]))(SYSCALL_ARGS(&_regs->regs))
 
 extern long sys_mmap2(unsigned long addr, unsigned long len,
 		      unsigned long prot, unsigned long flags,
diff --git a/arch/um/sys-x86_64/shared/sysdep/syscalls.h b/arch/um/sys-x86_64/shared/sysdep/syscalls.h
index 7cfb0b0..a5be219 100644
--- a/arch/um/sys-x86_64/shared/sysdep/syscalls.h
+++ b/arch/um/sys-x86_64/shared/sysdep/syscalls.h
@@ -15,14 +15,14 @@ typedef long syscall_handler_t(void);
 
 extern syscall_handler_t *sys_call_table[];
 
-#define EXECUTE_SYSCALL(syscall, regs) \
+#define EXECUTE_SYSCALL(syscall, _regs) \
 	(((long (*)(long, long, long, long, long, long)) \
-	  (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \
-		 		      UPT_SYSCALL_ARG2(&regs->regs), \
-				      UPT_SYSCALL_ARG3(&regs->regs), \
-				      UPT_SYSCALL_ARG4(&regs->regs), \
-				      UPT_SYSCALL_ARG5(&regs->regs), \
-				      UPT_SYSCALL_ARG6(&regs->regs)))
+	  (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&_regs->regs), \
+		 		      UPT_SYSCALL_ARG2(&_regs->regs), \
+				      UPT_SYSCALL_ARG3(&_regs->regs), \
+				      UPT_SYSCALL_ARG4(&_regs->regs), \
+				      UPT_SYSCALL_ARG5(&_regs->regs), \
+				      UPT_SYSCALL_ARG6(&_regs->regs)))
 
 extern long old_mmap(unsigned long addr, unsigned long len,
 		     unsigned long prot, unsigned long flags,


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

WARNING: multiple messages have this Message-ID (diff)
From: Roel Kluin <roel.kluin@gmail.com>
To: Jeff Dike <jdike@addtoit.com>, lkml <linux-kernel@vger.kernel.org>
Cc: uml-devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: [PATCH] x86, um: fix EXECUTE_SYSCALL macros
Date: Thu, 22 Jan 2009 16:29:06 +0100	[thread overview]
Message-ID: <497890C2.1040206@gmail.com> (raw)
In-Reply-To: <49773C2E.9090608@gmail.com>

Roel Kluin wrote:
> When these macros aren't called with regs, e.g. with foo
> this will incorectly expand to foo->foo.gp[*]
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> My other patch should probably as well have been sent to this list:
> http://lkml.org/lkml/2009/1/21/203
> 
there were more

Fix EXECUTE_SYSCALL macros. When called with a variable named other
than regs as second argument, this will result in a build failure.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/um/sys-i386/shared/sysdep/syscalls.h b/arch/um/sys-i386/shared/sysdep/syscalls.h
index 9056981..1cab192 100644
--- a/arch/um/sys-i386/shared/sysdep/syscalls.h
+++ b/arch/um/sys-i386/shared/sysdep/syscalls.h
@@ -17,9 +17,9 @@ extern syscall_handler_t old_mmap_i386;
 
 extern syscall_handler_t *sys_call_table[];
 
-#define EXECUTE_SYSCALL(syscall, regs) \
+#define EXECUTE_SYSCALL(syscall, _regs) \
 	((long (*)(struct syscall_args)) \
-	 (*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
+	 (*sys_call_table[syscall]))(SYSCALL_ARGS(&_regs->regs))
 
 extern long sys_mmap2(unsigned long addr, unsigned long len,
 		      unsigned long prot, unsigned long flags,
diff --git a/arch/um/sys-x86_64/shared/sysdep/syscalls.h b/arch/um/sys-x86_64/shared/sysdep/syscalls.h
index 7cfb0b0..a5be219 100644
--- a/arch/um/sys-x86_64/shared/sysdep/syscalls.h
+++ b/arch/um/sys-x86_64/shared/sysdep/syscalls.h
@@ -15,14 +15,14 @@ typedef long syscall_handler_t(void);
 
 extern syscall_handler_t *sys_call_table[];
 
-#define EXECUTE_SYSCALL(syscall, regs) \
+#define EXECUTE_SYSCALL(syscall, _regs) \
 	(((long (*)(long, long, long, long, long, long)) \
-	  (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \
-		 		      UPT_SYSCALL_ARG2(&regs->regs), \
-				      UPT_SYSCALL_ARG3(&regs->regs), \
-				      UPT_SYSCALL_ARG4(&regs->regs), \
-				      UPT_SYSCALL_ARG5(&regs->regs), \
-				      UPT_SYSCALL_ARG6(&regs->regs)))
+	  (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&_regs->regs), \
+		 		      UPT_SYSCALL_ARG2(&_regs->regs), \
+				      UPT_SYSCALL_ARG3(&_regs->regs), \
+				      UPT_SYSCALL_ARG4(&_regs->regs), \
+				      UPT_SYSCALL_ARG5(&_regs->regs), \
+				      UPT_SYSCALL_ARG6(&_regs->regs)))
 
 extern long old_mmap(unsigned long addr, unsigned long len,
 		     unsigned long prot, unsigned long flags,


  reply	other threads:[~2009-01-22 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 15:15 [uml-devel] [PATCH] x86, um: fix GETREG/PUTREG macros Roel Kluin
2009-01-21 15:15 ` Roel Kluin
2009-01-22 15:29 ` Roel Kluin [this message]
2009-01-22 15:29   ` [PATCH] x86, um: fix EXECUTE_SYSCALL macros Roel Kluin
2009-01-22 16:05   ` [uml-devel] " Américo Wang
2009-01-22 16:05     ` Américo Wang
2009-01-22 16:04 ` [uml-devel] [PATCH] x86, um: fix GETREG/PUTREG macros Américo Wang
2009-01-22 16:04   ` Américo Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=497890C2.1040206@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.