(This is migrated from edk2-platforms:Platform/RISC-V)
NULL instance of RISC-V Platform Temporary Memory library.

Signed-off-by: Abner Chang <abner.ch...@hpe.com>
Co-authored-by: Gilbert Chen <gilbert.c...@hpe.com>
Reviewed-by: Leif Lindholm <leif.lindh...@linaro.org>

Cc: Leif Lindholm <leif.lindh...@linaro.org>
Cc: Gilbert Chen <gilbert.c...@hpe.com>
---
 .../RiscVPlatformTempMemoryInitLibNull.inf    | 38 +++++++++++++++++++
 .../Library/RiscVPlatformTempMemoryInitLib.h  | 17 +++++++++
 .../Riscv64/TempMemInit.S                     | 26 +++++++++++++
 3 files changed, 81 insertions(+)
 create mode 100644 
Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf
 create mode 100644 
Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h
 create mode 100644 
Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S

diff --git 
a/Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf
 
b/Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf
new file mode 100644
index 0000000000..1634a05f58
--- /dev/null
+++ 
b/Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf
@@ -0,0 +1,38 @@
+## @file
+# RISC-V platform temporary memory library.
+#
+# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights 
reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x0001001b
+  BASE_NAME                      = RiscVPlatformTempMemoryInitLibNull
+  FILE_GUID                      = 67294857-C0F8-4ACB-8237-D91FE506B710
+  MODULE_TYPE                    = SEC
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = RiscVPlatformTempMemoryInitLib
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES           = RISCV64
+#
+
+[Sources]
+
+[Sources.RISCV64]
+  Riscv64/TempMemInit.S
+
+[Pcd]
+  gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamBase
+  gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec
+
+
diff --git 
a/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h 
b/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h
new file mode 100644
index 0000000000..4f9f7950c1
--- /dev/null
+++ 
b/Platform/RISC-V/PlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h
@@ -0,0 +1,17 @@
+/** @file
+  RISC-V package definitions.
+
+  Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All 
rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef RISCV_PLATFORM_TEMP_MEM_LIB_H_
+#define RISCV_PLATFORM_TEMP_MEM_LIB_H_
+
+#include "RiscVImpl.h"
+
+VOID EFIAPI   RiscVPlatformTemporaryMemInit (VOID);
+UINT32 EFIAPI RiscVPlatformTemporaryMemSize (VOID);
+UINT32 EFIAPI RiscVPlatformTemporaryMemBase (VOID);
+#endif
diff --git 
a/Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S
 
b/Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S
new file mode 100644
index 0000000000..c8fb43c604
--- /dev/null
+++ 
b/Platform/RISC-V/PlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// RISC-V RiscVPlatformTemporaryMemInit.
+//
+// Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All 
rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+//------------------------------------------------------------------------------
+#include <Base.h>
+
+.data
+
+.text
+.align 3
+
+.global ASM_PFX(RiscVPlatformTemporaryMemInit)
+
+//
+// @retval  a0 Temporary memory base.
+//          a1 Temporary memory size.
+//
+ASM_PFX(RiscVPlatformTemporaryMemInit):
+    li      a0, FixedPcdGet32 (PcdTemporaryRamBase)
+    li      a1, FixedPcdGet32 (PcdTemporaryRamSize)
+    ret
-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85354): https://edk2.groups.io/g/devel/message/85354
Mute This Topic: https://groups.io/mt/88278527/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to