summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm64/arm64/vfp.c17
-rw-r--r--sys/arch/arm64/include/vfp.h4
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/arch/arm64/arm64/vfp.c b/sys/arch/arm64/arm64/vfp.c
index 917879cdd2c..2906d636eb3 100644
--- a/sys/arch/arm64/arm64/vfp.c
+++ b/sys/arch/arm64/arm64/vfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfp.c,v 1.3 2018/01/26 16:15:26 kettenis Exp $ */
+/* $OpenBSD: vfp.c,v 1.4 2018/07/02 07:23:37 kettenis Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
@@ -253,3 +253,18 @@ vfp_discard(struct proc *p)
curpcb->pcb_fpcpu = NULL;
}
}
+
+void
+vfp_kernel_enter(void)
+{
+ struct cpu_info *ci = curcpu();
+
+ ci->ci_fpuproc = NULL;
+ set_vfp_enable(1);
+}
+
+void
+vfp_kernel_exit(void)
+{
+ set_vfp_enable(0);
+}
diff --git a/sys/arch/arm64/include/vfp.h b/sys/arch/arm64/include/vfp.h
index 68db2067713..cc060163130 100644
--- a/sys/arch/arm64/include/vfp.h
+++ b/sys/arch/arm64/include/vfp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfp.h,v 1.3 2018/01/26 16:15:26 kettenis Exp $ */
+/* $OpenBSD: vfp.h,v 1.4 2018/07/02 07:23:37 kettenis Exp $ */
/*-
* Copyright (c) 2015 The FreeBSD Foundation
* All rights reserved.
@@ -43,6 +43,8 @@ void vfp_discard(struct proc *);
void vfp_save(void);
void vfp_enable(void);
int vfp_fault(vaddr_t, uint32_t, trapframe_t *, int);
+void vfp_kernel_enter(void);
+void vfp_kernel_exit(void);
#endif
#endif