public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] x86: signal: cosmetic unification of including headers
@ 2008-11-22  1:36 Hiroshi Shimamoto
  2008-11-22  1:38 ` [PATCH 2/3] x86: signal: cosmetic unification of sys_sigaltstack() Hiroshi Shimamoto
  2008-11-22  1:38 ` [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn() Hiroshi Shimamoto
  0 siblings, 2 replies; 7+ messages in thread
From: Hiroshi Shimamoto @ 2008-11-22  1:36 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Impact: cleanup

Make including headers same.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |   27 +++++++++++++++------------
 arch/x86/kernel/signal_64.c |    7 ++++++-
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index c2aabeb..0ff8d87 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -4,29 +4,32 @@
  *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
  *  2000-06-20  Pentium III FXSR, SSE support by Gareth Hughes
  */
-#include <linux/list.h>
 
-#include <linux/personality.h>
-#include <linux/binfmts.h>
-#include <linux/suspend.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/smp.h>
 #include <linux/kernel.h>
-#include <linux/ptrace.h>
 #include <linux/signal.h>
-#include <linux/stddef.h>
-#include <linux/unistd.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/wait.h>
+#include <linux/ptrace.h>
 #include <linux/tracehook.h>
-#include <linux/elf.h>
-#include <linux/smp.h>
-#include <linux/mm.h>
+#include <linux/unistd.h>
+#include <linux/stddef.h>
+#include <linux/personality.h>
+#include <linux/uaccess.h>
 
 #include <asm/processor.h>
 #include <asm/ucontext.h>
-#include <asm/uaccess.h>
 #include <asm/i387.h>
 #include <asm/vdso.h>
+
+#ifdef CONFIG_X86_64
+#include <asm/proto.h>
+#include <asm/ia32_unistd.h>
+#include <asm/mce.h>
+#endif /* CONFIG_X86_64 */
+
 #include <asm/syscall.h>
 #include <asm/syscalls.h>
 
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 3d54d36..c52244a 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -19,17 +19,22 @@
 #include <linux/unistd.h>
 #include <linux/stddef.h>
 #include <linux/personality.h>
-#include <linux/compiler.h>
 #include <linux/uaccess.h>
 
 #include <asm/processor.h>
 #include <asm/ucontext.h>
 #include <asm/i387.h>
+#include <asm/vdso.h>
+
+#ifdef CONFIG_X86_64
 #include <asm/proto.h>
 #include <asm/ia32_unistd.h>
 #include <asm/mce.h>
+#endif /* CONFIG_X86_64 */
+
 #include <asm/syscall.h>
 #include <asm/syscalls.h>
+
 #include "sigframe.h"
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] x86: signal: cosmetic unification of sys_sigaltstack()
  2008-11-22  1:36 [PATCH 1/3] x86: signal: cosmetic unification of including headers Hiroshi Shimamoto
@ 2008-11-22  1:38 ` Hiroshi Shimamoto
  2008-11-22  1:38 ` [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn() Hiroshi Shimamoto
  1 sibling, 0 replies; 7+ messages in thread
From: Hiroshi Shimamoto @ 2008-11-22  1:38 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Impact: cleanup

Add #ifdef directive for unification.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |    9 +++++++++
 arch/x86/kernel/signal_64.c |   15 +++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index 0ff8d87..d990988 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -125,6 +125,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
 	return ret;
 }
 
+#ifdef CONFIG_X86_32
 asmlinkage int sys_sigaltstack(unsigned long bx)
 {
 	/*
@@ -137,6 +138,14 @@ asmlinkage int sys_sigaltstack(unsigned long bx)
 
 	return do_sigaltstack(uss, uoss, regs->sp);
 }
+#else /* !CONFIG_X86_32 */
+asmlinkage long
+sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
+		struct pt_regs *regs)
+{
+	return do_sigaltstack(uss, uoss, regs->sp);
+}
+#endif /* CONFIG_X86_32 */
 
 #define COPY(x)			{		\
 	err |= __get_user(regs->x, &sc->x);	\
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index c52244a..b6e4fe0 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -50,12 +50,27 @@
 # define FIX_EFLAGS	__FIX_EFLAGS
 #endif
 
