summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-09-16 23:12:18 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-04 04:53:21 +0000
commitf8c738577f813bbe6cb017cfbb29b70582ab32b4 (patch)
tree912940249114ed2b0d925ad527a577cbd3cf172e /UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
parent28dd588ca80c61c4bea9294785d5d884ad3f2c41 (diff)
downloadedk2-f8c738577f813bbe6cb017cfbb29b70582ab32b4.tar.gz
UefiCpuPkg: RiscV64: initialize FPU
The OpenSSL library uses floating point registers. The is no guarantee that a prior firmware stage has enabled the FPU. Provide a library BaseRiscVFpuLib to * Enable the FPU and set it to state 'dirty'. * Clear the fcsr CSR. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c')
-rw-r--r--UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
index c6bae100a9..6a22e01711 100644
--- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
@@ -360,6 +360,12 @@ InitializeCpu (
ASSERT_EFI_ERROR (Status);
//
+ // Initialize FPU
+ //
+ Status = RiscVInitializeFpu ();
+ ASSERT_EFI_ERROR (Status);
+
+ //
// Install Boot protocol
//
Status = gBS->InstallProtocolInterface (