From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mx.groups.io with SMTP id smtpd.web11.18724.1665571556207065452 for ; Wed, 12 Oct 2022 03:45:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=WyDtz987; spf=pass (domain: ventanamicro.com, ip: 209.85.216.45, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pj1-f45.google.com with SMTP id q10-20020a17090a304a00b0020b1d5f6975so1692304pjl.0 for ; Wed, 12 Oct 2022 03:45:56 -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=WyDtz987f+QFS33TveGQD7Kz9YmNGRmTe8gZaKo8CB+7HGdq7egZ766G6S+nvZb+BX dKRKkxlcVRHpKtzgNh+VVT9mhvCiz1k2Cwg2tEmkGoGT6HGD5ECBkCs+JgpQWoQmAS+h Un9T3i1wHuoJHIIZalF8YDny8C3erF2kZaAQUrdkV3B7cgg34829Vy4KWk3MmILoT2ap WBMUY08ZzUKZiNG0AFhDun43++Nl8uAWgAr04Fh9LTDYDdEjGaH5SMtwN+rxVysVd5sz gG6FKgwU8ltBT1DItymOP0GghIKrp2Gk8xRtwzIHscX64sc/XsVhvUt4Rz0PUbs3I3oz b4Xw== 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=Y8LVFw6ZFHN+oGCGFZsyxSA0sfV7lxW1bKzIpQIJd9zc+NxGfKju+SRa923vmk8eDY 8dgQTkFgdDI7i/V5IMl2wuWfdk2e6YgD6T7HUPpbq/7COS501vRIaHzI/HMv50S4XACo H4mDjQmqjv8Ysvxj5aj40S1Qik0AIE7gHfZqAhgTURu74Hcx1QXMzvGfRH5sSL/X6vMl VQwcMPlGMuRyOhi34xXqv9XPe3fg50W+R1xBvaR6NdttT88SYiSFALNly/7Ja9ESsMwR mJYLAQRBBPlSHr40eyU2RDvgyuGh6q6q2MXXsW1AdI4Br8e14+fjvPusSvV764112iqu sR1Q== X-Gm-Message-State: ACrzQf1Uxo7vNMT6frqo7HOweU4lzyfS2Z7Ee39RYc0yBAO58A/CFss4 hzxKaxaoZ7MNjZKWpEMtI3KvsLaF8tIYjA== X-Google-Smtp-Source: AMsMyM5yLM7axRwugDnBbKoMDBCbPv9xYlBfH9kCqexAI15vM+TegfJLL6vZHQKuQYMcovAtsc0Edw== X-Received: by 2002:a17:902:e547:b0:178:43de:acac with SMTP id n7-20020a170902e54700b0017843deacacmr29468389plf.39.1665571550687; Wed, 12 Oct 2022 03:45:50 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id z4-20020aa79e44000000b0054223a0185asm10812221pfq.161.2022.10.12.03.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 03:45:49 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V2 15/33] UefiCpuPkg/CpuExceptionHandlerLib: Refactor to allow other architectures Date: Wed, 12 Oct 2022 16:14:38 +0530 Message-Id: <20221012104456.1393376-16-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221012104456.1393376-1-sunilvl@ventanamicro.com> References: <20221012104456.1393376-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