+#ifdef CONFIG_X86_32
+asmlinkage int sys_sigaltstack(unsigned long bx)
+{
+	/*
+	 * This is needed to make gcc realize it doesn't own the
+	 * "struct pt_regs"
+	 */
+	struct pt_regs *regs = (struct pt_regs *)&bx;
+	const stack_t __user *uss = (const stack_t __user *)bx;
+	stack_t __user *uoss = (stack_t __user *)regs->cx;
+
+	return do_sigaltstack(uss, uoss, regs->sp);
+}
+#else /* !CONFIG_X86_32 */
 asmlinkage long
 sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
 		struct pt_regs *regs)
 {
 	return do_sigaltstack(uss, uoss, regs->sp);
 }
+#endif /* CONFIG_X86_32 */
 
 #define COPY(x)			{		\
 	err |= __get_user(regs->x, &sc->x);	\
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn()
  2008-11-22  1:36 [PATCH 1/3] x86: signal: cosmetic unification of including headers Hiroshi Shimamoto
  2008-11-22  1:38 ` [PATCH 2/3] x86: signal: cosmetic unification of sys_sigaltstack() Hiroshi Shimamoto
@ 2008-11-22  1:38 ` Hiroshi Shimamoto
  2008-11-22  1:50   ` H. Peter Anvin
  1 sibling, 1 reply; 7+ messages in thread
From: Hiroshi Shimamoto @ 2008-11-22  1:38 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Impact: cleanup

Add #ifdef directive for unification.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |    7 +++++++
 arch/x86/kernel/signal_64.c |    9 +++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index d990988..f7dd6c4 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -299,12 +299,19 @@ badframe:
 	return 0;
 }
 
+#ifdef CONFIG_X86_32
 asmlinkage int sys_rt_sigreturn(unsigned long __unused)
 {
 	struct pt_regs *regs = (struct pt_regs *)&__unused;
 
 	return do_rt_sigreturn(regs);
 }
+#else /* !CONFIG_X86_32 */
+asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
+{
+	return do_rt_sigreturn(regs);
+}
+#endif /* CONFIG_X86_32 */
 
 /*
  * Set up a signal frame.
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index b6e4fe0..32718f5 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -169,10 +169,19 @@ badframe:
 	return 0;
 }
 
+#ifdef CONFIG_X86_32
+asmlinkage int sys_rt_sigreturn(unsigned long __unused)
+{
+	struct pt_regs *regs = (struct pt_regs *)&__unused;
+
+	return do_rt_sigreturn(regs);
+}
+#else /* !CONFIG_X86_32 */
 asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
 {
 	return do_rt_sigreturn(regs);
 }
+#endif /* CONFIG_X86_32 */
 
 /*
  * Set up a signal frame.
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn()
  2008-11-22  1:38 ` [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn() Hiroshi Shimamoto
@ 2008-11-22  1:50   ` H. Peter Anvin
  2008-11-22  2:08     ` Hiroshi Shimamoto
  0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2008-11-22  1:50 UTC (permalink / raw)
  To: Hiroshi Shimamoto; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel

Hiroshi Shimamoto wrote:
>  
> +#ifdef CONFIG_X86_32
>  asmlinkage int sys_rt_sigreturn(unsigned long __unused)
>  {
>  	struct pt_regs *regs = (struct pt_regs *)&__unused;
>  
>  	return do_rt_sigreturn(regs);
>  }

Why not:

asmlinkage int sys_rt_sigreturn(struct pt_regs regs)
{
	return do_rt_sigreturn(&regs);
}

...?

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn()
  2008-11-22  1:50   ` H. Peter Anvin
@ 2008-11-22  2:08     ` Hiroshi Shimamoto
  2008-11-23  9:51       ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Hiroshi Shimamoto @ 2008-11-22  2:08 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel

H. Peter Anvin wrote:
> Hiroshi Shimamoto wrote:
>>  
>> +#ifdef CONFIG_X86_32
>>  asmlinkage int sys_rt_sigreturn(unsigned long __unused)
>>  {
>>  	struct pt_regs *regs = (struct pt_regs *)&__unused;
>>  
>>  	return do_rt_sigreturn(regs);
>>  }
> 
> Why not:
> 
> asmlinkage int sys_rt_sigreturn(struct pt_regs regs)
> {
> 	return do_rt_sigreturn(&regs);
> }
> 
> ...?

Good question. I didn't realize about that.
Will take a look.

thanks,
Hiroshi Shimamoto

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn()
  2008-11-22  2:08     ` Hiroshi Shimamoto
@ 2008-11-23  9:51       ` Ingo Molnar
  2008-11-24 23:55         ` Hiroshi Shimamoto
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-11-23  9:51 UTC (permalink / raw)
  To: Hiroshi Shimamoto; +Cc: H. Peter Anvin, Thomas Gleixner, linux-kernel


* Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:

> H. Peter Anvin wrote:
> > Hiroshi Shimamoto wrote:
> >>  
> >> +#ifdef CONFIG_X86_32
> >>  asmlinkage int sys_rt_sigreturn(unsigned long __unused)
> >>  {
> >>  	struct pt_regs *regs = (struct pt_regs *)&__unused;
> >>  
> >>  	return do_rt_sigreturn(regs);
> >>  }
> > 
> > Why not:
> > 
> > asmlinkage int sys_rt_sigreturn(struct pt_regs regs)
> > {
> > 	return do_rt_sigreturn(&regs);
> > }
> > 
> > ...?
> 
> Good question. I didn't realize about that.
> Will take a look.

I've applied your 3 patches to tip/x86/signal - please send a patch on 
top of your current lineup, for the detail Peter pointed out.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn()
  2008-11-23  9:51       ` Ingo Molnar
@ 2008-11-24 23:55         ` Hiroshi Shimamoto
  0 siblings, 0 replies; 7+ messages in thread
From: Hiroshi Shimamoto @ 2008-11-24 23:55 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: H. Peter Anvin, Thomas Gleixner, linux-kernel

Ingo Molnar wrote:
> * Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:
> 
>> H. Peter Anvin wrote:
>>> Hiroshi Shimamoto wrote:
>>>>  
>>>> +#ifdef CONFIG_X86_32
>>>>  asmlinkage int sys_rt_sigreturn(unsigned long __unused)
>>>>  {
>>>>  	struct pt_regs *regs = (struct pt_regs *)&__unused;
>>>>  
>>>>  	return do_rt_sigreturn(regs);
>>>>  }
>>> Why not:
>>>
>>> asmlinkage int sys_rt_sigreturn(struct pt_regs regs)
>>> {
>>> 	return do_rt_sigreturn(&regs);
>>> }
>>>
>>> ...?
>> Good question. I didn't realize about that.
>> Will take a look.
> 
> I've applied your 3 patches to tip/x86/signal - please send a patch on 
> top of your current lineup, for the detail Peter pointed out.

OK, will do.
I think it's better to send a patch after unifying signal_{32|64}.c.

thanks,
Hiroshi Shimamoto

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-11-24 23:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-22  1:36 [PATCH 1/3] x86: signal: cosmetic unification of including headers Hiroshi Shimamoto
2008-11-22  1:38 ` [PATCH 2/3] x86: signal: cosmetic unification of sys_sigaltstack() Hiroshi Shimamoto
2008-11-22  1:38 ` [PATCH 3/3] x86: signal: cosmetic unification of sys_rt_sigreturn() Hiroshi Shimamoto
2008-11-22  1:50   ` H. Peter Anvin
2008-11-22  2:08     ` Hiroshi Shimamoto
2008-11-23  9:51       ` Ingo Molnar
2008-11-24 23:55         ` Hiroshi Shimamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox