diff options
author | 2018-07-02 07:25:29 +0000 | |
---|---|---|
committer | 2018-07-02 07:25:29 +0000 | |
commit | 03194932872f3b6ed4d30b75c946d201eaf8a6c2 (patch) | |
tree | 03d918dea77fedcb0856a9552d72f6fa73901184 | |
parent | Add functions to allow the use of the FPU in the kernel. (diff) | |
download | wireguard-openbsd-03194932872f3b6ed4d30b75c946d201eaf8a6c2.tar.xz wireguard-openbsd-03194932872f3b6ed4d30b75c946d201eaf8a6c2.zip |
Enable the FPU when calling EFI runtime services. The new UEFI firmware for
the od1000 that I built myself seems to use the FPU when setting the RTC,
and the UEFI standard allows this.
ok drahn@
-rw-r--r-- | sys/arch/arm64/dev/efi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/efi.c b/sys/arch/arm64/dev/efi.c index f82aac00210..ad735492cbb 100644 --- a/sys/arch/arm64/dev/efi.c +++ b/sys/arch/arm64/dev/efi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efi.c,v 1.5 2018/06/24 10:38:44 kettenis Exp $ */ +/* $OpenBSD: efi.c,v 1.6 2018/07/02 07:25:29 kettenis Exp $ */ /* * Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org> @@ -25,6 +25,7 @@ #include <machine/cpufunc.h> #include <machine/bus.h> #include <machine/fdt.h> +#include <machine/vfp.h> #include <dev/ofw/openfirm.h> #include <dev/ofw/fdt.h> @@ -215,6 +216,8 @@ efi_enter(struct efi_softc *sc) WRITE_SPECIALREG(ttbr0_el1, pmap_kernel()->pm_pt0pa); __asm volatile("isb"); cpu_setttb(pm->pm_asid, pm->pm_pt0pa); + + vfp_kernel_enter(); } void @@ -222,6 +225,8 @@ efi_leave(struct efi_softc *sc) { struct pmap *pm = curcpu()->ci_curpm; + vfp_kernel_exit(); + WRITE_SPECIALREG(ttbr0_el1, pmap_kernel()->pm_pt0pa); __asm volatile("isb"); cpu_setttb(pm->pm_asid, pm->pm_pt0pa); |