diff options
author | Abner Chang <abner.chang@hpe.com> | 2021-07-21 18:55:13 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-07-21 12:34:13 +0000 |
commit | 097aeeb119538a60f68355f1c3ac47df1834c90a (patch) | |
tree | e3bbcab05c88f35bea16042f62c903b9e0a48b83 /MdePkg/Library | |
parent | c32c5911c41fa691a5333e7567003cc124e7ab5f (diff) | |
download | edk2-097aeeb119538a60f68355f1c3ac47df1834c90a.tar.gz edk2-097aeeb119538a60f68355f1c3ac47df1834c90a.tar.bz2 edk2-097aeeb119538a60f68355f1c3ac47df1834c90a.zip |
MdePkg/BaseLib: Add MemoryFence implementation for RiscV64
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdePkg/Library')
-rw-r--r-- | MdePkg/Library/BaseLib/BaseLib.inf | 3 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 22 |
2 files changed, 24 insertions, 1 deletions
diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf index 6ccb8997b7..6efa5315b6 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -4,7 +4,7 @@ # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+# Copyright (c) 2020 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -401,6 +401,7 @@ RiscV64/DisableInterrupts.c
RiscV64/EnableInterrupts.c
RiscV64/CpuPause.c
+ RiscV64/MemoryFence.S | GCC
RiscV64/RiscVSetJumpLongJump.S | GCC
RiscV64/RiscVCpuBreakpoint.S | GCC
RiscV64/RiscVCpuPause.S | GCC
diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S new file mode 100644 index 0000000000..cc81683692 --- /dev/null +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------
+//
+// MemoryFence() for RiscV64
+//
+// Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+//------------------------------------------------------------------------------
+
+.text
+.p2align 2
+
+ASM_GLOBAL ASM_PFX(MemoryFence)
+
+//
+// Memory fence for RiscV64
+//
+//
+ASM_PFX(MemoryFence):
+ fence // Fence on all memory and I/O
+ ret
|