Add KSE stubs to MD parts of ia64 code.

Dfr will fill these out when we decide to enable KSEs on ia64
(probably not immediatly)
This commit is contained in:
Julian Elischer 2002-06-29 18:26:18 +00:00
parent 0d8ba9a657
commit e1047617d6
4 changed files with 69 additions and 0 deletions

View File

@ -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));

View File

@ -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]

View File

@ -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

View File

@ -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