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 GETREG/PUTREG macros
Date: Wed, 21 Jan 2009 16:15:58 +0100 [thread overview]
Message-ID: <49773C2E.9090608@gmail.com> (raw)
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
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 1a899a7..31d0e9c 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -49,8 +49,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
struct user_i387_struct fp;
int err = 0;
-#define GETREG(regs, regno, sc, regname) \
- __get_user((regs)->regs.gp[(regno) / sizeof(unsigned long)], \
+#define GETREG(_regs, regno, sc, regname) \
+ __get_user((_regs)->regs.gp[(regno) / sizeof(unsigned long)], \
&(sc)->regname)
err |= GETREG(regs, R8, from, r8);
@@ -104,8 +104,8 @@ static int copy_sc_to_user(struct sigcontext __user *to,
err |= __put_user(0, &to->gs);
err |= __put_user(0, &to->fs);
-#define PUTREG(regs, regno, sc, regname) \
- __put_user((regs)->regs.gp[(regno) / sizeof(unsigned long)], \
+#define PUTREG(_regs, regno, sc, regname) \
+ __put_user((_regs)->regs.gp[(regno) / sizeof(unsigned long)], \
&(sc)->regname)
err |= PUTREG(regs, RDI, to, di);
------------------------------------------------------------------------------
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 GETREG/PUTREG macros
Date: Wed, 21 Jan 2009 16:15:58 +0100 [thread overview]
Message-ID: <49773C2E.9090608@gmail.com> (raw)
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
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 1a899a7..31d0e9c 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -49,8 +49,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
struct user_i387_struct fp;
int err = 0;
-#define GETREG(regs, regno, sc, regname) \
- __get_user((regs)->regs.gp[(regno) / sizeof(unsigned long)], \
+#define GETREG(_regs, regno, sc, regname) \
+ __get_user((_regs)->regs.gp[(regno) / sizeof(unsigned long)], \
&(sc)->regname)
err |= GETREG(regs, R8, from, r8);
@@ -104,8 +104,8 @@ static int copy_sc_to_user(struct sigcontext __user *to,
err |= __put_user(0, &to->gs);
err |= __put_user(0, &to->fs);
-#define PUTREG(regs, regno, sc, regname) \
- __put_user((regs)->regs.gp[(regno) / sizeof(unsigned long)], \
+#define PUTREG(_regs, regno, sc, regname) \
+ __put_user((_regs)->regs.gp[(regno) / sizeof(unsigned long)], \
&(sc)->regname)
err |= PUTREG(regs, RDI, to, di);
next reply other threads:[~2009-01-21 15:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 15:15 Roel Kluin [this message]
2009-01-21 15:15 ` [PATCH] x86, um: fix GETREG/PUTREG macros Roel Kluin
2009-01-22 15:29 ` [uml-devel] [PATCH] x86, um: fix EXECUTE_SYSCALL macros Roel Kluin
2009-01-22 15:29 ` 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=49773C2E.9090608@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.