From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0142e58505=abner.chang@hpe.com) Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by groups.io with SMTP; Mon, 26 Aug 2019 23:31:07 -0700 Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7R6V6jZ003130 for ; Tue, 27 Aug 2019 06:31:06 GMT Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com with ESMTP id 2umx0s0j66-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 06:31:06 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id C4A0CC3 for ; Tue, 27 Aug 2019 06:30:51 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.44]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id DA48A36; Tue, 27 Aug 2019 06:30:50 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com Subject: [edk2-staging/RISC-V PATCH v1 14/14]: MdeModulePkg/DxeIplPeim: Abstract platform DXEIPL on RISC-V platform. Date: Tue, 27 Aug 2019 14:00:32 +0800 Message-Id: <1566885632-5747-14-git-send-email-abner.chang@hpe.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566885632-5747-1-git-send-email-abner.chang@hpe.com> References: <1566885632-5747-1-git-send-email-abner.chang@hpe.com> X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-26_08:2019-08-26,2019-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxscore=0 priorityscore=1501 adultscore=0 mlxlogscore=723 impostorscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=1 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1908270072 Provide DxeIpl platform implementation-specifc library for RISC-V platform. Two libraries are provided in this commit, * Defualt library which simply switch stack and transfer control to DXE core. * Switch stack, privilege mode and then transfer control to DXE core through RISC-V opensbi. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abner Chang --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 9 ++++++++- MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c | 11 ++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf index ea79536..b4c35e5 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf @@ -6,7 +6,7 @@ # needed to run the DXE Foundation. # # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-# Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights reserved.
+# Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -68,6 +68,9 @@ [Packages.ARM, Packages.AARCH64] ArmPkg/ArmPkg.dec +[Packages.RISCV64] + RiscVPkg/RiscVPkg.dec + [LibraryClasses] PcdLib MemoryAllocationLib @@ -86,6 +89,10 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64] ArmLib +[LibraryClasses.RISCV64] + RiscVPlatformDxeIplLib + RiscVOpensbiLib + [Ppis] gEfiDxeIplPpiGuid ## PRODUCES gEfiPeiDecompressPpiGuid ## PRODUCES diff --git a/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c index 2d5c7b9..934dfa5 100644 --- a/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c +++ b/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c @@ -1,7 +1,7 @@ /** @file RISC-V specific functionality for DxeLoad. - Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights reserved.
+ Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -13,6 +13,7 @@ **/ #include "DxeIpl.h" +#include "Library/RiscVPlatformDxeIpl.h" typedef VOID* @@ -70,10 +71,6 @@ HandOffToDxeCore ( // // Transfer the control to the entry point of DxeCore. // - SwitchStack ( - (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint, - HobList.Raw, - NULL, - TopOfStack - ); + RiscVPlatformHandOffToDxeCore (BaseOfStack, TopOfStack, DxeCoreEntryPoint, HobList); } + -- 2.7.4