From f02bf3cc397f2ab9be297fef2039457431cf1fdd Mon Sep 17 00:00:00 2001 From: jdolecek Date: Tue, 4 Feb 2003 15:54:26 +0000 Subject: [PATCH] add XXX coment to sadata_upcall_alloc() noting this might need to zero memory use 'l' for sa_yield() tsleep call; sa->sa_idle == l there add DIAGNOSTIC printf on one more place in sa_upcall_userret() where we kill process with SIGILL --- sys/kern/kern_sa.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sa.c b/sys/kern/kern_sa.c index 02bd6b88a1ee..38b77d2b3590 100644 --- a/sys/kern/kern_sa.c +++ b/sys/kern/kern_sa.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sa.c,v 1.5 2003/02/03 23:31:42 nathanw Exp $ */ +/* $NetBSD: kern_sa.c,v 1.6 2003/02/04 15:54:26 jdolecek Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.5 2003/02/03 23:31:42 nathanw Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.6 2003/02/04 15:54:26 jdolecek Exp $"); #include #include @@ -81,6 +81,7 @@ struct sadata_upcall * sadata_upcall_alloc(int waitok) { + /* XXX zero the memory? */ return (pool_get(&saupcall_pool, waitok ? PR_WAITOK : PR_NOWAIT)); } @@ -301,8 +302,7 @@ sa_yield(struct lwp *l) if (p->p_userret == NULL) { sa->sa_idle = l; l->l_flag &= ~L_SA; - tsleep((caddr_t) sa->sa_idle, PUSER | PCATCH, - "sawait", 0); + tsleep((caddr_t) l, PUSER | PCATCH, "sawait", 0); l->l_flag |= L_SA; sa->sa_idle = NULL; sa->sa_vp = l; @@ -927,6 +927,12 @@ sa_upcall_userret(struct lwp *l) if (copyout(sau->sau_arg, ap, sau->sau_argsize) != 0) { /* Copying onto the stack didn't work. Die. */ sadata_upcall_free(sau); +#ifdef DIAGNOSTIC + printf("sa_upcall_userret(%d.%d): couldn't copyout" + " sadata_upcall arg %p size %d to %p \n", + p->p_pid, l->l_lid, + sau->sau_arg, sau->sau_argsize, ap); +#endif sigexit(l, SIGILL); /* NOTREACHED */ }