From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mx.groups.io with SMTP id smtpd.web11.4511.1665396772823136337 for ; Mon, 10 Oct 2022 03:12:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=S+lMIyGs; spf=pass (domain: ventanamicro.com, ip: 209.85.210.178, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pf1-f178.google.com with SMTP id d10so10357354pfh.6 for ; Mon, 10 Oct 2022 03:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FjLB6WWGTyj5Q+LXDnwhCErAFxXVOUcGfXdwiHjEpos=; b=S+lMIyGsGi6YRq9nYEimnYLFDnbgF10TlGW82zoLTBoqQpaeKRuGooOFH2dDF0Fywl 61PKGtY1EzfeflvNcJ0k2mHjVQdJfxPuKWYjgRrtqcWGvBozf4wVi4JT86CExM6FXN5R cgRcYP8MP3G3QDYuCXCvUuQj9Lk3JhHTpx5WP9M0eggBbeAIXjvOtC63kQj8mTvHGpYc nEzvEGbo46B+raBPIbEU9tfM1qUnbjkm2CO5WdFE2qS1AGGKb9M8cGHVL6RB60lKnr/b gRKjbHHK9e8JVFNMELKvwPxWBiYgs2QKYZhJ2QTqXCjTExxX5f9xt4GyBNL+MYZWaaqZ 1DTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FjLB6WWGTyj5Q+LXDnwhCErAFxXVOUcGfXdwiHjEpos=; b=3SlKQGWYh3zASmvFsQ+MthtOkRBsOuHgjYJeD+X+7jx5GMDVAVSwz0dlTijYCjWe++ Uzcsu3NILf9X8Lq3ejxwtwbuKv5lf7FI5sFOHVoPUkSPVmCi+GrtJ/Tv6RU8Fk7PgVj1 OSAQI8S6+b3G1dvo5Jo66ia+XiDdd2oHdwLAHsd7aJT7TUeBfJ7Hv2ZxUQOBpiBAms/c LuxI18jaaW2ysI6lQCsyaqfWt7Znhsb/GwzVJJHvAWTu7wqGo++F/5qzwYHLtqAMv/Nr q30HMVoP+KBqTQjxwq2bv4fHZjdt4iMjzwb3M5NOnq0f8NJMrxpYXm6y0B5cbkuBhEmq y2wQ== X-Gm-Message-State: ACrzQf28y8VlL6PY5aEjOTzNK2oR0jpeb5xvYYg7BED+cij8lEyC/uiw TY15PVrTghtzSCHGU+NRe6VJLCB89M7nRg== X-Google-Smtp-Source: AMsMyM4ytmphFHW8oRo4kRC+v1H01IPOeTsGESv6JJzw2ev39HzCY+xO50Qd67dGYLMgXlPb7dl1iw== X-Received: by 2002:aa7:8293:0:b0:563:5852:e750 with SMTP id s19-20020aa78293000000b005635852e750mr5282300pfm.11.1665396772058; Mon, 10 Oct 2022 03:12:52 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id h17-20020a170902f55100b001788ccecbf5sm6302138plf.31.2022.10.10.03.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 03:12:51 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH 15/29] UefiCpuPkg/CpuExceptionHandlerLib: Refactor to allow other architectures Date: Mon, 10 Oct 2022 15:41:48 +0530 Message-Id: <20221010101202.1146624-16-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221010101202.1146624-1-sunilvl@ventanamicro.com> References: <20221010101202.1146624-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076 Currently, the CpuExceptionHandlerLib library supports only X86. Refactor the library to allow adding other CPU architectures. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: Sunil V L --- .../DxeCpuExceptionHandlerLib.inf | 14 ++++++++------ .../PeiCpuExceptionHandlerLib.inf | 8 ++++---- .../SecPeiCpuExceptionHandlerLib.inf | 12 +++++++----- .../SmmCpuExceptionHandlerLib.inf | 8 ++++---- .../Xcode5SecPeiCpuExceptionHandlerLib.inf | 6 +++--- .../{ => Ia32_X64}/CpuExceptionCommon.h | 0 .../{ => Ia32_X64}/CpuExceptionCommon.c | 0 .../{ => Ia32_X64}/DxeException.c | 0 .../{ => Ia32_X64}/PeiCpuException.c | 0 .../{ => Ia32_X64}/PeiDxeSmmCpuException.c | 0 .../{ => Ia32_X64}/SecPeiCpuException.c | 0 .../{ => Ia32_X64}/SmmException.c | 0 12 files changed, 26 insertions(+), 22 deletions(-) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/CpuExceptionCommon.h (100%) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/CpuExceptionCommon.c (100%) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/DxeException.c (100%) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/PeiCpuException.c (100%) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/PeiDxeSmmCpuException.c (100%) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/SecPeiCpuException.c (100%) rename UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32_X64}/SmmException.c (100%) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf index e7a81bebdb13..ef07b05c080a 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf @@ -32,11 +32,11 @@ [Sources.X64] X64/ArchExceptionHandler.c X64/ArchInterruptDefs.h -[Sources.common] - CpuExceptionCommon.h - CpuExceptionCommon.c - PeiDxeSmmCpuException.c - DxeException.c +[Sources.IA32, Sources.X64] + Ia32_X64/CpuExceptionCommon.h + Ia32_X64/CpuExceptionCommon.c + Ia32_X64/PeiDxeSmmCpuException.c + Ia32_X64/DxeException.c [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard @@ -56,8 +56,10 @@ [LibraryClasses] SerialPortLib PrintLib SynchronizationLib - LocalApicLib PeCoffGetEntryPointLib MemoryAllocationLib DebugLib + +[LibraryClasses.IA32, LibraryClasses.X64] + LocalApicLib VmgExitLib diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf index 7c2ec3b2db4c..7e7e1a4296de 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf @@ -33,10 +33,10 @@ [Sources.X64] X64/ArchInterruptDefs.h [Sources.common] - CpuExceptionCommon.h - CpuExceptionCommon.c - PeiCpuException.c - PeiDxeSmmCpuException.c + Ia32_X64/CpuExceptionCommon.h + Ia32_X64/CpuExceptionCommon.c + Ia32_X64/PeiCpuException.c + Ia32_X64/PeiDxeSmmCpuException.c [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf index 6a170286c8fc..28341abd4493 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf @@ -32,10 +32,10 @@ [Sources.X64] X64/ArchExceptionHandler.c X64/ArchInterruptDefs.h -[Sources.common] - CpuExceptionCommon.h - CpuExceptionCommon.c - SecPeiCpuException.c +[Sources.IA32, Sources.X64] + Ia32_X64/CpuExceptionCommon.h + Ia32_X64/CpuExceptionCommon.c + Ia32_X64/SecPeiCpuException.c [Packages] MdePkg/MdePkg.dec @@ -46,8 +46,10 @@ [LibraryClasses] BaseLib SerialPortLib PrintLib - LocalApicLib PeCoffGetEntryPointLib + +[LibraryClasses.IA32, LibraryClasses.X64] + LocalApicLib VmgExitLib [Pcd] diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf index 9dde07612a04..b7f395f45ab4 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf @@ -33,10 +33,10 @@ [Sources.X64] X64/ArchInterruptDefs.h [Sources.common] - CpuExceptionCommon.h - CpuExceptionCommon.c - PeiDxeSmmCpuException.c - SmmException.c + Ia32_X64/CpuExceptionCommon.h + Ia32_X64/CpuExceptionCommon.c + Ia32_X64/PeiDxeSmmCpuException.c + Ia32_X64/SmmException.c [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf index 6d2f66504a5b..7830b3e6663f 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf @@ -38,9 +38,9 @@ [Sources.X64] X64/ArchInterruptDefs.h [Sources.common] - CpuExceptionCommon.h - CpuExceptionCommon.c - SecPeiCpuException.c + Ia32_X64/CpuExceptionCommon.h + Ia32_X64/CpuExceptionCommon.c + Ia32_X64/SecPeiCpuException.c [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/CpuExceptionCommon.h similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/CpuExceptionCommon.h diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/CpuExceptionCommon.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/CpuExceptionCommon.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/DxeException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/DxeException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/PeiCpuException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/PeiCpuException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/PeiDxeSmmCpuException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/PeiDxeSmmCpuException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/SecPeiCpuException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/SecPeiCpuException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/SmmException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32_X64/SmmException.c -- 2.25.1