Page MenuHomeFreeBSD

D60754.diff
No OneTemporary

D60754.diff

diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c
--- a/sys/powerpc/powerpc/exec_machdep.c
+++ b/sys/powerpc/powerpc/exec_machdep.c
@@ -422,13 +422,21 @@
for (i = 0; i < 32; i++)
memcpy(&mcp->mc_fpreg[i], &pcb->pcb_fpu.fpr[i].fpr,
sizeof(double));
- }
- if (pcb->pcb_flags & PCB_VSX) {
- mcp->mc_flags |= _MC_VS_VALID;
- for (i = 0; i < 32; i++)
- memcpy(&mcp->mc_vsxfpreg[i],
- &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double));
+ /*
+ * The second halves of VSR0-31 in the PCB are current
+ * whenever the FP state is: VSX instructions cannot run
+ * without PCB_VSX, and save_fpu() stores them when it is
+ * set. Export them regardless of whether the thread owns
+ * VSX at this moment, or a signal delivered right after a
+ * sigreturn loses them.
+ */
+ if (cpu_features & PPC_FEATURE_HAS_VSX) {
+ mcp->mc_flags |= _MC_VS_VALID;
+ for (i = 0; i < 32; i++)
+ memcpy(&mcp->mc_vsxfpreg[i],
+ &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double));
+ }
}
/*

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 17, 2:03 AM (3 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40910646
Default Alt Text
D60754.diff (1 KB)

Event Timeline