From owner-p4-projects Sat Jun 15 4:43:16 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8D9BD37B40B; Sat, 15 Jun 2002 04:43:05 -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 8381637B409 for ; Sat, 15 Jun 2002 04:43:04 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5FBh4A56645 for perforce@freebsd.org; Sat, 15 Jun 2002 04:43:04 -0700 (PDT) (envelope-from ticso@freebsd.org) Date: Sat, 15 Jun 2002 04:43:04 -0700 (PDT) Message-Id: <200206151143.g5FBh4A56645@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to ticso@freebsd.org using -f From: Bernd Walter Subject: PERFORCE change 12976 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=12976 Change 12976 by ticso@ticso-cicely5 on 2002/06/15 04:42:16 partly catchup alpha MI part with i386 Affected files ... ... //depot/projects/kse/sys/alpha/alpha/pmap.c#28 edit ... //depot/projects/kse/sys/alpha/alpha/trap.c#25 edit ... //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#24 edit ... //depot/projects/kse/sys/kern/subr_trap.c#67 edit Differences ... ==== //depot/projects/kse/sys/alpha/alpha/pmap.c#28 (text+ko) ==== @@ -1151,7 +1151,12 @@ ksobj = td->td_kstack_obj; ks = td->td_kstack; ptek = vtopte(ks); +#ifdef KSTACK_GUARD + ks -= PAGE_SIZE; + for (i = 1; i < (KSTACK_PAGES + 1); i++) { +#else for (i = 0; i < KSTACK_PAGES; i++) { +#endif m = vm_page_lookup(ksobj, i); if (m == NULL) panic("pmap_dispose_thread: kstack already missing?"); @@ -1164,14 +1169,16 @@ } /* - * 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. + * Free the space that this stack was mapped to in the kernel + * address map. */ - if (ksobj->type == OBJT_SWAP) { - td->td_kstack_obj = NULL; - vm_object_deallocate(ksobj); - } +#ifdef KSTACK_GUARD + kmem_free(kernel_map, ks, (KSTACK_PAGES + 1) * PAGE_SIZE); +#else + kmem_free(kernel_map, ks, KSTACK_PAGES * PAGE_SIZE); +#endif + td->td_kstack_obj = NULL; + vm_object_deallocate(ksobj); } /* ==== //depot/projects/kse/sys/alpha/alpha/trap.c#25 (text+ko) ==== @@ -301,6 +301,7 @@ if (td->td_ucred != p->p_ucred) cred_update_thread(td); if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) { + PROC_LOCK(p); thread_exit(); /* NOTREACHED */ } @@ -672,7 +673,7 @@ * but for now do it every time. */ td->td_mailbox = (void *)fuword((caddr_t)td->td_kse->ke_mailbox - + offsetof(struct kse_mailbox, current_thread)); + + offsetof(struct kse_mailbox, kmbx_current_thread)); if ((td->td_mailbox == NULL) || (td->td_mailbox == (void *)-1)) { td->td_mailbox = NULL; /* single thread it.. */ ==== //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#24 (text+ko) ==== @@ -338,11 +338,13 @@ #endif } +#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) { @@ -353,6 +355,16 @@ frame->tf_regs[FRAME_A3] = (success) ? 0 : ~0; frame->tf_regs[FRAME_A4] = (u_int64_t)aux; } +#endif + +void +cpu_set_args(struct thread *td, struct kse *ke) +{ +/* XXX + suword((void *)(ke->ke_frame->tf_esp + sizeof(void *)), + (int)ke->ke_mailbox); +*/ +} void cpu_free_kse_mdstorage(struct kse *kse) ==== //depot/projects/kse/sys/kern/subr_trap.c#67 (text+ko) ==== @@ -230,8 +230,10 @@ error = suword((caddr_t)td->td_kse->ke_mailbox + offsetof(struct kse_mailbox, kmbx_current_thread), 0); +#ifdef __i386__ printf("suword mailbox to 0 error: %d, frame= %p, eip=%p, esp=%p\n", error, frame, frame->tf_eip, frame->tf_esp); +#endif } /* * Stop any chance that we may be separated from To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message