version 1.23.12.1, 2006/06/21 14:55:11 |
version 1.23.12.2, 2006/12/30 20:46:44 |
|
|
cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) |
cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) |
{ |
{ |
struct trapframe *tf = trapframe(l); |
struct trapframe *tf = trapframe(l); |
__greg_t *gr = mcp->__gregs; |
const __greg_t *gr = mcp->__gregs; |
#ifdef PPC_HAVE_FPU |
#ifdef PPC_HAVE_FPU |
struct pcb *pcb = &l->l_addr->u_pcb; |
struct pcb *pcb = &l->l_addr->u_pcb; |
#endif |
#endif |
|
|
/* Restore GPR context, if any. */ |
/* Restore GPR context, if any. */ |
if (flags & _UC_CPU) { |
if (flags & _UC_CPU) { |
/* |
|
* Accept all user-settable bits without complaint; |
|
* userland should not need to know the machine-specific |
|
* MSR value. |
|
*/ |
|
gr[_REG_MSR] = (gr[_REG_MSR] & PSL_USERMOD) | PSL_USERSET; |
|
|
|
#ifdef PPC_HAVE_FPU |
#ifdef PPC_HAVE_FPU |
/* |
/* |
* Always save the FP exception mode in the PCB. |
* Always save the FP exception mode in the PCB. |
Line 242 cpu_setmcontext(struct lwp *l, const mco |
|
Line 235 cpu_setmcontext(struct lwp *l, const mco |
|
tf->cr = gr[_REG_CR]; |
tf->cr = gr[_REG_CR]; |
tf->lr = gr[_REG_LR]; |
tf->lr = gr[_REG_LR]; |
tf->srr0 = gr[_REG_PC]; |
tf->srr0 = gr[_REG_PC]; |
tf->srr1 = gr[_REG_MSR]; |
/* |
|
* Accept all user-settable bits without complaint; |
|
* userland should not need to know the machine-specific |
|
* MSR value. |
|
*/ |
|
tf->srr1 = (gr[_REG_MSR] & PSL_USERMOD) | PSL_USERSET; |
tf->ctr = gr[_REG_CTR]; |
tf->ctr = gr[_REG_CTR]; |
tf->xer = gr[_REG_XER]; |
tf->xer = gr[_REG_XER]; |
#ifdef PPC_OEA |
#ifdef PPC_OEA |