From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.565.1572229916522457786 for ; Sun, 27 Oct 2019 19:31:56 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=02044412f4=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9S2Vj9Z008661; Mon, 28 Oct 2019 02:31:55 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 2vvd90rwxy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2019 02:31:55 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 1EDC154; Mon, 28 Oct 2019 02:31:55 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id BFFC548; Mon, 28 Oct 2019 02:31:53 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Leif Lindholm , Gilbert Chen Subject: [edk2-staging/RISC-V-V2 PATCH v3 22/39] RiscVPlatformPkg/RiscVPlatformTempMemoryInit: RISC-V Platform Temporary Memory library Date: Mon, 28 Oct 2019 09:59:00 +0800 Message-Id: <1572227957-13169-23-git-send-email-abner.chang@hpe.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572227957-13169-1-git-send-email-abner.chang@hpe.com> References: <1572227957-13169-1-git-send-email-abner.chang@hpe.com> X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-27_09:2019-10-25,2019-10-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=935 malwarescore=0 spamscore=0 suspectscore=1 priorityscore=1501 mlxscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910280025 NULL instance of RISC-V Platform Temporary Memory library. Signed-off-by: Abner Chang Cc: Leif Lindholm Cc: Gilbert Chen --- .../RiscVPlatformTempMemoryInitLibNull.inf | 34 ++++++++++++++++++++++ .../Library/RiscVPlatformTempMemoryInitLib.h | 17 +++++++++++ .../Riscv64/TempMemInit.S | 26 +++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf create mode 100644 RiscVPlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h create mode 100644 RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S diff --git a/RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf b/RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf new file mode 100644 index 0000000..12fa497 --- /dev/null +++ b/RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/RiscVPlatformTempMemoryInitLibNull.inf @@ -0,0 +1,34 @@ +## @file +# RISC-V platform temporary memory library. +# +# Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights reserved.
+# +# 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 + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RiscVPkg/RiscVPkg.dec + + diff --git a/RiscVPlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h b/RiscVPlatformPkg/Include/Library/RiscVPlatformTempMemoryInitLib.h new file mode 100644 index 0000000..4f9f795 --- /dev/null +++ b/RiscVPlatformPkg/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.
+ + 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/RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S b/RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S new file mode 100644 index 0000000..61a9923 --- /dev/null +++ b/RiscVPlatformPkg/Library/RiscVPlatformTempMemoryInitLibNull/Riscv64/TempMemInit.S @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// RISC-V RiscVPlatformTemporaryMemInit. +// +// Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +//------------------------------------------------------------------------------ +#include + +.data + +.text +.align 3 + +.global ASM_PFX(RiscVPlatformTemporaryMemInit) + +// +// @retval a0 Temporary memory base. +// a1 Temporary memory size. +// +ASM_PFX(RiscVPlatformTemporaryMemInit): + li a0, FixedPcdGet32 (PcdRiscVSecPeiTempRamBase) + li a1, FixedPcdGet32 (PcdRiscVSecPeiTempRamSize) + ret -- 2.7.4