* [PATCH] x86, um: fix GETREG/PUTREG macros
@ 2009-01-21 15:15 Roel Kluin
2009-01-22 15:29 ` [PATCH] x86, um: fix EXECUTE_SYSCALL macros Roel Kluin
2009-01-22 16:04 ` [PATCH] x86, um: fix GETREG/PUTREG macros Américo Wang
0 siblings, 2 replies; 4+ messages in thread
From: Roel Kluin @ 2009-01-21 15:15 UTC (permalink / raw)
To: Jeff Dike, lkml; +Cc: uml-devel
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] x86, um: fix EXECUTE_SYSCALL macros
2009-01-21 15:15 [PATCH] x86, um: fix GETREG/PUTREG macros Roel Kluin
@ 2009-01-22 15:29 ` Roel Kluin
2009-01-22 16:05 ` Américo Wang
2009-01-22 16:04 ` [PATCH] x86, um: fix GETREG/PUTREG macros Américo Wang
1 sibling, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-01-22 15:29 UTC (permalink / raw)
To: Jeff Dike, lkml; +Cc: uml-devel
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(®s->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(®s->regs), \
- UPT_SYSCALL_ARG2(®s->regs), \
- UPT_SYSCALL_ARG3(®s->regs), \
- UPT_SYSCALL_ARG4(®s->regs), \
- UPT_SYSCALL_ARG5(®s->regs), \
- UPT_SYSCALL_ARG6(®s->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,
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86, um: fix GETREG/PUTREG macros
2009-01-21 15:15 [PATCH] x86, um: fix GETREG/PUTREG macros Roel Kluin
2009-01-22 15:29 ` [PATCH] x86, um: fix EXECUTE_SYSCALL macros Roel Kluin
@ 2009-01-22 16:04 ` Américo Wang
1 sibling, 0 replies; 4+ messages in thread
From: Américo Wang @ 2009-01-22 16:04 UTC (permalink / raw)
To: Roel Kluin; +Cc: Jeff Dike, lkml, uml-devel
On Wed, Jan 21, 2009 at 04:15:58PM +0100, 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>
Good catch!
Reviewed-by: WANG Cong <wangcong@zeuux.org>
--
"Against stupidity, the gods themselves, contend in vain."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86, um: fix EXECUTE_SYSCALL macros
2009-01-22 15:29 ` [PATCH] x86, um: fix EXECUTE_SYSCALL macros Roel Kluin
@ 2009-01-22 16:05 ` Américo Wang
0 siblings, 0 replies; 4+ messages in thread
From: Américo Wang @ 2009-01-22 16:05 UTC (permalink / raw)
To: Roel Kluin; +Cc: Jeff Dike, lkml, uml-devel
On Thu, Jan 22, 2009 at 04:29:06PM +0100, Roel Kluin wrote:
>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>
Reviewed-by: WANG Cong <wangcong@zeuux.org>
--
"Against stupidity, the gods themselves, contend in vain."
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-22 16:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 15:15 [PATCH] x86, um: fix GETREG/PUTREG macros Roel Kluin
2009-01-22 15:29 ` [PATCH] x86, um: fix EXECUTE_SYSCALL macros Roel Kluin
2009-01-22 16:05 ` Américo Wang
2009-01-22 16:04 ` [PATCH] x86, um: fix GETREG/PUTREG macros Américo Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox