diff options
| author | Marcel Moolenaar <marcel@FreeBSD.org> | 2003-07-27 23:45:48 +0000 |
|---|---|---|
| committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2003-07-27 23:45:48 +0000 |
| commit | de22416ef671aff08087e176a856c05382f08b94 (patch) | |
| tree | 2b6422df5fabb1497a0a5066d4dae2c3ac1779c9 | |
| parent | cdedf48666c209df75aa11111f9d7a6d326b953b (diff) | |
Notes
| -rw-r--r-- | sys/alpha/alpha/machdep.c | 8 | ||||
| -rw-r--r-- | sys/alpha/alpha/mp_machdep.c | 3 | ||||
| -rw-r--r-- | sys/alpha/alpha/vm_machdep.c | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index ba40437d29fcf..64148f984787a 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 609fa85d3cdf5..f37d0f143af95 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 3df13886e8914..b0ed14619127d 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; /* |
