From owner-p4-projects Thu May 30 22:57:10 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6DC8837B404; Thu, 30 May 2002 22:57:03 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9D05437B401 for ; Thu, 30 May 2002 22:57:02 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4V5v2E25112 for perforce@freebsd.org; Thu, 30 May 2002 22:57:02 -0700 (PDT) (envelope-from julian@freebsd.org) Date: Thu, 30 May 2002 22:57:02 -0700 (PDT) Message-Id: <200205310557.g4V5v2E25112@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer Subject: PERFORCE change 12179 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12179 Change 12179 by julian@julian_ref on 2002/05/30 22:56:19 Use fuword and suword instead of copyin/copyout when setting up thread completion mailboxes. needs fptr and sptr, which I will add soon. Affected files ... ... //depot/projects/kse/sys/i386/i386/trap.c#43 edit ... //depot/projects/kse/sys/kern/kern_thread.c#50 edit Differences ... ==== //depot/projects/kse/sys/i386/i386/trap.c#43 (text+ko) ==== @@ -955,10 +955,10 @@ * possibility that we could do this lazily (in sleep()), * but for now do it every time. */ - error = copyin((caddr_t)td->td_kse->ke_mailbox + - offsetof(struct kse_mailbox, current_thread), - &td->td_mailbox, sizeof(void *)); - if (error || td->td_mailbox == NULL) { + td->td_mailbox = fuword((caddr_t)td->td_kse->ke_mailbox + + offsetof(struct kse_mailbox, current_thread)); + if ((td->td_mailbox == NULL) || + (td->td_mailbox == (viod *)-1)) { td->td_mailbox = NULL; /* single thread it.. */ td->td_flags &= ~TDF_UNBOUND; } else { ==== //depot/projects/kse/sys/kern/kern_thread.c#50 (text+ko) ==== @@ -251,7 +251,7 @@ thread_export_context(struct thread *td) { struct kse *ke; - void *td2_mbx; + uint td2_mbx; /* XXXKSE */ void *addr1; void *addr2; int error; @@ -266,11 +266,17 @@ + offsetof(struct thread_mailbox , next_completed); /* Then link it into it's KSE's list of completed threads. */ if (!error) - error = copyin( addr1, &td2_mbx, sizeof(void *)); + error = td2_mbx = fuword(addr1); + if (error == -1) + error = EFAULT; + else + error = 0; if (!error) - error = copyout(&td2_mbx, addr2, sizeof(void *)); + error = suword(addr2, td2_mbx); if (!error) - error = copyout(&td->td_mailbox, addr1, sizeof(void *)); + error = suword(addr1, (uint)td->td_mailbox); + if (error == -1) + error = EFAULT; return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message