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.web11.3574.1660200095179422014
 for <devel@edk2.groups.io>;
 Wed, 10 Aug 2022 23:41:35 -0700
Authentication-Results: mx.groups.io;
 dkim=pass header.i=@hpe.com header.s=pps0720 header.b=Rl5z2t3Z;
 spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=022208d17a=daniel.schaefer@hpe.com)
Received: from pps.filterd (m0150245.ppops.net [127.0.0.1])
	by mx0b-002e3701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27B6boR3032499;
	Thu, 11 Aug 2022 06:41:34 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject
 : date : message-id : content-transfer-encoding : content-type :
 mime-version; s=pps0720; bh=k6hfLSnNgROMwBs3LwxUbZFGyKi0VER5U4n45tojqOo=;
 b=Rl5z2t3ZQMdjQoEEs1h8hbozII8odPgesFnnPk/1GOKtgvIlcDvvURQ9TEbQghp4m16x
 zvQWDSz67ajavI4r1AmtN2+DzoJwT2jeMiKzL1tHER3yN3lVceeLJvuJWG1wVM21Yew3
 1UTBRXTQgJ0enKvvWE/zB7NtI92nuPr7FUHwqwV7J4K2kFouMTe8VJjbearD1lVScp8U
 mkv6jJeJ9V4unPY0MCk3xL8Iw/8/QGvCaaMt3c9dxtERWIimDJvsQIefc1YpJow27Lsl
 SQo9jn7HC0sfHfauyTaCayJhhVQ/g5THTK6jlXBLTmt/d2ZL/3/x721U2HLYArRyV29F 7g== 
Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200])
	by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3hvvnn814p-1
	(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
	Thu, 11 Aug 2022 06:41:33 +0000
Received: from p1wg14925.americas.hpqcorp.net (unknown [10.119.18.114])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by p1lg14879.it.hpe.com (Postfix) with ESMTPS id 363C2D2F5;
	Thu, 11 Aug 2022 06:41:32 +0000 (UTC)
Received: from p1wg14923.americas.hpqcorp.net (10.119.18.111) by
 p1wg14925.americas.hpqcorp.net (10.119.18.114) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.986.15; Wed, 10 Aug 2022 18:41:10 -1200
Received: from P1WG14918.americas.hpqcorp.net (16.230.19.121) by
 p1wg14923.americas.hpqcorp.net (10.119.18.111) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15
 via Frontend Transport; Wed, 10 Aug 2022 18:41:10 -1200
Received: from NAM12-BN8-obe.outbound.protection.outlook.com (192.58.206.38)
 by edge.it.hpe.com (16.230.19.121) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.986.15; Thu, 11 Aug 2022 06:41:10 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hR6hawkMU1EOGWpVDKB6StZxIZkW2pc7JMfkvk97QWVROi9F4epK1KWb2hIsr/+YtorQJ5Oq2tPxwEu/KOGr2WUzOoi9p1EnHfP2kLn9B8/Y1708SDbFzmoKhQD1c7IMKPj1tgPu8vXegZhzrcA9BZ5hlJcbs8Om0rOtvo8nHnsXdhwVuU6PwKWgiM5Ohl91DeSimt8MdowLLSyA6SEFUBeIc15dW/5lLh086KNT3i8lOgGA8rokNC5pDt892bCtKrjQu114viBY56/2cIotXN1EtTWUF5zvY0Fh+rQ86o9qLh3PpsBQwXBQz2fKg7CwtlX+r9IqwyxWLbA3sz66hQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=k6hfLSnNgROMwBs3LwxUbZFGyKi0VER5U4n45tojqOo=;
 b=hpLpP4H8VQrzvSRbTFapYIzbeps4wYgK+KnvoNXFiFhgP3dwEjCrTotNA6trHU0No4rkwnjufIh2oA9H7DG976qxcdsTo9ABjExsCEIJrTfRSSDlnKMmbHjcfOGs5sI7sKIvHBEW/tYH+UHaFQqEIonAr1fVKqGq+fbXBfJVxCXWDpD4B69jBC3LLVIv0Hh2btkInUnAPnegAt/MjNBKMeQtHshltYjcoS1xNI0aig2s+8CqbCeUJU+WX9AIviK3gEN0/1QSIYhVRLPEA9EAj6tcWEE3X93ExAee9JJ5Il26b9kLXJVilxILLun+APuTCdxLBagAAG2cyewRw2+d5w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass
 header.d=hpe.com; arc=none
Received: from MW4PR84MB1514.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1a5::13)
 by MW5PR84MB1915.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1c5::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 11 Aug
 2022 06:41:08 +0000
