Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/exec_machdep.c
Show First 20 Lines • Show All 1,152 Lines • ▼ Show 20 Lines | #ifdef FPU_EMU | ||||
if (!(pcb->pcb_flags & PCB_FPREGS)) { | if (!(pcb->pcb_flags & PCB_FPREGS)) { | ||||
bzero(&pcb->pcb_fpu, sizeof(pcb->pcb_fpu)); | bzero(&pcb->pcb_fpu, sizeof(pcb->pcb_fpu)); | ||||
pcb->pcb_flags |= PCB_FPREGS; | pcb->pcb_flags |= PCB_FPREGS; | ||||
} else if (pcb->pcb_flags & PCB_FPU) | } else if (pcb->pcb_flags & PCB_FPU) | ||||
save_fpu(td); | save_fpu(td); | ||||
sig = fpu_emulate(frame, &pcb->pcb_fpu); | sig = fpu_emulate(frame, &pcb->pcb_fpu); | ||||
if ((sig == 0 || sig == SIGFPE) && pcb->pcb_flags & PCB_FPU) | if ((sig == 0 || sig == SIGFPE) && pcb->pcb_flags & PCB_FPU) | ||||
enable_fpu(td); | enable_fpu(td); | ||||
#else | |||||
if (frame->srr1 & EXC_PGM_FPENABLED) { | |||||
/* Floating-Point Enabled Exception type Program interrupt */ | |||||
sig = SIGFPE; | |||||
} | |||||
jhibbits: Shouldn't this be a save_fpu() instead? | |||||
#endif | #endif | ||||
if (sig == SIGILL) { | if (sig == SIGILL) { | ||||
if (pcb->pcb_lastill != frame->srr0) { | if (pcb->pcb_lastill != frame->srr0) { | ||||
/* Allow a second chance, in case of cache sync issues. */ | /* Allow a second chance, in case of cache sync issues. */ | ||||
sig = 0; | sig = 0; | ||||
pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, 4); | pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, 4); | ||||
pcb->pcb_lastill = frame->srr0; | pcb->pcb_lastill = frame->srr0; | ||||
} | } | ||||
} | } | ||||
return (sig); | return (sig); | ||||
} | } | ||||
Shouldn't this be a save_fpu() instead?