From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web10.5673.1665655161599786146 for ; Thu, 13 Oct 2022 02:59:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jOLMPRdu; spf=pass (domain: ventanamicro.com, ip: 209.85.210.170, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pf1-f170.google.com with SMTP id i3so1475113pfc.11 for ; Thu, 13 Oct 2022 02:59:21 -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=jOLMPRduXf3f6FD89J43rz6xrRk1+ab3XLPvKZ2AhFR5wiiMm8Bu8FOTwqaap0BxUZ HeQlg07vQcpsXKUOfTi9CwFxF3oI7vqSEtVVRH1xTROC2aAV56rMaTOnl+UpvNqt5tU6 vvcZd6vQZ03hX57KxXFCA22DuZCmuUGrwmcEm7A7NnSdMruDdoSKYt13PSlp8lWi1ap0 CVEstZSnIzSP1zlTQEjia9gvY20/iQcLGNl6a6BPV1pPpWUYoXOxuWLxhWxj5TpUzsxQ 8TQNIcGMPBxQ5aUcWQEe/DcvQffOhTI0MwRQVk/D1DfCNM0NAAjcsLAGl+ahF1b7sNwT NowA== 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=P8KFq3WWQl53TgYhGMMPKygUTgCVV5jK3FEq1yr0/fR8tBRqE1DTGRyQkTP0X9ZG4c tGoH3Tv1tW7YVD4/dAoPFv2VSXnntZkTkt+4itvCGJEOb+QyOctyv+qTPsCQ+0d/wCK4 t8/yAEn234S9h5p8+GylVjduyuWN120NmcDQxHZdv7h7Wtx8uHXWZ17zdSTWqZvT52sk ZMmjaGwa3Of3L3q+Z8YAzhTTbbyZKGAZ6hwjQxBksl2UbHXzVm3qnGZY3HcqrW8dKTWJ tI1x9gw8A03/u+QDNN5r/AnzF7nYOxMLLt42fyYIl3TUItkxa0YH/DQCbR6RPG+QajxO YRUg== X-Gm-Message-State: ACrzQf14UFBb9or2WaBcp1GoLVdoLXe7fnXcoSMEGheKyjpMkVvawcSj Zf3g9hVP1Hh4/Xy+TEjZ3q8r0fXCplsEoQ== X-Google-Smtp-Source: AMsMyM59NOfz055KlV0C0x3zz/UIouMhITx4cIE4IAI18XkmxSdgit1Jm3AbZXOb+QDXLz0Cm0+6Gw== X-Received: by 2002:a63:1203:0:b0:43c:7fa:f306 with SMTP id h3-20020a631203000000b0043c07faf306mr29009071pgl.169.1665655160450; Thu, 13 Oct 2022 02:59:20 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id w8-20020a17090abc0800b0020d43c5c9a0sm2931845pjr.18.2022.10.13.02.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 02:59:19 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V3 15/34] UefiCpuPkg/CpuExceptionHandlerLib: Refactor to allow other architectures Date: Thu, 13 Oct 2022 15:28:10 +0530 Message-Id: <20221013095829.1454581-16-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221013095829.1454581-1-sunilvl@ventanamicro.com> References: <20221013095829.1454581-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