Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145318448
D27453.1777639656.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D27453.1777639656.diff
View Options
Index: sys/powerpc/include/cpufunc.h
===================================================================
--- sys/powerpc/include/cpufunc.h
+++ sys/powerpc/include/cpufunc.h
@@ -163,21 +163,21 @@
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));
}
Index: sys/powerpc/powerpc/exec_machdep.c
===================================================================
--- sys/powerpc/powerpc/exec_machdep.c
+++ sys/powerpc/powerpc/exec_machdep.c
@@ -239,14 +239,13 @@
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 @@
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);
Index: sys/powerpc/powerpc/fpu.c
===================================================================
--- sys/powerpc/powerpc/fpu.c
+++ sys/powerpc/powerpc/fpu.c
@@ -209,7 +209,6 @@
save_fpu_int(td);
}
-
/*
* Clear Floating-Point Status and Control Register
*/
@@ -217,8 +216,12 @@
cleanup_fpscr()
{
register_t msr;
+
msr = mfmsr();
- mtmsr(msr | PSL_FP | PSL_VSX);
+ if (cpu_features & PPC_FEATURE_HAS_VSX)
+ mtmsr(msr | PSL_FP | PSL_VSX);
+ else
+ mtmsr(msr | PSL_FP);
mtfsf(0);
@@ -226,10 +229,9 @@
mtmsr(msr);
}
-
/*
- * * Returns the current fp exception
- * */
+ * Get the current fp exception
+ */
u_int
get_fpu_exception(struct thread *td)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 12:47 PM (3 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28525721
Default Alt Text
D27453.1777639656.diff (2 KB)
Attached To
Mode
D27453: [PowerPC] Floating-point exception trap followup
Attached
Detach File
Event Timeline
Log In to Comment