From owner-p4-projects Fri Jun 14 17:17:15 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DD72637B442; Fri, 14 Jun 2002 17:16:56 -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 6032237B48D for ; Fri, 14 Jun 2002 17:16:33 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5F0FS795389 for perforce@freebsd.org; Fri, 14 Jun 2002 17:15:28 -0700 (PDT) (envelope-from julian@freebsd.org) Date: Fri, 14 Jun 2002 17:15:28 -0700 (PDT) Message-Id: <200206150015.g5F0FS795389@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer Subject: PERFORCE change 12950 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=12950 Change 12950 by julian@julian_jules1 on 2002/06/14 17:15:07 The upcall needs an argument now. Affected files ... ... //depot/projects/kse/sys/i386/i386/pmap.c#36 edit ... //depot/projects/kse/sys/i386/i386/vm_machdep.c#51 edit ... //depot/projects/kse/sys/kern/subr_trap.c#64 edit ... //depot/projects/kse/sys/sys/kse.h#12 edit ... //depot/projects/kse/sys/sys/proc.h#110 edit Differences ... ==== //depot/projects/kse/sys/i386/i386/pmap.c#36 (text+ko) ==== @@ -1130,16 +1130,6 @@ #else kmem_free(kernel_map, ks, KSTACK_PAGES * PAGE_SIZE); #endif - - /* - * If the thread got swapped out some of its KSTACK might have gotten - * swapped. Just get rid of the object to clean up the swap use - * proactively. NOTE! might block waiting for paging I/O to complete. - */ - if (ksobj->type == OBJT_SWAP) { - td->td_kstack_obj = NULL; - vm_object_deallocate(ksobj); - } vm_object_deallocate(ksobj); td->td_kstack_obj = NULL; /* play it safe */ } ==== //depot/projects/kse/sys/i386/i386/vm_machdep.c#51 (text+ko) ==== @@ -391,11 +391,13 @@ pcb2->pcb_ext = NULL; } +#if 0 /* * Set the return value for returning upcalls. * We should be able to do this ahead of time in cpu_save_upcall(). * doing it once there instead of N times in the upcall path */ + void cpu_set_retval(struct thread *td, int retval, int aux, int success) { @@ -409,6 +411,15 @@ else frame->tf_eflags |= PSL_C; /* error */ } +#endif + +void +cpu_set_args(struct thread *td, struct *kse) +{ + char * sp = ke->ke_frame->tf_esp; + + suword(ke->ke_frame->tf_esp - sizeof(void *), ke->ke_mailbox); +} void cpu_free_kse_mdstorage(struct kse *kse) ==== //depot/projects/kse/sys/kern/subr_trap.c#64 (text+ko) ==== @@ -213,10 +213,10 @@ bcopy(ke->ke_frame, frame, sizeof(struct trapframe)); /* - * Decide what we are returning to the user - * upcall returns 0, no error, (no aux?). + * Decide what we are sending to the user + * upcall sets one argument. The address of the mbox. */ - cpu_set_retval(td, 0, 1, 1); + cpu_set_args(td, ke); /* * There is no more work to do and we are going to ride ==== //depot/projects/kse/sys/sys/kse.h#12 (text+ko) ==== @@ -60,9 +60,7 @@ */ struct kse_mailbox { - /*void (*kmbx_upcall)(struct kse_mailbox *mbx); */ kse_fn_t *kmbx_upcall; -int x; char *kmbx_stackbase; unsigned long int kmbx_stacksize; struct thread_mailbox *kmbx_current_thread; ==== //depot/projects/kse/sys/sys/proc.h#110 (text+ko) ==== @@ -813,7 +813,7 @@ int cpu_export_context(struct thread *td); void cpu_free_kse_mdstorage(struct kse *kse); void cpu_save_upcall(struct thread *td, struct kse *newkse); -void cpu_set_retval(struct thread *, int, int, int); +void cpu_set_args(struct thread *, struct kse *); void cpu_set_upcall(struct thread *td, void *pcb); void cpu_thread_exit(struct thread *); void cpu_thread_setup(struct thread *td); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message