From nobody Sun Feb 8 17:21:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+95731+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95731+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1667136544; cv=none; d=zohomail.com; s=zohoarc; b=Rv/5VodbxaBdSMhP5rR+7Owk90fKTT207QRJ7bcgxj8tMf70usoGOW4EwTMa8NWSxP3Mn/XB74TzzDPVmSYHX6cePnfn1XApczq/Dh1VV4fZP9Wnh/sosSn5DOaeNbAfLRxHaroyctJPwpQGP4j4utonmd+8oUY9f+ZFPh+54TE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667136544; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=lW4esnh50cfw7vdIiFG15c60m7wX0P5YwoWhdCxm6Os=; b=MlBT/xN8LE4mYPTnulpc0v+0fQnb82EL4V4jVLpgqob/surgwXDmhtq00rwj2E9kGMQvN/EKR33VTgEQXe3cxmpTqjLuhzRBUf2Y08PXcTNBp3J1cjy321m7cgNK7VpP/vgYsA4yuJU2Sc5FrPhBS538ykjSoBz20uzir05ZnoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95731+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1667136544818541.6655771380161; Sun, 30 Oct 2022 06:29:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cVv2YY1788612xrFzUbegMzT; Sun, 30 Oct 2022 06:29:04 -0700 X-Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mx.groups.io with SMTP id smtpd.web08.8057.1667136543893761731 for ; Sun, 30 Oct 2022 06:29:04 -0700 X-Received: by mail-pj1-f44.google.com with SMTP id z5-20020a17090a8b8500b00210a3a2364fso11096340pjn.0 for ; Sun, 30 Oct 2022 06:29:03 -0700 (PDT) X-Gm-Message-State: U9VyZea64Stf6lK8pSjhdIAvx1787277AA= X-Google-Smtp-Source: AMsMyM4oYHzlGKFbdgIVcnjMdxNZVRy54wswLI0d6SuQANa3Fi4UkJI3PTkIWt4jlb7wAW+VONmkTA== X-Received: by 2002:a17:90a:3ee5:b0:213:8550:72e3 with SMTP id k92-20020a17090a3ee500b00213855072e3mr16276316pjc.49.1667136543190; Sun, 30 Oct 2022 06:29:03 -0700 (PDT) X-Received: from localhost.localdomain ([49.206.12.236]) by smtp.gmail.com with ESMTPSA id r10-20020aa79eca000000b0056b6a22d6c9sm2612330pfq.212.2022.10.30.06.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 06:29:02 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V5 05/30] OvmfPkg/PlatformInitLib: Refactor to allow other architectures Date: Sun, 30 Oct 2022 18:58:17 +0530 Message-Id: <20221030132842.54077-6-sunilvl@ventanamicro.com> In-Reply-To: <20221030132842.54077-1-sunilvl@ventanamicro.com> References: <20221030132842.54077-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sunilvl@ventanamicro.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1667136544; bh=3cFLmP0freXrXEN5JLCf7xyLoKSWggxmCYdC/E36jSA=; h=Cc:Date:From:Reply-To:Subject:To; b=ePqzcIWD2F1nKRrJ0H5+LhsSLOq8mqjC7XT7Dv6hfzht5JCu0qoQfCw8LjaTDe58Kbl p8qWwwdXDjO+eUkILMygAqZmjNQrivvguFop44Le9wVjBuI8gxZh3DlGBF+2nUt+IO2gO hZsSJPRmpQHmZoRrLUoY3b+VUi2YSVL2QQU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1667136546020100021 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4076 Currently, PlatformInitLib supports only X86 architecture. So, refactor to allow adding other architectures like RISC-V. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Sunil V L --- OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 22 ++++++++= +++--------- OvmfPkg/Library/PlatformInitLib/{ =3D> Ia32X64}/Cmos.c | 0 OvmfPkg/Library/PlatformInitLib/{ =3D> Ia32X64}/IntelTdx.c | 0 OvmfPkg/Library/PlatformInitLib/{ =3D> Ia32X64}/IntelTdxNull.c | 0 OvmfPkg/Library/PlatformInitLib/{ =3D> Ia32X64}/MemDetect.c | 0 OvmfPkg/Library/PlatformInitLib/{ =3D> Ia32X64}/Platform.c | 0 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf b/OvmfPkg/= Library/PlatformInitLib/PlatformInitLib.inf index 86a82ad3e084..5d31cad1b670 100644 --- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf +++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf @@ -22,16 +22,16 @@ [Defines] # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 -[Sources] - Cmos.c - MemDetect.c - Platform.c +[Sources.IA32, Sources.X64] + Ia32X64/Cmos.c + Ia32X64/MemDetect.c + Ia32X64/Platform.c =20 [Sources.IA32] - IntelTdxNull.c + Ia32X64/IntelTdxNull.c =20 [Sources.X64] - IntelTdx.c + Ia32X64/IntelTdx.c =20 [Packages] EmbeddedPkg/EmbeddedPkg.dec @@ -45,12 +45,14 @@ [LibraryClasses] DebugLib IoLib HobLib + PcdLib + PciLib + +[LibraryClasses.IA32, LibraryClasses.X64] + MtrrLib QemuFwCfgLib QemuFwCfgSimpleParserLib MemoryAllocationLib - MtrrLib - PcdLib - PciLib PeiHardwareInfoLib =20 [LibraryClasses.X64] @@ -100,5 +102,5 @@ [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataSize =20 -[FeaturePcd] +[FeaturePcd.IA32, FeaturePcd.X64] gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode diff --git a/OvmfPkg/Library/PlatformInitLib/Cmos.c b/OvmfPkg/Library/Platf= ormInitLib/Ia32X64/Cmos.c similarity index 100% rename from OvmfPkg/Library/PlatformInitLib/Cmos.c rename to OvmfPkg/Library/PlatformInitLib/Ia32X64/Cmos.c diff --git a/OvmfPkg/Library/PlatformInitLib/IntelTdx.c b/OvmfPkg/Library/P= latformInitLib/Ia32X64/IntelTdx.c similarity index 100% rename from OvmfPkg/Library/PlatformInitLib/IntelTdx.c rename to OvmfPkg/Library/PlatformInitLib/Ia32X64/IntelTdx.c diff --git a/OvmfPkg/Library/PlatformInitLib/IntelTdxNull.c b/OvmfPkg/Libra= ry/PlatformInitLib/Ia32X64/IntelTdxNull.c similarity index 100% rename from OvmfPkg/Library/PlatformInitLib/IntelTdxNull.c rename to OvmfPkg/Library/PlatformInitLib/Ia32X64/IntelTdxNull.c diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/= PlatformInitLib/Ia32X64/MemDetect.c similarity index 100% rename from OvmfPkg/Library/PlatformInitLib/MemDetect.c rename to OvmfPkg/Library/PlatformInitLib/Ia32X64/MemDetect.c diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/P= latformInitLib/Ia32X64/Platform.c similarity index 100% rename from OvmfPkg/Library/PlatformInitLib/Platform.c rename to OvmfPkg/Library/PlatformInitLib/Ia32X64/Platform.c --=20 2.38.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95731): https://edk2.groups.io/g/devel/message/95731 Mute This Topic: https://groups.io/mt/94664297/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-