Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177839955
D38696.1795405908.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
D38696.1795405908.diff
View Options
diff --git a/sys/arm/arm/exec_machdep.c b/sys/arm/arm/exec_machdep.c
--- a/sys/arm/arm/exec_machdep.c
+++ b/sys/arm/arm/exec_machdep.c
@@ -100,19 +100,18 @@
{
struct pcb *pcb;
- MPASS(td == curthread);
+ MPASS(td == curthread || TD_IS_SUSPENDED(td) ||
+ P_SHOULDSTOP(td->td_proc));
pcb = td->td_pcb;
- if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
+ if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0 && td == curthread) {
critical_enter();
vfp_store(&pcb->pcb_vfpstate, false);
critical_exit();
}
KASSERT(pcb->pcb_vfpsaved == &pcb->pcb_vfpstate,
("Called get_vfpcontext while the kernel is using the VFP"));
- memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg,
- sizeof(vfp->mcv_reg));
- vfp->mcv_fpscr = pcb->pcb_vfpstate.fpscr;
+ memcpy(vfp, &pcb->pcb_vfpstate, sizeof(*vfp));
}
/*
@@ -123,19 +122,15 @@
{
struct pcb *pcb;
- MPASS(td == curthread);
-
pcb = td->td_pcb;
- if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
+ if (td == curthread) {
critical_enter();
vfp_discard(td);
critical_exit();
}
KASSERT(pcb->pcb_vfpsaved == &pcb->pcb_vfpstate,
("Called set_vfpcontext while the kernel is using the VFP"));
- memcpy(pcb->pcb_vfpstate.reg, vfp->mcv_reg,
- sizeof(pcb->pcb_vfpstate.reg));
- pcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr;
+ memcpy(&pcb->pcb_vfpstate, vfp, sizeof(*vfp));
}
#endif
diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c
--- a/sys/arm/arm/vfp.c
+++ b/sys/arm/arm/vfp.c
@@ -334,8 +334,6 @@
* The current thread is dying. If the state currently in the hardware belongs
* to the current thread, set fpcurthread to NULL to indicate that the VFP
* hardware state does not belong to any thread. If the VFP is on, turn it off.
- * Called only from cpu_throw(), so we don't have to worry about a context
- * switch here.
*/
void
vfp_discard(struct thread *td)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 3:51 AM (11 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41922105
Default Alt Text
D38696.1795405908.diff (1 KB)
Attached To
Mode
D38696: arm: Unbreak debugging programs that use FP instructions
Attached
Detach File
Event Timeline