Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F95372485
D43304.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D43304.diff
View Options
diff --git a/sys/arm64/arm64/swtch.S b/sys/arm64/arm64/swtch.S
--- a/sys/arm64/arm64/swtch.S
+++ b/sys/arm64/arm64/swtch.S
@@ -270,9 +270,7 @@
/* Store the VFP registers */
#ifdef VFP
mov x28, lr
- mov x1, x0 /* move pcb to the correct register */
- mov x0, xzr /* td = NULL */
- bl vfp_save_state
+ bl vfp_save_state_savectx
mov lr, x28
#endif
diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c
--- a/sys/arm64/arm64/vfp.c
+++ b/sys/arm64/arm64/vfp.c
@@ -166,25 +166,11 @@
: : "r"(fpcr), "r"(fpsr), "r"(vfp_state));
}
-void
-vfp_save_state(struct thread *td, struct pcb *pcb)
+static void
+vfp_save_state_common(struct thread *td, struct pcb *pcb)
{
uint32_t cpacr;
- KASSERT(pcb != NULL, ("NULL vfp pcb"));
- KASSERT(td == NULL || td->td_pcb == pcb, ("Invalid vfp pcb"));
-
- /*
- * savectx() will be called on panic with dumppcb as an argument,
- * dumppcb doesn't have pcb_fpusaved set, so set it to save
- * the VFP registers.
- */
- if (pcb->pcb_fpusaved == NULL)
- pcb->pcb_fpusaved = &pcb->pcb_fpustate;
-
- if (td == NULL)
- td = curthread;
-
critical_enter();
/*
* Only store the registers if the VFP is enabled,
@@ -202,6 +188,30 @@
critical_exit();
}
+void
+vfp_save_state(struct thread *td, struct pcb *pcb)
+{
+ KASSERT(td != NULL, ("NULL vfp thread"));
+ KASSERT(pcb != NULL, ("NULL vfp pcb"));
+ KASSERT(td->td_pcb == pcb, ("Invalid vfp pcb"));
+
+ vfp_save_state_common(td, pcb);
+}
+
+void
+vfp_save_state_savectx(struct pcb *pcb)
+{
+ /*
+ * savectx() will be called on panic with dumppcb as an argument,
+ * dumppcb doesn't have pcb_fpusaved set, so set it to save
+ * the VFP registers.
+ */
+ MPASS(pcb->pcb_fpusaved == NULL);
+ pcb->pcb_fpusaved = &pcb->pcb_fpustate;
+
+ vfp_save_state_common(curthread, pcb);
+}
+
/*
* Update the VFP state for a forked process or new thread. The PCB will
* have been copied from the old thread.
diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h
--- a/sys/arm64/include/vfp.h
+++ b/sys/arm64/include/vfp.h
@@ -78,6 +78,7 @@
void vfp_reset_state(struct thread *, struct pcb *);
void vfp_restore_state(void);
void vfp_save_state(struct thread *, struct pcb *);
+void vfp_save_state_savectx(struct pcb *);
struct fpu_kern_ctx;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 21, 12:49 PM (1 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12380476
Default Alt Text
D43304.diff (2 KB)
Attached To
Mode
D43304: arm64: Split out a savectx version of vfp_save_state
Attached
Detach File
Event Timeline
Log In to Comment