diff --git a/sys/powerpc/include/cpufunc.h b/sys/powerpc/include/cpufunc.h index 1b94d565e67..7b003916643 100644 --- a/sys/powerpc/include/cpufunc.h +++ b/sys/powerpc/include/cpufunc.h @@ -163,21 +163,21 @@ mttb(u_quad_t time) mtspr(TBR_TBWL, (uint32_t)(time & 0xffffffff)); } - static __inline register_t mffs(void) { - register_t value; + uint64_t value; __asm __volatile ("mffs 0; stfd 0,0(%0)" :: "b"(&value)); - return (value); + return ((register_t)value); } static __inline void -mtfsf(register_t value) +mtfsf(uint64_t value) { + __asm __volatile ("lfd 0,0(%0); mtfsf 0xff,0" :: "b"(&value)); } diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 807a06b783c..91cc9a98f7a 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -239,14 +239,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) usfp = (void *)((sp - rndfsize) & ~0xFul); } - /* + /* * Set Floating Point facility to "Ignore Exceptions Mode" so signal - * handler can run. + * handler can run. */ if (td->td_pcb->pcb_flags & PCB_FPU) tf->srr1 = tf->srr1 & ~(PSL_FE0 | PSL_FE1); - /* * Set up the registers to return to sigcode. * @@ -334,10 +333,10 @@ sys_sigreturn(struct thread *td, struct sigreturn_args *uap) if (error != 0) return (error); - /* + /* * Save FPU state if needed. User may have changed it on - * signal handler - */ + * signal handler + */ if (uc.uc_mcontext.mc_srr1 & PSL_FP) save_fpu(td); diff --git a/sys/powerpc/powerpc/fpu.c b/sys/powerpc/powerpc/fpu.c index 59d3d218f84..45a77235bd5 100644 --- a/sys/powerpc/powerpc/fpu.c +++ b/sys/powerpc/powerpc/fpu.c @@ -209,7 +209,6 @@ save_fpu_nodrop(struct thread *td) save_fpu_int(td); } - /* * Clear Floating-Point Status and Control Register */ @@ -217,19 +216,18 @@ void cleanup_fpscr() { register_t msr; - msr = mfmsr(); - mtmsr(msr | PSL_FP | PSL_VSX); + msr = mfmsr(); + mtmsr(msr | PSL_FP); mtfsf(0); isync(); mtmsr(msr); } - /* - * * Returns the current fp exception - * */ + * Get the current fp exception + */ u_int get_fpu_exception(struct thread *td) {