Received: from MW4PR84MB1514.NAMPRD84.PROD.OUTLOOK.COM
 ([fe80::d47c:8252:fca5:817e]) by MW4PR84MB1514.NAMPRD84.PROD.OUTLOOK.COM
 ([fe80::d47c:8252:fca5:817e%6]) with mapi id 15.20.5525.011; Thu, 11 Aug 2022
 06:41:08 +0000
From: "Daniel Schaefer" <daniel.schaefer@hpe.com>
To: <devel@edk2.groups.io>
CC: Sunil V L <sunilvl@ventanamicro.com>
Subject: [edk2-platforms PATCH v1 1/1] RISC-V/RiscVExceptionLib: Follow new CpuExceptionHandlerLib APIs
Date: Thu, 11 Aug 2022 14:40:57 +0800
Message-Id: <20220811064057.1833908-1-daniel.schaefer@hpe.com>
X-Mailer: git-send-email 2.36.0
X-ClientProxiedBy: TYWPR01CA0001.jpnprd01.prod.outlook.com
 (2603:1096:400:a9::6) To MW4PR84MB1514.NAMPRD84.PROD.OUTLOOK.COM
 (2603:10b6:303:1a5::13)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: c715519a-78bc-4e82-14e5-08da7b64791b
X-MS-TrafficTypeDiagnostic: MW5PR84MB1915:EE_
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 3SPfqfFXBOPGEyMzpf6KdKR0fjJfLwz0FhD8OFCqj73/479Xc7eWPwQmdqZblz0qDs9T8hJ6uHRkPJFZ1wAFWP7Dk/zEPAHFb1qdkzGi10wFhtE8Du7UOi1xLGJL5STQ9pzMUPL/ZTr/sJUcaKtYULdYlOJQGa5fpBjoX5nSv4Pw1FsCsnTYPslw0KMmiwVWleBf78Mpo3mTKgOkbFiDr6+PtH0IkQ+/W3G0LCEYtpLrw7yDMdRNGJWM1NcCG0O2q70OfkHIcaseOuYZthY+Y5iMfhSfaS3FRDm/gYGOisZN1cNtjGYL40A4A8D62T4lrUocTkHhlgKFhBaAYB9TgexRdwVTYcPQszsk1V7WsNQBeRJKRIkwvWDZ2b9ge0qSBU+TLFlvzk/F1Df6zKKw9EkGcsm1/y8MdFTyWvQWecHd0K43d3mU2aztAuooz/4GM9HRIy6RZPSFGjz4GbOFanrVjVZoMqwVblEqvTMqnoNRljFzJEoDotm4yav/Gksc3L+wniGuW60rbQdgFwHX3aa1G0d7pzEvWDmB5Z1y8j4vYjFuWyOui9Ep9MTPUdWVRJKkHdAy6xhWIA+sv/K1ot7NMyC7GtuzLzrjgEfb3Y/vuDNbURDaLfcL60C01dAQFHVxM4O9whuN7RcoZ0DUd3n10tmLLjOGOJTtctigfPDMHmLtw3JwDHXMhSVm3/QePbMEfKFW/pg/mKnlf7u3OEWo9B5qMEXGNZmHqxtzZi/BgSo1WgTwNwjiUs824zaaR76N0UFA7SCHBeBdxK2HMOVgWNgXIGOS9dhAEpjkeVs=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR84MB1514.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(39860400002)(366004)(346002)(376002)(136003)(396003)(26005)(82960400001)(6512007)(38350700002)(38100700002)(44832011)(6486002)(5660300002)(8936002)(86362001)(478600001)(52116002)(6506007)(6666004)(41300700001)(2906002)(4326008)(8676002)(66556008)(66946007)(6916009)(66476007)(36756003)(83380400001)(2616005)(1076003)(186003)(316002);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6UJCCmpAcdz8Nr7q3bMnH8txdM0OoqGkS4iYrpHRBVZPhuTx/ez8tZkIlYVY?=
 =?us-ascii?Q?XqDLoaA0BUBOEOplWZ7qyIGLTlhEBCcOykXnHeS8tECmgCyweGJSqtb+l+cj?=
 =?us-ascii?Q?Kn3RCVrnqAEcDrSaEF7Fyj002IaMCJpzewV/vH/bq7BckpUFfYpI3eE8DPK6?=
 =?us-ascii?Q?DzzwmWal//tPc8xvHJq3HjIzAUnXLkSLk3SJkjRkKAHpwjcAk9ObnOJlIDtf?=
 =?us-ascii?Q?j9/tfqBWhwAgISiP1c0rddr24QwhD2kpedtWLe6YoLZz7h2Q0ZwvWI40c29o?=
 =?us-ascii?Q?qL6b8QJGd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T/Nr5w4Mg6LHS5kydZTrXhYwnabPzMf?=
 =?us-ascii?Q?6ztMNaxPmFsvxSNLzdAnNdUZ+qGZ/K/U0x+zpxl+sLd5nKpQN1uSstjocJhn?=
 =?us-ascii?Q?mBan2lSmkQoZ01f6SpsxQhyaQ4N5Bvx45JmyV0Jk2AFDWWhiLppoilXJ69fD?=
 =?us-ascii?Q?lM/jep+TJtxKIsJnMukTDFSJHtRkgTsCqFc0qSCcWNUk0oAHqtrzKnkxkpMq?=
 =?us-ascii?Q?QLW7GJKDsR+sPDkz8z7LqlSghKZNROo4pupf/dsUwB4OoWgwUGxmLf2iJEL3?=
 =?us-ascii?Q?FGAJCirodFgHqDv3c+Qi4PIhf4wFmmOl8U4fTF7RarSKj9r40Aqsiy3+HXIB?=
 =?us-ascii?Q?1N52jgfWjrJBdhXTLHEG+ZdO/jzpp7z2w6oyGn/bNgqFH4MZ2MWhPIOrn+aE?=
 =?us-ascii?Q?HvFD7hauq5izYci8I6C/Q0hOgpTOX7kyNVaZfao9OUCs12pGe93b88ra9uK6?=
 =?us-ascii?Q?6A=3D=3D?=
