From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mx.groups.io with SMTP id smtpd.web10.5675.1665655166677540610 for ; Thu, 13 Oct 2022 02:59:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=EQOLLsim; spf=pass (domain: ventanamicro.com, ip: 209.85.214.177, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pl1-f177.google.com with SMTP id c24so1370926plo.3 for ; Thu, 13 Oct 2022 02:59:26 -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=EQOLLsimHGKj4FMYxFRsqBz9w5gwChXeBqt8hqrsL8iF+KOlMP8Ue+NWYkeJvcC59J XepnTrfzrTU+WfuzdLR8kIUHZyTnC8EUMEPRzVCgynxyNByVRi/ZH7MOcD/7cI6uDmQD SqQ3JffHS+3UR/q37XibGpqy0A4FrrkT+YuTrHA+8Fn0q47tyjZJQvegMJGCZzql70e2 n42JWSZiPH5RFXQoNW1YQANxvv2nkB47cJDx7x8y63mCAwqON39IPJUN6OI+IcRis63F bxduhl0ckEuowIoHMZzY4jKco0WIxefWLAMm9YfIWNzUhk8i+Akfxwv3vBTrcQbKGKxX 6Nxg== 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=f9m21CqXnPXTEG7f4BXQt5fKkRte9o3GpR8C0TsmybMbJF/G/CZMTT/pGQT6kcMLK/ 94Rs6EdLUrAQ/rxTYUJ8qelWnendxLj59yZrriWjMI/1tZQGvzN5WDqcKBYnZLfObWxa NkWxz7BNHmivKTL7gBC0LdO0f+3Sda4OT7sLqgVWDlzADPlQ5ayJKtRl+skUQdNIe7ya 6yqFbIrYcIsDITL7vzHqJbUvhJoyDm78/WIDrK38eYBC1jgFTPck1Mtk1XHciba2+ZAN nL2qmTnotuDI8R1ieN6Uz0TleIJcT2a/LC8adnsT9OV1fGHRwpnlXTw6s2tc/kvuboox PCew== X-Gm-Message-State: ACrzQf2BU02vI8/ZVW9TycUpnua70UNt3fa/ifazpGF7fJFN6KcdMbGA /3C36hkmuwoPCxSytep+MnIXVGr51tuFpw== X-Google-Smtp-Source: AMsMyM47AjbrEcw7RmRmfSymPRks1hkherCMmGdOCN9PMscXcYeeL9Z5s3+JdjSlFtfpgRU7p3EADQ== X-Received: by 2002:a17:902:d544:b0:17d:318a:adf7 with SMTP id z4-20020a170902d54400b0017d318aadf7mr34521457plf.148.1665655165947; Thu, 13 Oct 2022 02:59:25 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id w8-20020a17090abc0800b0020d43c5c9a0sm2931845pjr.18.2022.10.13.02.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 02:59:25 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V3 17/34] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Date: Thu, 13 Oct 2022 15:28:12 +0530 Message-Id: <20221013095829.1454581-18-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221013095829.1454581-1-sunilvl@ventanamicro.com> References: <20221013095829.1454581-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