Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern fix timerupcall breakage after SA_SIGINFO changes:



details:   https://anonhg.NetBSD.org/src/rev/d93ad5ff7cfa
branches:  trunk
changeset: 551636:d93ad5ff7cfa
user:      cl <cl%NetBSD.org@localhost>
date:      Tue Sep 09 15:16:30 2003 +0000

description:
fix timerupcall breakage after SA_SIGINFO changes:
- sa_upcall only stores a pointer to the `arg'

diffstat:

 sys/kern/kern_sa.c   |   8 +++-----
 sys/kern/kern_time.c |  17 ++++++++++++-----
 2 files changed, 15 insertions(+), 10 deletions(-)

diffs (81 lines):

diff -r 5f0914e20c49 -r d93ad5ff7cfa sys/kern/kern_sa.c
--- a/sys/kern/kern_sa.c        Tue Sep 09 15:02:45 2003 +0000
+++ b/sys/kern/kern_sa.c        Tue Sep 09 15:16:30 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sa.c,v 1.21 2003/08/20 13:54:48 yamt Exp $        */
+/*     $NetBSD: kern_sa.c,v 1.22 2003/09/09 15:16:30 cl Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.21 2003/08/20 13:54:48 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.22 2003/09/09 15:16:30 cl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,11 +124,9 @@
        if (sau->sau_arg) {
                switch (sau->sau_type) {
                case SA_UPCALL_SIGNAL:
+               case SA_UPCALL_SIGEV:
                        pool_put(&siginfo_pool, sau->sau_arg);
                        break;
-               case SA_UPCALL_SIGEV:
-                       /* don't need to deallocate it at all */
-                       break;
                default:
                        panic("sadata_free: unknown type of sau_arg: %d",
                            sau->sau_type);
diff -r 5f0914e20c49 -r d93ad5ff7cfa sys/kern/kern_time.c
--- a/sys/kern/kern_time.c      Tue Sep 09 15:02:45 2003 +0000
+++ b/sys/kern/kern_time.c      Tue Sep 09 15:16:30 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time.c,v 1.73 2003/09/06 22:03:10 christos Exp $  */
+/*     $NetBSD: kern_time.c,v 1.74 2003/09/09 15:16:30 cl Exp $        */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.73 2003/09/06 22:03:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.74 2003/09/09 15:16:30 cl Exp $");
 
 #include "fs_nfs.h"
 #include "opt_nfs.h"
@@ -864,6 +864,8 @@
 {
        struct ptimers *pt = (struct ptimers *)arg;
        unsigned int i, fired, done;
+       extern struct pool siginfo_pool;        /* XXX Ew. */
+
        KERNEL_PROC_LOCK(l);
 
        {
@@ -880,14 +882,19 @@
        fired = pt->pts_fired;
        done = 0;
        while ((i = ffs(fired)) != 0) {
-               siginfo_t si;
+               siginfo_t *si;
                int mask = 1 << --i;
+               int f;
 
-               si._info = pt->pts_timers[i]->pt_info;
+               f = l->l_flag & L_SA;
+               l->l_flag &= ~L_SA;
+               si = pool_get(&siginfo_pool, PR_WAITOK);
+               si->_info = pt->pts_timers[i]->pt_info;
                if (sa_upcall(l, SA_UPCALL_SIGEV | SA_UPCALL_DEFER, NULL, l,
-                   sizeof(si), &si) == 0)
+                   sizeof(*si), si) == 0)
                        done |= mask;
                fired &= ~mask;
+               l->l_flag |= f;
        }
        pt->pts_fired &= ~done;
        if (pt->pts_fired == 0)



Home | Main Index | Thread Index | Old Index