MdePkg: Add LoongArch64 FPU function set into BaseCpuLib

Adding InitializeFloatingPointUnits, EnableFloatingPointUnits and
DisableFloatingPointUnits functions for LoongArch64.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Chao Li
2024-01-03 10:27:56 +08:00
committed by Liming Gao
parent 9e1576bc10
commit e5b5073153
5 changed files with 128 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
#------------------------------------------------------------------------------
#
# EnableFloatingPointUnits() for LoongArch64
#
# Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#------------------------------------------------------------------------------
ASM_GLOBAL ASM_PFX(EnableFloatingPointUnits)
ASM_PFX(EnableFloatingPointUnits):
li.w $t0, 0x1
csrxchg $t0, $t0, 0x2
jirl $zero, $ra, 0
.end