From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=iUMLuJ7h; spf=pass (domain: ventanamicro.com, ip: 209.85.216.44, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pj1-f44.google.com with SMTP id z5-20020a17090a8b8500b00210a3a2364fso11096340pjn.0 for ; Sun, 30 Oct 2022 06:29:03 -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=bxsrW5pgUzOYiVb7HKuttwptY3VHTSaB2WgNekfcmt4=; b=iUMLuJ7huD30bUSMCirryMiFrvB44Qi/mWYSjCFtp8NeCEYgekc49MkdVwM+jtC/aP TAugwY3rk4lBEyagmywEovw1k5uXtK6s6ZLBhB44NHnpokDnBjKkU5ocL9pcem/7MiA9 VMOldOauHGotHLVfa0yRDfCm6KzyZ1PP5yXrKsvZ6jWVETgA11viwCicY3Hn5wVaIHi7 mjuXrpwpdcvv2/+XjYPkQMBkH/nka9ACk2yeb0kcBBG6Tg9h1IV2ZXCZisYE3O/ALQ3X cAX1xKBukpoV93lqLdXKHjzTFYFpPt0HBT/LqTAoijnobVuWCYjhgH3sEd3S+gy2Eo88 4Pqw== 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=bxsrW5pgUzOYiVb7HKuttwptY3VHTSaB2WgNekfcmt4=; b=pSCU+GmLrLl8kRPMC+oODyKT7W+8sejIbRk1832fHNH4vhMngJbTPY3zcc1stV+zQy LYKVaLBb5TErPrQ9jv8Se37ipkBTOwrSLBzd36HlikJWFh3tK5OYfAAfdUkckhQgu7Ek 8g0b4H5vMHKJVmj3LNl/JYEqu2P3jREoUovxrRL9QWO+sYKZx5NhRk4QmvoUrt/M9lsT loPQcayWq0S2abb5rep4uDH7CV2Eww7tVV44KQ5fEFlpIMYkSDfHquvtG0fH5Br9dKvB 2ynFql/Nlt75dovDQCE8do2+KikC70yNmRGUkZnmOmUu876ta3prIz2ViGM4onoteJ7a /Cvw== X-Gm-Message-State: ACrzQf127ZQEbWO2JSwV60aoWap5cO+51g6qM84sgvThjLHmECcwB6UU 6Q/U9cJWk4I8XGCYOnofOm6jX25cZsHx6Q== 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) Return-Path: 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-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> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221030132842.54077-1-sunilvl@ventanamicro.com> References: <20221030132842.54077-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076 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/{ => Ia32X64}/Cmos.c | 0 OvmfPkg/Library/PlatformInitLib/{ => Ia32X64}/IntelTdx.c | 0 OvmfPkg/Library/PlatformInitLib/{ => Ia32X64}/IntelTdxNull.c | 0 OvmfPkg/Library/PlatformInitLib/{ => Ia32X64}/MemDetect.c | 0 OvmfPkg/Library/PlatformInitLib/{ => 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 = IA32 X64 EBC # -[Sources] - Cmos.c - MemDetect.c - Platform.c +[Sources.IA32, Sources.X64] + Ia32X64/Cmos.c + Ia32X64/MemDetect.c + Ia32X64/Platform.c [Sources.IA32] - IntelTdxNull.c + Ia32X64/IntelTdxNull.c [Sources.X64] - IntelTdx.c + Ia32X64/IntelTdx.c [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 [LibraryClasses.X64] @@ -100,5 +102,5 @@ [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataSize -[FeaturePcd] +[FeaturePcd.IA32, FeaturePcd.X64] gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode diff --git a/OvmfPkg/Library/PlatformInitLib/Cmos.c b/OvmfPkg/Library/PlatformInitLib/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/PlatformInitLib/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/Library/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/PlatformInitLib/Ia32X64/Platform.c similarity index 100% rename from OvmfPkg/Library/PlatformInitLib/Platform.c rename to OvmfPkg/Library/PlatformInitLib/Ia32X64/Platform.c -- 2.38.0