diff options
-rw-r--r-- | sys/ia64/ia64/genassym.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/swtch.s | 6 | ||||
-rw-r--r-- | sys/ia64/ia64/trap.c | 24 | ||||
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 37 |
4 files changed, 69 insertions, 0 deletions
diff --git a/sys/ia64/ia64/genassym.c b/sys/ia64/ia64/genassym.c index 8dbc394..5e348fb 100644 --- a/sys/ia64/ia64/genassym.c +++ b/sys/ia64/ia64/genassym.c @@ -76,9 +76,11 @@ ASSYM(MTX_UNOWNED, MTX_UNOWNED); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); +ASSYM(TD_STATE, offsetof(struct thread, td_state)); ASSYM(TD_KSE, offsetof(struct thread, td_kse)); ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); ASSYM(TD_MD_FLAGS, offsetof(struct thread, td_md.md_flags)); +ASSYM(TDS_RUNNING, TDS_RUNNING); ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); diff --git a/sys/ia64/ia64/swtch.s b/sys/ia64/ia64/swtch.s index da1e270..18ebedc 100644 --- a/sys/ia64/ia64/swtch.s +++ b/sys/ia64/ia64/swtch.s @@ -283,6 +283,12 @@ ENTRY(cpu_switch, 0) st8 [r14]=r4 // set r13->pc_curthread mov ar.k7=r4 ;; +// Julian's guess at settinghte thread state + add r15=TD_STATE,r4 + ;; + mov [r15]=TDS_RUNNING + ;; +// end of julian's guess add r15=TD_PCB,r4 ;; ld8 r15=[r15] diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 4ffdb15..09d824f 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -41,6 +41,7 @@ #include <sys/exec.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/kse.h> #include <sys/smp.h> #include <sys/vmmeter.h> #include <sys/sysent.h> @@ -334,6 +335,11 @@ trap(int vector, int imm, struct trapframe *framep) 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)) { + mtx_lock_spin(&sched_lock); + thread_exit(); + /* NOTREACHED */ + } } else { sticks = 0; /* XXX bogus -Wuninitialized warning */ KASSERT(cold || td->td_ucred != NULL, @@ -799,6 +805,24 @@ syscall(int code, u_int64_t *args, struct trapframe *framep) framep->tf_cr_iip += 16; } + 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, kmbx_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 ia64_fpstate_check(td); #endif diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 24ea100..cdb14b5 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -112,6 +112,43 @@ vm_fault_quick(v, prot) return(r); } +void +cpu_thread_exit(struct thread *td) +{ +} + +void +cpu_thread_setup(struct thread *td) +{ +} + +void +cpu_save_upcall(struct thread *td, struct kse *newkse) +{ +} + +void +cpu_set_upcall(struct thread *td, void *pcb) +{ +} + +void +cpu_set_args(struct thread *td, struct kse *ke) +{ +} + +void +cpu_free_kse_mdstorage(struct kse *ke) +{ +} + +int +cpu_export_context(struct thread *td) +{ + return (0); +} + + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child |