X-MS-Exchange-CrossTenant-Network-Message-Id: c715519a-78bc-4e82-14e5-08da7b64791b
X-MS-Exchange-CrossTenant-AuthSource: MW4PR84MB1514.NAMPRD84.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2022 06:41:08.7141
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WMBkLabtRlYvgVDVuqHEOpSbLLmC8fjJo0RlGl9np1KluIJmYGVMn/daX7dh44uOPSID7Tv8RhQQsHZcG5pYVA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR84MB1915
X-OriginatorOrg: hpe.com
X-Proofpoint-ORIG-GUID: AEjo6phg-b4x3o84B-94sBc7SmlfH0_D
X-Proofpoint-GUID: AEjo6phg-b4x3o84B-94sBc7SmlfH0_D
X-HPE-SCL: -1
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1
 definitions=2022-08-11_03,2022-08-10_01,2022-06-22_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0
 bulkscore=0 clxscore=1015 impostorscore=0 spamscore=0 suspectscore=0
 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2207270000 definitions=main-2208110017
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain

CpuExceptionHandlerLib (in EDK2) has been refactored with following changes
1. Removed InitializeCpuInterruptHandlers in 2a09527ebcb459b40
2. Removed InitializeCpuExceptionHandlersEx and
   added InitializeSeparateExceptionStacks in e7abb94d1fb8a0e7

The patch updates RISC-V version of CpuExceptionHandlerLib to follow
the API changes, based on the ARM changes in e2ae0bed29ca0900bd35.

The functionality to RISC-V platforms should be none.

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerL=
ib.c | 82 ++++++--------------
 1 file changed, 24 insertions(+), 58 deletions(-)

diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExcep=
tionHandlerLib.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/Cp=
uExceptionHandlerLib.c
index 93fbde619f..c3ced4a4c2 100644
--- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHan=
dlerLib.c
+++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHan=
dlerLib.c
@@ -44,31 +44,6 @@ InitializeCpuExceptionHandlers (
   return EFI_SUCCESS;=0D
 }=0D
 =0D
