summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/BaseRiscVFpuLib/RiscVFpuCore.S
diff options
context:
space:
mode:
Diffstat (limited to 'UefiCpuPkg/Library/BaseRiscVFpuLib/RiscVFpuCore.S')
-rw-r--r--UefiCpuPkg/Library/BaseRiscVFpuLib/RiscVFpuCore.S22
1 files changed, 22 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/BaseRiscVFpuLib/RiscVFpuCore.S b/UefiCpuPkg/Library/BaseRiscVFpuLib/RiscVFpuCore.S
new file mode 100644
index 0000000000..b439af4e42
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseRiscVFpuLib/RiscVFpuCore.S
@@ -0,0 +1,22 @@
+/** @file
+*
+* Copyright (c) 2024, Canonical Services Ltd
+*
+* SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+**/
+
+#include <Library/BaseRiscVFpuLib.h>
+#include <Register/RiscV64/RiscVImpl.h>
+
+//
+// Initialize floating point unit
+//
+ASM_FUNC (RiscVInitializeFpu)
+ csrr a0, CSR_SSTATUS
+ li a1, MSTATUS_FS
+ or a0, a0, a1
+ csrw CSR_SSTATUS, a0
+ csrw CSR_FCSR, x0
+ li a0, 0
+ ret