From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mx.groups.io with SMTP id smtpd.web10.9642.1665766163956828076 for ; Fri, 14 Oct 2022 09:49:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QTxk9h2U; spf=pass (domain: ventanamicro.com, ip: 209.85.210.182, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pf1-f182.google.com with SMTP id m6so5463873pfb.0 for ; Fri, 14 Oct 2022 09:49:23 -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=G3NKBgwzW4x0/qC8/8YTT5pW1uN6UduxXlgEVXpNxdA=; b=QTxk9h2U65QMqcnDQp3qBVkv8JpBrn4iQ2aiFR8/P/haHKEQO3NG+kiTCGaygJFa1B TbBglmGA1/ngFY5c0I1UmDUxzFwe1iaTUxaV3hx6Hlp547vY2tHMMz9whOSKVCFmSGp7 WH6QiBR42iA8YNI2LX8I777Lxot0VfZt1lgrlg8hzgixXraiT0Tr5QI9v8Lfo/aBlnVo Obu/dkk5X5szsuFL14YfRvA5MxULhWDhnVWwgdqAI3QYTuo53qWtaPr5Vis2Oi44sprK rzR/imsQWTVOp+n5JiriKoSU9hhUmpGh/opvFDgZ3adpv7Is8B3biKOviHyZ1NnPXteQ Mjlg== 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=G3NKBgwzW4x0/qC8/8YTT5pW1uN6UduxXlgEVXpNxdA=; b=K3nMA9IQbOgUjCBb56LS0k4r615NcEhK1mpGnAWhnki9UIriJRgssZXiSC/Z7bFb8/ ugTeQNrp1Jo8PW2/CwmkODYUsjfACrtYgNs+Szv9al2ipck1kDOJ0xBt/24H2sKG7VzU v9wbS74i45lSEh5VRlbcZpupu6jkRrsEM8bIVGu3MlqMQKsVV+/CNm2PqmFcCeodogbh WWX/vd9hDDCZtRsHZOKRHiVnKbnrVTI1cM3QQLG/mQRiq2UqGwUABy9WwW2dfp5XovJs sf53u2PIxten33BszLvBLOMR/Kh/R223gg6TvGKFYQUifkJggXVjS8YhC4uXSbIPtcAh q1tQ== X-Gm-Message-State: ACrzQf2IbZHGIUkfd5wqWLm4jWNQxWShEvF5QWVU1QaSiYboAmf6bpY+ jKHZhNTyHPT8F0rY5N07ulGDdE+GsNbPlA== X-Google-Smtp-Source: AMsMyM6cfjls6GTCA7pm/mWpih6JUxbE9E5KtgY/SNoGLOtF/imCRXasT7racLMpJBvNuyYx2h7cAA== X-Received: by 2002:a63:555e:0:b0:43c:4f2e:dd25 with SMTP id f30-20020a63555e000000b0043c4f2edd25mr5477015pgm.131.1665766163252; Fri, 14 Oct 2022 09:49:23 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id f3-20020a62db03000000b0056265011136sm1963368pfg.112.2022.10.14.09.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 09:49:22 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V4 15/34] UefiCpuPkg/CpuExceptionHandlerLib: Refactor to allow other architectures Date: Fri, 14 Oct 2022 22:18:17 +0530 Message-Id: <20221014164836.1513036-16-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221014164836.1513036-1-sunilvl@ventanamicro.com> References: <20221014164836.1513036-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 --- UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf | 14 ++++++++------ UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf | 8 ++++---- UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf | 12 +++++++----- UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf | 8 ++++---- UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf | 6 +++--- UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/CpuExceptionCommon.h | 0 UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/CpuExceptionCommon.c | 0 UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/DxeException.c | 0 UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/PeiCpuException.c | 0 UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/PeiDxeSmmCpuException.c | 0 UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/SecPeiCpuException.c | 0 UefiCpuPkg/Library/CpuExceptionHandlerLib/{ => Ia32X64}/SmmException.c | 0 12 files changed, 26 insertions(+), 22 deletions(-) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf index e7a81bebdb13..8fdf2b756c2c 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] + Ia32X64/CpuExceptionCommon.h + Ia32X64/CpuExceptionCommon.c + Ia32X64/PeiDxeSmmCpuException.c + Ia32X64/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..af4899e6885e 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 + Ia32X64/CpuExceptionCommon.h + Ia32X64/CpuExceptionCommon.c + Ia32X64/PeiCpuException.c + Ia32X64/PeiDxeSmmCpuException.c [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf index 6a170286c8fc..79911b21f62d 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] + Ia32X64/CpuExceptionCommon.h + Ia32X64/CpuExceptionCommon.c + Ia32X64/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..249446588bfa 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 + Ia32X64/CpuExceptionCommon.h + Ia32X64/CpuExceptionCommon.c + Ia32X64/PeiDxeSmmCpuException.c + Ia32X64/SmmException.c [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf index 6d2f66504a5b..23200437eb8b 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 + Ia32X64/CpuExceptionCommon.h + Ia32X64/CpuExceptionCommon.c + Ia32X64/SecPeiCpuException.c [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/CpuExceptionCommon.h similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/CpuExceptionCommon.h diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/CpuExceptionCommon.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/CpuExceptionCommon.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/DxeException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/DxeException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/PeiCpuException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/PeiCpuException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/PeiDxeSmmCpuException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/PeiDxeSmmCpuException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/SecPeiCpuException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/SecPeiCpuException.c diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/SmmException.c similarity index 100% rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32X64/SmmException.c -- 2.38.0