Re: [PATCH] ppc64: Fix 32 bits conversion of SI_TIMER signals

From: Benjamin Herrenschmidt
Date: Sun Sep 26 2004 - 02:01:20 EST


On Sun, 2004-09-26 at 11:41, Linux Kernel Mailing List wrote:
> ChangeSet 1.1991, 2004/09/25 18:41:38-07:00, benh@xxxxxxxxxxxxxxxxxxx
>
> [PATCH] ppc64: Fix 32 bits conversion of SI_TIMER signals
>
> The current 32 bits translation of the SI_TIMER is wrong on ppc64, causing
> the tst-timer4 testcase of glibc to fail in 32 bits. This patch fixes it.
>
> Signed-off-by: Olaf Hering <olh@xxxxxxx>
> Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxx>
>

Agh !

I had two patches, a broken one and a good one and ... of course I sent
the broken one, sorry :(

Can you still back it out ?

Here is the correct one:


ppc64: Fix 32 bits conversion of SI_TIMER signals

The current 32 bits translation of the SI_TIMER is wrong on ppc64, causing
the tst-timer4 testcase of glibc to fail in 32 bits. This patch fixes it.

Signed-off-by: Olaf Hering <olh@xxxxxxx>
Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxx>

===== arch/ppc64/kernel/signal32.c 1.57 vs edited =====
--- 1.57/arch/ppc64/kernel/signal32.c 2004-09-14 10:23:15 +10:00
+++ edited/arch/ppc64/kernel/signal32.c 2004-09-26 16:57:11 +10:00
@@ -472,9 +472,13 @@
&d->si_addr);
break;
case __SI_POLL >> 16:
- case __SI_TIMER >> 16:
err |= __put_user(s->si_band, &d->si_band);
err |= __put_user(s->si_fd, &d->si_fd);
+ break;
+ case __SI_TIMER >> 16:
+ err |= __put_user(s->si_tid, &d->si_tid);
+ err |= __put_user(s->si_overrun, &d->si_overrun);
+ err |= __put_user(s->si_int, &d->si_int);
break;
case __SI_RT >> 16: /* This is not generated by the kernel as of now. */
case __SI_MESGQ >> 16:
===== include/asm-ppc64/ppc32.h 1.16 vs edited =====
--- 1.16/include/asm-ppc64/ppc32.h 2004-09-17 16:58:38 +10:00
+++ edited/include/asm-ppc64/ppc32.h 2004-09-26 09:37:49 +10:00
@@ -32,8 +32,10 @@

/* POSIX.1b timers */
struct {
- unsigned int _timer1;
- unsigned int _timer2;
+ timer_t _tid; /* timer id */
+ int _overrun; /* overrun count */
+ compat_sigval_t _sigval; /* same as below */
+ int _sys_private; /* not to be passed to user */
} _timer;

/* POSIX.1b signals */


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/