summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/machdep.c8
-rw-r--r--sys/alpha/alpha/mp_machdep.c3
-rw-r--r--sys/alpha/alpha/vm_machdep.c1
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index ba40437..64148f9 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -548,6 +548,9 @@ alpha_init(pfn, ptb, bim, bip, biv)
alpha_pal_wrmces(alpha_pal_rdmces() &
~(ALPHA_MCES_DSC|ALPHA_MCES_DPC));
+ /* Clear userland thread pointer */
+ alpha_pal_wrunique(0);
+
/*
* Find out what hardware we're on, and do basic initialization.
*/
@@ -2028,7 +2031,7 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
mcp->mc_regs[FRAME_SP] = alpha_pal_rdusp();
mcp->mc_thrptr = alpha_pal_rdunique();
} else
- mcp->mc_thrptr = td->td_pcb->pcb_hw.apcb_unique;
+ mcp->mc_thrptr = 0;
mcp->mc_format = _MC_REV0_TRAPFRAME;
PROC_LOCK(curthread->td_proc);
@@ -2069,8 +2072,7 @@ set_mcontext(struct thread *td, const mcontext_t *mcp)
if (td == curthread) {
alpha_pal_wrusp(mcp->mc_regs[FRAME_SP]);
alpha_pal_wrunique(mcp->mc_thrptr);
- } else
- td->td_pcb->pcb_hw.apcb_unique = mcp->mc_thrptr;
+ }
/*
* The context is a trapframe, so just copy it over the
diff --git a/sys/alpha/alpha/mp_machdep.c b/sys/alpha/alpha/mp_machdep.c
index 609fa85..f37d0f1 100644
--- a/sys/alpha/alpha/mp_machdep.c
+++ b/sys/alpha/alpha/mp_machdep.c
@@ -137,6 +137,9 @@ smp_init_secondary(void)
*/
alpha_pal_wrval((u_int64_t) pcpup);
+ /* Clear userland thread pointer. */
+ alpha_pal_wrunique(0);
+
/*
* Point interrupt/exception vectors to our own.
*/
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index 3df1388..b0ed146 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/vm_machdep.c
@@ -145,6 +145,7 @@ cpu_fork(td1, p2, td2, flags)
*/
bcopy(td1->td_pcb, td2->td_pcb, sizeof(struct pcb));
td2->td_pcb->pcb_hw.apcb_usp = alpha_pal_rdusp();
+ td2->td_pcb->pcb_hw.apcb_unique = 0;
td2->td_pcb->pcb_hw.apcb_flags &= ~ALPHA_PCB_FLAGS_FEN;
/*
OpenPOWER on IntegriCloud