All of lore.kernel.org
 help / color / mirror / Atom feed
* sigset_t32 broken?
@ 2003-01-23  7:17 Andrew Clausen
  2003-01-23  9:59 ` Vivien Chappelier
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Clausen @ 2003-01-23  7:17 UTC (permalink / raw)
  To: linux-mips

Hi all,

Cut&paste from linux/asm/mips64/signal.h:

#define _NSIG           128
#define _NSIG_BPW       64
#define _NSIG_WORDS     (_NSIG / _NSIG_BPW)

typedef struct {
        long sig[_NSIG_WORDS];
} sigset_t;

#define _NSIG32         128
#define _NSIG_BPW32     32
#define _NSIG_WORDS32   (_NSIG32 / _NSIG_BPW32)

typedef struct {
        long sig[_NSIG_WORDS32];
} sigset_t32;



Shouldn't those two long's be replaced with u64 and u32
respectively?  Is the second struct really meant to be twice the
size the first?

Cheers,
Andrew

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

* Re: sigset_t32 broken?
  2003-01-23  7:17 sigset_t32 broken? Andrew Clausen
@ 2003-01-23  9:59 ` Vivien Chappelier
  2003-01-24  1:48   ` Ralf Baechle
  0 siblings, 1 reply; 6+ messages in thread
From: Vivien Chappelier @ 2003-01-23  9:59 UTC (permalink / raw)
  To: Andrew Clausen; +Cc: Ralf Baechle, linux-mips

On Thu, 23 Jan 2003, Andrew Clausen wrote:

> Shouldn't those two long's be replaced with u64 and u32
> respectively?  Is the second struct really meant to be twice the
> size the first?

They should be the same size, otherwise sys32_rt_sigsuspend and
sys32_rt_sigaction will return EINVAL. As the comment says:
/* XXX: Don't preclude handling different sized sigset_t's.  */

I've posted a patch to fix that earlier this month (Monday 13 Jan
2003 "[2.5 PATCH] signal handling").

BTW, anyone working on mips64 2.5 kernel should have a look at my patch
set (http://www.linux-mips.org/~glaurung/O2/linux-2.5.47/patches-2.5.47.tar.gz)
for patches named "linux-mips-*.diff" as they might be relevant for other
machines than just the O2, and the more they are tested the better. A
README is provided to explain briefly what they (try to) fix.

regards,
Vivien.

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

* Re: sigset_t32 broken?
  2003-01-23  9:59 ` Vivien Chappelier
@ 2003-01-24  1:48   ` Ralf Baechle
  2003-01-27  0:44     ` Vivien Chappelier
  0 siblings, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2003-01-24  1:48 UTC (permalink / raw)
  To: Vivien Chappelier; +Cc: Andrew Clausen, linux-mips

On Thu, Jan 23, 2003 at 10:59:29AM +0100, Vivien Chappelier wrote:

> > Shouldn't those two long's be replaced with u64 and u32
> > respectively?  Is the second struct really meant to be twice the
> > size the first?
> 
> They should be the same size, otherwise sys32_rt_sigsuspend and
> sys32_rt_sigaction will return EINVAL. As the comment says:
> /* XXX: Don't preclude handling different sized sigset_t's.  */
> 
> I've posted a patch to fix that earlier this month (Monday 13 Jan
> 2003 "[2.5 PATCH] signal handling").

Most of what your patch does is undoing an accidental commit of a signal
rework that wasn't yet supposed to go out.

  Ralf

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

* Re: sigset_t32 broken?
  2003-01-24  1:48   ` Ralf Baechle
@ 2003-01-27  0:44     ` Vivien Chappelier
  2003-01-27  9:19       ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Vivien Chappelier @ 2003-01-27  0:44 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

On Fri, 24 Jan 2003, Ralf Baechle wrote:
> Most of what your patch does is undoing an accidental commit of a signal
> rework that wasn't yet supposed to go out.

Maybe.. but current version is still wrong :) The type of the sig
array in the 32-bit compatibility struct sigset_t32 must be 32bit long,
i.e. unsigned int not unsigned long.
And I think unsigned describes the data better than signed, but that's a
matter of taste :) (coherent with the choice in asm-mips/signal.h).

Vivien.

--- include/asm-mips64/signal.h	2003-01-26 02:41:48.000000000 +0100
+++ include/asm-mips64/signal.h	2003-01-27 01:28:13.000000000 +0100
@@ -16,7 +16,7 @@
 #define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
 
 typedef struct {
-	long sig[_NSIG_WORDS];
+	unsigned long sig[_NSIG_WORDS];
 } sigset_t;
 
 #define _NSIG32		128
@@ -24,7 +24,7 @@
 #define _NSIG_WORDS32	(_NSIG32 / _NSIG_BPW32)
 
 typedef struct {
-	long sig[_NSIG_WORDS32];
+	unsigned int sig[_NSIG_WORDS32];
 } sigset_t32;
 
 typedef unsigned long old_sigset_t;		/* at least 32 bits */

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

* Re: sigset_t32 broken?
  2003-01-27  0:44     ` Vivien Chappelier
@ 2003-01-27  9:19       ` Geert Uytterhoeven
  2003-01-27 22:30         ` Juan Quintela
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2003-01-27  9:19 UTC (permalink / raw)
  To: Vivien Chappelier; +Cc: Ralf Baechle, Linux/MIPS Development

On Mon, 27 Jan 2003, Vivien Chappelier wrote:

> On Fri, 24 Jan 2003, Ralf Baechle wrote:
> > Most of what your patch does is undoing an accidental commit of a signal
> > rework that wasn't yet supposed to go out.
> 
> Maybe.. but current version is still wrong :) The type of the sig
> array in the 32-bit compatibility struct sigset_t32 must be 32bit long,
> i.e. unsigned int not unsigned long.
> And I think unsigned describes the data better than signed, but that's a
> matter of taste :) (coherent with the choice in asm-mips/signal.h).

Why not make it u32?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: sigset_t32 broken?
  2003-01-27  9:19       ` Geert Uytterhoeven
@ 2003-01-27 22:30         ` Juan Quintela
  0 siblings, 0 replies; 6+ messages in thread
From: Juan Quintela @ 2003-01-27 22:30 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Vivien Chappelier, Ralf Baechle, Linux/MIPS Development

>>>>> "geert" == Geert Uytterhoeven <geert@linux-m68k.org> writes:

geert> On Mon, 27 Jan 2003, Vivien Chappelier wrote:
>> On Fri, 24 Jan 2003, Ralf Baechle wrote:
>> > Most of what your patch does is undoing an accidental commit of a signal
>> > rework that wasn't yet supposed to go out.
>> 
>> Maybe.. but current version is still wrong :) The type of the sig
>> array in the 32-bit compatibility struct sigset_t32 must be 32bit long,
>> i.e. unsigned int not unsigned long.
>> And I think unsigned describes the data better than signed, but that's a
>> matter of taste :) (coherent with the choice in asm-mips/signal.h).

geert> Why not make it u32?

Nahh, that will make it clear indeed to stupid's like me :p

Later ,Juan.



-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

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

end of thread, other threads:[~2003-01-27 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-23  7:17 sigset_t32 broken? Andrew Clausen
2003-01-23  9:59 ` Vivien Chappelier
2003-01-24  1:48   ` Ralf Baechle
2003-01-27  0:44     ` Vivien Chappelier
2003-01-27  9:19       ` Geert Uytterhoeven
2003-01-27 22:30         ` Juan Quintela

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.