From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mx.groups.io with SMTP id smtpd.web10.18668.1665571564564817967 for ; Wed, 12 Oct 2022 03:46:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=g3PkfNBF; spf=pass (domain: ventanamicro.com, ip: 209.85.215.169, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pg1-f169.google.com with SMTP id e129so15190731pgc.9 for ; Wed, 12 Oct 2022 03:46:04 -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=jakvbhy1EqeUM7VRrchATO0ETbtSI5lAaUBPPnAEjes=; b=g3PkfNBFcMYw7cCyal0tQ33XyyrRdWBVjTiQ5MiSQVsUvqrlGWZfDyl+/0Kav6QBXv SPLvzoP0IJoAFWn5jguoZSvjVGFcP8YX3XHAV/eqcwEBcvVmckTaORaI/GXPvDvsg6G9 iQAkkM0jXOiN1yb+Qr91Hi+AT8et2U+OfLP6rWSVQ3Skx4R65MV47avc8peuSp00dMGB rTBmgyUFEQBFp8L5sUrQB5kUL/fxR6vHmLmgMyTJjXqLWziYjO1b/03fk07XKum5Q2j4 MKoVt/r4EUQ6Gjy2B53SYNOsmJqO0Y+kRBQrZiTL4KQB0iI75D9Lg6wYpwPATaspMOkk L78g== 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=jakvbhy1EqeUM7VRrchATO0ETbtSI5lAaUBPPnAEjes=; b=VysLwSZJAouHrh8jYmTxuilXDRiZp5NIc0OVZpSMmDbmRhdAnv0k6C5Jz/tnsxoQOa vz3IENn401HcOwctIQ1gdHB4WLu0Vzbknp9bSK8u52mf3iXdFAS/MRE/lvNTj3NVp9lh VkuKah6I5lxuE3hc71SdRDlDWZCBXFoloXQy4hF0KUExbHS49do8Za3Qqt+lHm8wtuXe KXfLsMnxidKD/Vdrpr8MdCTYXjogpph/qjjUHkU2oCJM4yW8XobzXdsYS2MVED1VnE8C jDyjzOVRs1oAtTnde1l9+eCj8JstXjxU2uBrppGLb/cjLcGFhPl9bQK7Jt5ZzJeRNid4 wd/A== X-Gm-Message-State: ACrzQf0+B74ShGkNjqv93DXbzjmwAmhVrwyUOT8lIUhrHQkxxz7dUQCh utJO1jsxYNsaUBTglkkQ6Lk4dnRnUOUPIA== X-Google-Smtp-Source: AMsMyM78+AkpUsvsYpCzhoHKva7Oe8fhuTWhEH3+TNhyEQr3xX2DWbMVSZfs1/g/Zz6u7ZHyMm2enw== X-Received: by 2002:a63:8041:0:b0:463:11c:3a82 with SMTP id j62-20020a638041000000b00463011c3a82mr11301720pgd.357.1665571563816; Wed, 12 Oct 2022 03:46:03 -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.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 03:46:03 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V2 17/33] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Date: Wed, 12 Oct 2022 16:14:40 +0530 Message-Id: <20221012104456.1393376-18-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, CpuDxe supports only X86 architecture. To add support for other architectures like RISC-V, this need to be refactored. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: Sunil V L --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 28 ++++++++++--------- UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuDxe.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuGdt.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuMp.h | 0 .../CpuDxe/{ => Ia32_X64}/CpuPageTable.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuDxe.c | 0 UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuGdt.c | 0 UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuMp.c | 0 .../CpuDxe/{ => Ia32_X64}/CpuPageTable.c | 0 9 files changed, 15 insertions(+), 13 deletions(-) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuDxe.h (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuGdt.h (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuMp.h (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuPageTable.h (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuDxe.c (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuGdt.c (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuMp.c (100%) rename UefiCpuPkg/CpuDxe/{ => Ia32_X64}/CpuPageTable.c (100%) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 235241899222..069a7f2933bd 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.inf +++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf @@ -29,28 +29,30 @@ [LibraryClasses] DebugLib DxeServicesTableLib MemoryAllocationLib - MtrrLib UefiBootServicesTableLib UefiDriverEntryPoint - LocalApicLib - UefiCpuLib UefiLib CpuExceptionHandlerLib HobLib ReportStatusCodeLib - MpInitLib TimerLib PeCoffGetEntryPointLib -[Sources] - CpuDxe.c - CpuDxe.h - CpuGdt.c - CpuGdt.h - CpuMp.c - CpuMp.h - CpuPageTable.h - CpuPageTable.c +[LibraryClasses.IA32, LibraryClasses.X64] + LocalApicLib + MpInitLib + MtrrLib + UefiCpuLib + +[Sources.IA32, Sources.X64] + Ia32_X64/CpuDxe.c + Ia32_X64/CpuDxe.h + Ia32_X64/CpuGdt.c + Ia32_X64/CpuGdt.h + Ia32_X64/CpuMp.c + Ia32_X64/CpuMp.h + Ia32_X64/CpuPageTable.h + Ia32_X64/CpuPageTable.c [Sources.IA32] Ia32/CpuAsm.nasm diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuDxe.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuDxe.h rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuDxe.h diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.h b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuGdt.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuGdt.h rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuGdt.h diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuMp.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuMp.h rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuMp.h diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.h b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuPageTable.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuPageTable.h rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuPageTable.h diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuDxe.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuDxe.c rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuDxe.c diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.c b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuGdt.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuGdt.c rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuGdt.c diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuMp.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuMp.c rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuMp.c diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/Ia32_X64/CpuPageTable.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuPageTable.c rename to UefiCpuPkg/CpuDxe/Ia32_X64/CpuPageTable.c -- 2.25.1