From nobody Tue Feb 10 19:14:45 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+95219+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+95219+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1665766135; cv=none; d=zohomail.com; s=zohoarc; b=Gxtp+QqPzlHw+2IP8LGx1ZOzOnODu8WTogCx338dBcCFYAliyXahiKA/NNQWfusqwhhJDIohozPMXDJRwpTwu4JhYqLrg7ADM+lAew6XuaOb7MaLLne6Z+vEdXRQvPOkapq0stA5UPHucxxw4yczxIGSrYOt71qeXvQ9T9gb2ls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665766135; 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=NS2mClwuflExdHQxeKy9i60PxDkb3pU6kPu7+Phme6k=; b=LdV5LxTBDpeerwbQ6VeIHjd17Qc2vqV22IajVMB7i/TOHDHk+qq4Kuq//PCK302D0JxhcJauyQdVbouLFeNbzLJbAEk6d0HN3M7FjCBasQAQAruH3o8nEWDTIe9JClNa0aL4hfuoCc3KKn7pjV72ubJ4QhqnsYejItNdi43AOUI= 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+95219+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1665766135880534.6017247361635; Fri, 14 Oct 2022 09:48:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kDmaYY1788612xt13shFMCG1; Fri, 14 Oct 2022 09:48:55 -0700 X-Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mx.groups.io with SMTP id smtpd.web10.9637.1665766134582756453 for ; Fri, 14 Oct 2022 09:48:54 -0700 X-Received: by mail-pg1-f172.google.com with SMTP id r18so4754770pgr.12 for ; Fri, 14 Oct 2022 09:48:54 -0700 (PDT) X-Gm-Message-State: BdirFb3jknjLpzZv1UiN4kddx1787277AA= X-Google-Smtp-Source: AMsMyM7o6mOzkvyjx5ZXdY6kKsz5nT3BO3Q3HERREnvrVBnwrmNnPfT7ZFSkgEPAPNGdD8NSeVaaZQ== X-Received: by 2002:a63:8:0:b0:460:e669:a0c4 with SMTP id 8-20020a630008000000b00460e669a0c4mr5342721pga.475.1665766133751; Fri, 14 Oct 2022 09:48:53 -0700 (PDT) X-Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id f3-20020a62db03000000b0056265011136sm1963368pfg.112.2022.10.14.09.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 09:48:53 -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 V4 05/34] OvmfPkg/PlatformInitLib: Refactor to allow other architectures Date: Fri, 14 Oct 2022 22:18:07 +0530 Message-Id: <20221014164836.1513036-6-sunilvl@ventanamicro.com> In-Reply-To: <20221014164836.1513036-1-sunilvl@ventanamicro.com> References: <20221014164836.1513036-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=1665766135; bh=X3aH4IzGUyIMdf+JKqkfK/WOB02ZzqIIhL/3nzOJmB4=; h=Cc:Date:From:Reply-To:Subject:To; b=GvJMcscWouZIatYr+AuosBuKx9AvP5jz7N+JuNpCHVyLP+SxuuY/Bi1QF+lcBYUPjHk dbVV1o3c9QOoMKD8po35ncoVlsq5ZA07E40p3aENEdZCpUTHMzNjrSRQtYMPRtFW6U9pe 1eDzOTC5i7knK4reWSJyrNzTAeMPxXEy2GA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1665766136271100007 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 (#95219): https://edk2.groups.io/g/devel/message/95219 Mute This Topic: https://groups.io/mt/94330824/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-