Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177970522
D62036.1795680896.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62036.1795680896.diff
View Options
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
@@ -616,6 +616,24 @@
cleanup_fpscr();
}
+/*
+ * Forget the facility state a thread inherited with a copy of another
+ * thread's PCB. cpu_switch() reloads FSCR and DSCR from the PCB whenever
+ * the old or the new thread has changed them and relies on the fields of
+ * a thread that has not being zero.
+ */
+static void
+reset_power_extras(struct pcb *pcb)
+{
+
+ pcb->pcb_flags = 0;
+ pcb->pcb_dscr = 0;
+ pcb->pcb_fscr = 0;
+ pcb->pcb_tar = 0;
+ memset(&pcb->pcb_ebb, 0, sizeof(pcb->pcb_ebb));
+ memset(&pcb->pcb_lm, 0, sizeof(pcb->pcb_lm));
+}
+
/*
* Ensure the PCB has been updated in preparation for copying a thread.
*
@@ -717,7 +735,7 @@
#endif
tf->srr1 = psl_userset | PSL_FE_DFLT;
cleanup_power_extras(td);
- td->td_pcb->pcb_flags = 0;
+ reset_power_extras(td->td_pcb);
}
#ifdef COMPAT_FREEBSD32
@@ -743,7 +761,7 @@
tf->srr0 = imgp->entry_addr;
tf->srr1 = psl_userset32 | PSL_FE_DFLT;
cleanup_power_extras(td);
- td->td_pcb->pcb_flags = 0;
+ reset_power_extras(td->td_pcb);
}
#endif
@@ -1217,7 +1235,7 @@
#endif
}
- td->td_pcb->pcb_flags = 0;
+ reset_power_extras(td->td_pcb);
td->td_retval[0] = (register_t)entry;
td->td_retval[1] = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 26, 8:14 AM (18 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42007854
Default Alt Text
D62036.1795680896.diff (1 KB)
Attached To
Mode
D62036: powerpc: clear the inherited FSCR, TAR, DSCR, EBB and LM state with the PCB flags
Attached
Detach File
Event Timeline