git: 255adf35c0b9 - main - Export arm64 VFP handling functions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 24 May 2023 10:59:26 UTC
The branch main has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=255adf35c0b928e43c82ade2a491eea51e71383f
commit 255adf35c0b928e43c82ade2a491eea51e71383f
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-05-16 10:08:03 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-05-24 10:55:38 +0000
Export arm64 VFP handling functions
These will be used by bhyve to manage the host VFP registers, e.g.
saving the host state before entering a guest.
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40130
---
sys/arm64/arm64/vfp.c | 8 ++++----
sys/arm64/include/vfp.h | 4 ++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c
index 49a83d3fe71f..22b15ee78596 100644
--- a/sys/arm64/arm64/vfp.c
+++ b/sys/arm64/arm64/vfp.c
@@ -57,7 +57,7 @@ struct fpu_kern_ctx {
struct vfpstate state;
};
-static void
+void
vfp_enable(void)
{
uint32_t cpacr;
@@ -68,7 +68,7 @@ vfp_enable(void)
isb();
}
-static void
+void
vfp_disable(void)
{
uint32_t cpacr;
@@ -99,7 +99,7 @@ vfp_discard(struct thread *td)
vfp_disable();
}
-static void
+void
vfp_store(struct vfpstate *state)
{
__uint128_t *vfp_state;
@@ -131,7 +131,7 @@ vfp_store(struct vfpstate *state)
state->vfp_fpsr = fpsr;
}
-static void
+void
vfp_restore(struct vfpstate *state)
{
__uint128_t *vfp_state;
diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h
index a450a5f31fdd..4f64b0396417 100644
--- a/sys/arm64/include/vfp.h
+++ b/sys/arm64/include/vfp.h
@@ -67,7 +67,11 @@ struct pcb;
struct thread;
void vfp_init(void);
+void vfp_enable(void);
+void vfp_disable(void);
void vfp_discard(struct thread *);
+void vfp_store(struct vfpstate *);
+void vfp_restore(struct vfpstate *);
void vfp_new_thread(struct thread *, struct thread *, bool);
void vfp_reset_state(struct thread *, struct pcb *);
void vfp_restore_state(void);