-/**=0D
-  Initializes all CPU interrupt/exceptions entries and provides the defaul=
t interrupt/exception handlers.=0D
-=0D
-  Caller should try to get an array of interrupt and/or exception vectors =
that are in use and need to=0D
-  persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.=0D
-  If caller cannot get reserved vector list or it does not exists, set Vec=
torInfo to NULL.=0D
-  If VectorInfo is not NULL, the exception vectors will be initialized per=
 vector attribute accordingly.=0D
-=0D
-  @param[in]  VectorInfo    Pointer to reserved vector list.=0D
-=0D
-  @retval EFI_SUCCESS           All CPU interrupt/exception entries have b=
een successfully initialized=0D
-                                with default interrupt/exception handlers.=
=0D
-  @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if=
 VectorInfo is not NULL.=0D
-  @retval EFI_UNSUPPORTED       This function is not supported.=0D
-=0D
-**/=0D
-EFI_STATUS=0D
-EFIAPI=0D
-InitializeCpuInterruptHandlers (=0D
-  IN EFI_VECTOR_HANDOFF_INFO  *VectorInfo OPTIONAL=0D
-  )=0D
-{=0D
-  return EFI_SUCCESS;=0D
-}=0D
-=0D
 /**=0D
   Registers a function to be called from the processor interrupt handler.=
=0D
 =0D
@@ -134,39 +109,6 @@ RiscVSupervisorModeTrapHandler (
   }=0D
 }=0D
 =0D
-/**=0D
-  Initializes all CPU exceptions entries with optional extra initializatio=
ns.=0D
-=0D
-  By default, this method should include all functionalities implemented b=
y=0D
-  InitializeCpuExceptionHandlers(), plus extra initialization works, if an=
y.=0D
-  This could be done by calling InitializeCpuExceptionHandlers() directly=
=0D
-  in this method besides the extra works.=0D
-=0D
-  InitData is optional and its use and content are processor arch dependen=
t.=0D
-  The typical usage of it is to convey resources which have to be reserved=
=0D
-  elsewhere and are necessary for the extra initializations of exception.=
=0D
-=0D
-  @param[in]  VectorInfo    Pointer to reserved vector list.=0D
-  @param[in]  InitData      Pointer to data optional for extra initializat=
ions=0D
-                            of exception.=0D
-=0D
-  @retval EFI_SUCCESS             The exceptions have been successfully=0D
-                                  initialized.=0D
-  @retval EFI_INVALID_PARAMETER   VectorInfo or InitData contains invalid=
=0D
-                                  content.=0D
-  @retval EFI_UNSUPPORTED         This function is not supported.=0D
-=0D
-**/=0D
-EFI_STATUS=0D
-EFIAPI=0D
-InitializeCpuExceptionHandlersEx (=0D
-  IN EFI_VECTOR_HANDOFF_INFO  *VectorInfo OPTIONAL,=0D
-  IN CPU_EXCEPTION_INIT_DATA  *InitData OPTIONAL=0D
-  )=0D
-{=0D
-  return InitializeCpuExceptionHandlers (VectorInfo);=0D
-}=0D
-=0D
 /**=0D
   The constructor function to initial interrupt handlers in=0D
   RISCV_MACHINE_MODE_CONTEXT.=0D
@@ -192,3 +134,27 @@ CpuExceptionHandlerLibConstructor (
 =0D
   return EFI_SUCCESS;=0D
 }=0D
+=0D
+/**=0D
+  Setup separate stacks for certain exception handlers.=0D
+  If the input Buffer and BufferSize are both NULL, use global variable if=
 possible.=0D
+=0D
+  @param[in]       Buffer        Point to buffer used to separate exceptio=
n stack.=0D
+  @param[in, out]  BufferSize    On input, it indicates the byte size of B=
uffer.=0D
+                                 If the size is not enough, the return sta=
tus will=0D
+                                 be EFI_BUFFER_TOO_SMALL, and output Buffe=
rSize=0D
+                                 will be the size it needs.=0D
+=0D
+  @retval EFI_SUCCESS             The stacks are assigned successfully.=0D
+  @retval EFI_UNSUPPORTED         This function is not supported.=0D
+  @retval EFI_BUFFER_TOO_SMALL    This BufferSize is too small.=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+InitializeSeparateExceptionStacks (=0D
+  IN     VOID   *Buffer,=0D
+  IN OUT UINTN  *BufferSize=0D
+  )=0D
+{=0D
+  return EFI_SUCCESS;=0D
+}=0D
--=20
2.36.0