aboutsummaryrefslogtreecommitdiff
path: root/sys/ia64
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2002-06-29 18:26:18 +0000
committerJulian Elischer <julian@FreeBSD.org>2002-06-29 18:26:18 +0000
commite1047617d6e86b32ae98a37d8ec7258a011b2c8f (patch)
tree92daf12d862e322805cdfb5e22f5634dc0eec508 /sys/ia64
parent0d8ba9a6576c06bbb6a95cc7823ff6ceb3b764cb (diff)
downloadsrc-e1047617d6e86b32ae98a37d8ec7258a011b2c8f.tar.gz
src-e1047617d6e86b32ae98a37d8ec7258a011b2c8f.zip
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)
Notes
Notes: svn path=/head/; revision=99081
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/genassym.c2
-rw-r--r--sys/ia64/ia64/swtch.s6
-rw-r--r--sys/ia64/ia64/trap.c24
-rw-r--r--sys/ia64/ia64/vm_machdep.c37
4 files changed, 69 insertions, 0 deletions
diff --git a/sys/ia64/ia64/genassym.c b/sys/ia64/ia64/genassym.c
index 8dbc3948d578..5e348fbbd0b1 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 da1e270bbd6d..18ebedc524f4 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 4ffdb15ac264..09d824f9a81c 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 24ea100c8d3a..cdb14b5e099b 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