mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
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>
23 lines
416 B
ArmAsm
23 lines
416 B
ArmAsm
/** @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
|