* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
@ 2004-12-09 5:01 ` David S. Miller
2004-12-09 5:25 ` David S. Miller
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: David S. Miller @ 2004-12-09 5:01 UTC (permalink / raw)
To: sparclinux
On Wed, 08 Dec 2004 02:53:23 -0800
Jeremy Huddleston <eradicator@gentoo.org> wrote:
> On Fri, 2004-12-03 at 17:34 -0800, Jeremy Huddleston wrote:
> > asm-sparc/signal.h needs:
> >
> > #include <linux/compiler>
> >
> > because it uses __user around line 214. Without this include, userland
> > code including asm/signal.h will fail to compile.
>
> I've updated the patch to fix a few more problems with redefined
> structs, etc when using they are included after glibc headers.
Please use __KERNEL__ instead of things like _SIGNAL_H
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
2004-12-09 5:01 ` David S. Miller
@ 2004-12-09 5:25 ` David S. Miller
2004-12-09 5:25 ` Jeremy Huddleston
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: David S. Miller @ 2004-12-09 5:25 UTC (permalink / raw)
To: sparclinux
On Wed, 08 Dec 2004 21:25:51 -0800
Jeremy Huddleston <eradicator@gentoo.org> wrote:
> On Wed, 2004-12-08 at 21:01 -0800, David S. Miller wrote:
> > Please use __KERNEL__ instead of things like _SIGNAL_H
> > Thanks.
>
> Ok, I'll keep that in mind for next time. I was just copying the same
> behavior from asm-x86_64. Do you want me to update/resend the patch?
Please do, I'd like to apply your patch and have this fixed. :-)
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
2004-12-09 5:01 ` David S. Miller
2004-12-09 5:25 ` David S. Miller
@ 2004-12-09 5:25 ` Jeremy Huddleston
2004-12-09 6:00 ` Jeremy Huddleston
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeremy Huddleston @ 2004-12-09 5:25 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
On Wed, 2004-12-08 at 21:01 -0800, David S. Miller wrote:
> Please use __KERNEL__ instead of things like _SIGNAL_H
> Thanks.
Ok, I'll keep that in mind for next time. I was just copying the same
behavior from asm-x86_64. Do you want me to update/resend the patch?
--
Jeremy Huddleston <eradicator@gentoo.org>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (2 preceding siblings ...)
2004-12-09 5:25 ` Jeremy Huddleston
@ 2004-12-09 6:00 ` Jeremy Huddleston
2004-12-09 7:46 ` David S. Miller
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeremy Huddleston @ 2004-12-09 6:00 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1.1: Type: text/plain, Size: 570 bytes --]
On Wed, 2004-12-08 at 21:25 -0800, David S. Miller wrote:
> > Ok, I'll keep that in mind for next time. I was just copying the same
> > behavior from asm-x86_64. Do you want me to update/resend the patch?
>
> Please do, I'd like to apply your patch and have this fixed. :-)
Ok, here's the updated one. It's much cleaner now, and I also did NOT
do asm-x86_64's '#include <signal.h>' if we're !__KERNEL__. I found
that to be a rather ugly kludge. It's the userland code that should
change there, not us.
--
Jeremy Huddleston <eradicator@gentoo.org>
[-- Attachment #1.2: sparcheaders.patch --]
[-- Type: text/x-patch, Size: 2733 bytes --]
diff -Naur linux-2.6.8.1-vanilla/include/asm-sparc/processor.h linux-2.6.8.1.fixsparc/include/asm-sparc/processor.h
--- linux-2.6.8.1-vanilla/include/asm-sparc/processor.h 2004-08-14 03:56:23.000000000 -0700
+++ linux-2.6.8.1.fixsparc/include/asm-sparc/processor.h 2004-12-08 21:51:38.539378457 -0800
@@ -43,10 +43,12 @@
struct task_struct;
+#ifdef __KERNEL__
struct fpq {
unsigned long *insn_addr;
unsigned long insn;
};
+#endif
typedef struct {
int seg;
diff -Naur linux-2.6.8.1-vanilla/include/asm-sparc/sigcontext.h linux-2.6.8.1.fixsparc/include/asm-sparc/sigcontext.h
--- linux-2.6.8.1-vanilla/include/asm-sparc/sigcontext.h 2004-08-14 03:54:52.000000000 -0700
+++ linux-2.6.8.1.fixsparc/include/asm-sparc/sigcontext.h 2004-12-08 21:56:46.419515413 -0800
@@ -4,7 +4,6 @@
#ifdef __KERNEL__
#include <asm/ptrace.h>
-#endif
#ifndef __ASSEMBLY__
@@ -57,8 +56,6 @@
} si_fpqueue [16];
} __siginfo_fpu_t;
-#ifdef __KERNEL__
-
/* This magic should be in g_upper[0] for all upper parts
to be valid.
This is generated by sparc64 only, but for 32bit processes,
@@ -69,8 +66,9 @@
unsigned int o_upper[8];
} siginfo_extra_v8plus_t;
-#endif
-
#endif /* !(__ASSEMBLY__) */
+#endif /* (__KERNEL__) */
+
#endif /* !(__SPARC_SIGCONTEXT_H) */
+
diff -Naur linux-2.6.8.1-vanilla/include/asm-sparc/signal.h linux-2.6.8.1.fixsparc/include/asm-sparc/signal.h
--- linux-2.6.8.1-vanilla/include/asm-sparc/signal.h 2004-08-14 03:55:34.000000000 -0700
+++ linux-2.6.8.1.fixsparc/include/asm-sparc/signal.h 2004-12-08 21:49:19.124410374 -0800
@@ -3,6 +3,7 @@
#define _ASMSPARC_SIGNAL_H
#include <asm/sigcontext.h>
+#include <linux/compiler.h>
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
@@ -111,11 +112,14 @@
unsigned long sig[_NSIG_WORDS];
} __new_sigset_t;
+
+#ifdef __KERNEL__
/* A SunOS sigstack */
struct sigstack {
char *the_stack;
int cur_status;
};
+#endif
/* Sigvec flags */
#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
@@ -189,6 +193,7 @@
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+#ifdef __KERNEL__
struct __new_sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
@@ -196,12 +201,10 @@
__new_sigset_t sa_mask;
};
-#ifdef __KERNEL__
struct k_sigaction {
struct __new_sigaction sa;
void __user *ka_restorer;
};
-#endif
struct __old_sigaction {
__sighandler_t sa_handler;
@@ -216,7 +219,6 @@
size_t ss_size;
} stack_t;
-#ifdef __KERNEL__
struct sparc_deliver_cookie {
int restart_syscall;
unsigned long orig_i0;
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (3 preceding siblings ...)
2004-12-09 6:00 ` Jeremy Huddleston
@ 2004-12-09 7:46 ` David S. Miller
2004-12-12 0:06 ` Jeremy Huddleston
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: David S. Miller @ 2004-12-09 7:46 UTC (permalink / raw)
To: sparclinux
On Wed, 08 Dec 2004 22:00:42 -0800
Jeremy Huddleston <eradicator@gentoo.org> wrote:
> On Wed, 2004-12-08 at 21:25 -0800, David S. Miller wrote:
> > > Ok, I'll keep that in mind for next time. I was just copying the same
> > > behavior from asm-x86_64. Do you want me to update/resend the patch?
> >
> > Please do, I'd like to apply your patch and have this fixed. :-)
>
> Ok, here's the updated one. It's much cleaner now, and I also did NOT
> do asm-x86_64's '#include <signal.h>' if we're !__KERNEL__. I found
> that to be a rather ugly kludge. It's the userland code that should
> change there, not us.
Applied, thanks Jeremy.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (4 preceding siblings ...)
2004-12-09 7:46 ` David S. Miller
@ 2004-12-12 0:06 ` Jeremy Huddleston
2004-12-28 2:38 ` David S. Miller
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeremy Huddleston @ 2004-12-12 0:06 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1.1: Type: text/plain, Size: 468 bytes --]
> > Ok, here's the updated one. It's much cleaner now, and I also did NOT
> > do asm-x86_64's '#include <signal.h>' if we're !__KERNEL__. I found
> > that to be a rather ugly kludge. It's the userland code that should
> > change there, not us.
>
> Applied, thanks Jeremy.
In changing from the glibc check to __KERNEL__, processor.h doesn't work
for some userland code. Here's an update to correct this.
--
Jeremy Huddleston <eradicator@gentoo.org>
[-- Attachment #1.2: sparchead.patch --]
[-- Type: text/x-patch, Size: 933 bytes --]
--- include/asm-sparc/processor.h.orig 2004-12-11 15:49:24.522603912 -0800
+++ include/asm-sparc/processor.h 2004-12-11 15:49:18.865463928 -0800
@@ -44,11 +44,13 @@
struct task_struct;
#ifdef __KERNEL__
-struct fpq {
+#define __fpq fpq
+#endif
+
+struct __fpq {
unsigned long *insn_addr;
unsigned long insn;
};
-#endif
typedef struct {
int seg;
@@ -67,13 +69,17 @@ struct thread_struct {
unsigned long float_regs[32] __attribute__ ((aligned (8)));
unsigned long fsr;
unsigned long fpqdepth;
- struct fpq fpqueue[16];
+ struct __fpq fpqueue[16];
unsigned long flags;
mm_segment_t current_ds;
struct exec core_exec; /* just what it says. */
int new_signal;
};
+#ifdef __KERNEL__
+#undef __fpq
+#endif
+
#define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */
#define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (5 preceding siblings ...)
2004-12-12 0:06 ` Jeremy Huddleston
@ 2004-12-28 2:38 ` David S. Miller
2004-12-28 3:06 ` [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to behave nicely in userland William Lee Irwin III
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: David S. Miller @ 2004-12-28 2:38 UTC (permalink / raw)
To: sparclinux
On Sat, 11 Dec 2004 16:06:39 -0800
Jeremy Huddleston <eradicator@gentoo.org> wrote:
> > > Ok, here's the updated one. It's much cleaner now, and I also did NOT
> > > do asm-x86_64's '#include <signal.h>' if we're !__KERNEL__. I found
> > > that to be a rather ugly kludge. It's the userland code that should
> > > change there, not us.
> >
> > Applied, thanks Jeremy.
>
> In changing from the glibc check to __KERNEL__, processor.h doesn't work
> for some userland code. Here's an update to correct this.
I don't think this is too pleasant.
Actually, I can't see much of anything that userland needs to get
at inside of processor.h, so why don't you just __KERNEL__ ifdef
out nearly the entire file?
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to behave nicely in userland
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (6 preceding siblings ...)
2004-12-28 2:38 ` David S. Miller
@ 2004-12-28 3:06 ` William Lee Irwin III
2004-12-28 3:27 ` [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to David S. Miller
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: William Lee Irwin III @ 2004-12-28 3:06 UTC (permalink / raw)
To: sparclinux
On Sat, 11 Dec 2004 16:06:39 -0800 Jeremy Huddleston <eradicator@gentoo.org> wrote:
>> In changing from the glibc check to __KERNEL__, processor.h doesn't work
>> for some userland code. Here's an update to correct this.
On Mon, Dec 27, 2004 at 06:38:52PM -0800, David S. Miller wrote:
> I don't think this is too pleasant.
> Actually, I can't see much of anything that userland needs to get
> at inside of processor.h, so why don't you just __KERNEL__ ifdef
> out nearly the entire file?
I'm vaguely disinclined to take fixes for userspace inclusion of
kernel headers unless, say, other arches are taking such steps and
we would only penalize ourselves by not doing so.
By and large I'd prefer to discourage userspace code from using
kernel headers. Does this work in a significant number of other
arches as things stand now?
-- wli
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (7 preceding siblings ...)
2004-12-28 3:06 ` [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to behave nicely in userland William Lee Irwin III
@ 2004-12-28 3:27 ` David S. Miller
2004-12-28 3:33 ` Jeremy Huddleston
2004-12-28 6:16 ` [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to behave nicely in userland William Lee Irwin III
10 siblings, 0 replies; 12+ messages in thread
From: David S. Miller @ 2004-12-28 3:27 UTC (permalink / raw)
To: sparclinux
On Mon, 27 Dec 2004 19:06:57 -0800
William Lee Irwin III <wli@holomorphy.com> wrote:
> By and large I'd prefer to discourage userspace code from using
> kernel headers. Does this work in a significant number of other
> arches as things stand now?
Glibc includes them. It works for sparc64 and a lot of this
is painless stuff to include.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (8 preceding siblings ...)
2004-12-28 3:27 ` [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to David S. Miller
@ 2004-12-28 3:33 ` Jeremy Huddleston
2004-12-28 6:16 ` [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to behave nicely in userland William Lee Irwin III
10 siblings, 0 replies; 12+ messages in thread
From: Jeremy Huddleston @ 2004-12-28 3:33 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
On Mon, 2004-12-27 at 19:27 -0800, David S. Miller wrote:
> On Mon, 27 Dec 2004 19:06:57 -0800
> William Lee Irwin III <wli@holomorphy.com> wrote:
>
> > By and large I'd prefer to discourage userspace code from using
> > kernel headers. Does this work in a significant number of other
> > arches as things stand now?
>
> Glibc includes them. It works for sparc64 and a lot of this
> is painless stuff to include.
Yeah, that patch was specifically for glibc. Some other things include
them as well... samba comes to mind. I agree that it's good to
discourage userland code from using the kernel headers, but in some
cases, it's unavoidable.
--
Jeremy Huddleston <eradicator@gentoo.org>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to behave nicely in userland
2004-12-08 10:53 [PATCH] updated asm-sparc/{processor,signal,sigcontext}.h to Jeremy Huddleston
` (9 preceding siblings ...)
2004-12-28 3:33 ` Jeremy Huddleston
@ 2004-12-28 6:16 ` William Lee Irwin III
10 siblings, 0 replies; 12+ messages in thread
From: William Lee Irwin III @ 2004-12-28 6:16 UTC (permalink / raw)
To: sparclinux
On Mon, 27 Dec 2004 19:06:57 -0800 William Lee Irwin III <wli@holomorphy.com> wrote:
>> By and large I'd prefer to discourage userspace code from using
>> kernel headers. Does this work in a significant number of other
>> arches as things stand now?
On Mon, Dec 27, 2004 at 07:27:47PM -0800, David S. Miller wrote:
> Glibc includes them. It works for sparc64 and a lot of this
> is painless stuff to include.
As long as I'm not the first to coddle glibc, I guess I can live with it.
-- wli
^ permalink raw reply [flat|nested] 12+ messages in thread