From owner-p4-projects Fri May 31 15: 8:54 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 89F3337B406; Fri, 31 May 2002 15:08:27 -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 AF4B437B404 for ; Fri, 31 May 2002 15:08:26 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4VM8Q506888 for perforce@freebsd.org; Fri, 31 May 2002 15:08:26 -0700 (PDT) (envelope-from julian@freebsd.org) Date: Fri, 31 May 2002 15:08:26 -0700 (PDT) Message-Id: <200205312208.g4VM8Q506888@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer Subject: PERFORCE change 12226 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=12226 Change 12226 by julian@julian_ref on 2002/05/31 15:07:26 Alpha additions (incomplete) coutesy of Bernd Walter Affected files ... ... //depot/projects/kse/sys/alpha/alpha/genassym.c#15 edit ... //depot/projects/kse/sys/alpha/alpha/swtch.s#11 edit ... //depot/projects/kse/sys/alpha/alpha/trap.c#23 edit ... //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#22 edit ... //depot/projects/kse/sys/alpha/include/kse.h#1 add ... //depot/projects/kse/sys/i386/include/kse.h#4 edit ... //depot/projects/kse/sys/kern/kern_thread.c#54 edit Differences ... ==== //depot/projects/kse/sys/alpha/alpha/genassym.c#15 (text+ko) ==== @@ -80,6 +80,8 @@ ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_KSE, offsetof(struct thread, td_kse)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); +ASSYM(TD_STATE, offsetof(struct thread, td_state)); +ASSYM(TDS_RUNNING, TDS_RUNNING); ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); ==== //depot/projects/kse/sys/alpha/alpha/swtch.s#11 (text+ko) ==== @@ -127,6 +127,9 @@ mov v0, s2 /* s2 = new thread */ ldq s3, TD_MD_PCBPADDR(s2) /* s3 = new pcbpaddr */ + ldiq t0, TDS_RUNNING + stl t0, TD_STATE(s2) + /* * Check to see if we're switching to ourself. If we are, * don't bother loading the new context. ==== //depot/projects/kse/sys/alpha/alpha/trap.c#23 (text+ko) ==== @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -299,6 +300,10 @@ td->td_frame = framep; if (td->td_ucred != p->p_ucred) cred_update_thread(td); + if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) { + thread_exit(); + /* NOTREACHED */ + } } else { sticks = 0; /* XXX bogus -Wuninitialized warning */ KASSERT(cold || td->td_ucred != NULL, @@ -659,6 +664,23 @@ sticks = td->td_kse->ke_sticks; if (td->td_ucred != p->p_ucred) cred_update_thread(td); + if (p->p_flag & P_KSES) { + /* + * If we are doing a syscall in a KSE environment, + * note where our mailbox is. There is always the + * possibility that we could do this lazily (in sleep()), + * 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)); + if ((td->td_mailbox == NULL) || + (td->td_mailbox == (void *)-1)) { + td->td_mailbox = NULL; /* single thread it.. */ + td->td_flags &= ~TDF_UNBOUND; + } else { + td->td_flags |= TDF_UNBOUND; + } + } #ifdef DIAGNOSTIC alpha_fpstate_check(td); ==== //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#22 (text+ko) ==== @@ -240,11 +240,63 @@ * from proc0. */ void -cpu_exit(td) - register struct thread *td; +cpu_exit(struct thread *td) +{ + /* KSEXXX */ + alpha_fpstate_drop(td); +} + +void +cpu_thread_exit(struct thread *td) +{ + /* KSEXXX */ +} + +void +cpu_thread_setup(struct thread *td) +{ + /* KSEXXX */ +} + +/* KSEXXX */ +struct md_store { + struct pcb mds_pcb; + struct trapframe mds_frame; +}; + +void +cpu_save_upcall(struct thread *td, struct kse *newkse) +{ + /* KSEXXX */ +} + +void +cpu_set_upcall(struct thread *td, void *pcb) +{ + /* KSEXXX */ +} + +/* + * 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) +{ + /* KSEXXX */ +} + +void +cpu_free_kse_mdstorage(struct kse *kse) { + /* KSEXXX */ +} - alpha_fpstate_drop(td); +int +cpu_export_context(struct thread *td) +{ + /* KSEXXX */ } void ==== //depot/projects/kse/sys/i386/include/kse.h#4 (text+ko) ==== @@ -34,15 +34,6 @@ #include union kse_td_ctx { - struct { - int if_onstack; - struct intrframe if_if; - } intrfrm; - struct { - int tf_onstack; - int tf_gs; - struct trapframe tf_tf; - } tfrm; mcontext_t mcontext; }; ==== //depot/projects/kse/sys/kern/kern_thread.c#54 (text+ko) ==== @@ -269,7 +269,7 @@ error = td2_mbx = fuword(addr1); if (error == -1) error = EFAULT; - else + else error = 0; } if (!error) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message