diff options
| author | Doug Rabson <dfr@FreeBSD.org> | 1999-11-10 21:14:25 +0000 |
|---|---|---|
| committer | Doug Rabson <dfr@FreeBSD.org> | 1999-11-10 21:14:25 +0000 |
| commit | 62a50bfa38d3a85a7b7c0a16c9e3251d994c2627 (patch) | |
| tree | 915e859019352304de1c4ade9813a58bd9557a3c /sys/powerpc | |
| parent | 5c7e1843499a2954350bb1fde3ab224fcb4d9135 (diff) | |
Notes
Diffstat (limited to 'sys/powerpc')
| -rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 20 | ||||
| -rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 20 |
2 files changed, 16 insertions, 24 deletions
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index 7a96d2b760757..989be9a4e0387 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -133,19 +133,17 @@ cpu_fork(p1, p2) * Copy floating point state from the FP chip to the PCB * if this process has state stored there. */ - if (p1 == fpcurproc) { - alpha_pal_wrfen(1); - savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); - alpha_pal_wrfen(0); - } + alpha_fpstate_save(p1, 0); /* - * Copy pcb and stack from proc p1 to p2. - * We do this as cheaply as possible, copying only the active - * part of the stack. The stack and pcb need to agree; + * Copy pcb and stack from proc p1 to p2. We do this as + * cheaply as possible, copying only the active part of the + * stack. The stack and pcb need to agree. Make sure that the + * new process has FEN disabled. */ p2->p_addr->u_pcb = p1->p_addr->u_pcb; p2->p_addr->u_pcb.pcb_hw.apcb_usp = alpha_pal_rdusp(); + p2->p_addr->u_pcb.pcb_hw.apcb_flags &= ~ALPHA_PCB_FLAGS_FEN; /* * Set the floating point state. @@ -165,8 +163,7 @@ cpu_fork(p1, p2) #ifdef DIAGNOSTIC if (p1 != curproc) panic("cpu_fork: curproc"); - if ((up->u_pcb.pcb_hw.apcb_flags & ALPHA_PCB_FLAGS_FEN) != 0) - printf("DANGER WILL ROBINSON: FEN SET IN cpu_fork!\n"); + alpha_fpstate_check(p1); #endif /* @@ -241,8 +238,7 @@ void cpu_exit(p) register struct proc *p; { - if (p == fpcurproc) - fpcurproc = NULL; + alpha_fpstate_drop(p); (void) splhigh(); cnt.v_swtch++; diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index 7a96d2b760757..989be9a4e0387 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -133,19 +133,17 @@ cpu_fork(p1, p2) * Copy floating point state from the FP chip to the PCB * if this process has state stored there. */ - if (p1 == fpcurproc) { - alpha_pal_wrfen(1); - savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); - alpha_pal_wrfen(0); - } + alpha_fpstate_save(p1, 0); /* - * Copy pcb and stack from proc p1 to p2. - * We do this as cheaply as possible, copying only the active - * part of the stack. The stack and pcb need to agree; + * Copy pcb and stack from proc p1 to p2. We do this as + * cheaply as possible, copying only the active part of the + * stack. The stack and pcb need to agree. Make sure that the + * new process has FEN disabled. */ p2->p_addr->u_pcb = p1->p_addr->u_pcb; p2->p_addr->u_pcb.pcb_hw.apcb_usp = alpha_pal_rdusp(); + p2->p_addr->u_pcb.pcb_hw.apcb_flags &= ~ALPHA_PCB_FLAGS_FEN; /* * Set the floating point state. @@ -165,8 +163,7 @@ cpu_fork(p1, p2) #ifdef DIAGNOSTIC if (p1 != curproc) panic("cpu_fork: curproc"); - if ((up->u_pcb.pcb_hw.apcb_flags & ALPHA_PCB_FLAGS_FEN) != 0) - printf("DANGER WILL ROBINSON: FEN SET IN cpu_fork!\n"); + alpha_fpstate_check(p1); #endif /* @@ -241,8 +238,7 @@ void cpu_exit(p) register struct proc *p; { - if (p == fpcurproc) - fpcurproc = NULL; + alpha_fpstate_drop(p); (void) splhigh(); cnt.v_swtch++; |
