From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mx.groups.io with SMTP id smtpd.web12.9579.1665766169327427022 for ; Fri, 14 Oct 2022 09:49:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=TvjrQ8G3; spf=pass (domain: ventanamicro.com, ip: 209.85.216.47, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pj1-f47.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso8098652pjq.1 for ; Fri, 14 Oct 2022 09:49:29 -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=bBl7YZLeS4xaVGJbPzGtd/IlkdaLybAUSSkdBuGm/Ec=; b=TvjrQ8G3KhffBSYwgLef1uzZ0B2MCaPXGrioEXLjETAQ3gkLTKch5YzMPppYvud1Sl K2jcdFf7DrQjGQFQ0cs2+gLkWlWl+JkX21pvWFR7ByZZmJU4fwyFmRZm7CjNMhKOV93K 0xX1UeJHVtEFwAvRGZ8Jq+0TChqKMW5IRem9gtMp4o1CDYEanYvfsNy1HnRge/9SWpiO Rxo4H0i2RN8i4oKqYAoIyOxjz5Mf3aCMfqbZZPQC7Kg0sIogGK+oKvK4gssHwPlBBvni iVM2GRNjibXMEHN7Y7XvWOaDk/dmDcmLFwHAk/dZGtnFV9G0gG2nC82Xzby4KJX8Ox5y ekBw== 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=bBl7YZLeS4xaVGJbPzGtd/IlkdaLybAUSSkdBuGm/Ec=; b=uir60ReotD2JLCVpNpteOu79K9Wt8ggPl80NWo2dwgJVCnxczBopb/wH0owVUcasdF ty49NVGGBD83ZkccI4HMGfmgYRpeZJok5Zmk6YT/+Z4E82ERpwURclotY3R5wcC4x/fz RqDDd1MMYc7HCcFKJLTjPB/d8AX3MemNr7Bo9sWl6ZtQTiWgy+5HC6wKY93A74bwL1cW 7q5Eis+zgb9r8tSuptHZFZWn8llITZ4qcEeL2zo4QUfNcCPZoNpWJ/+NgwNwsCQFRgh4 36p/O1r4XTpJ4lqIyVykASJ65izO+hwe3VH9jsS/YFMHx/tLKFdbCONuaRNZdGJaL0hR xYKg== X-Gm-Message-State: ACrzQf0izOBZQhQKYevvOc7RGyt7N3KMh/DuvWmqOZsyelnBtTzpOY7e WJHWFiIndiFU/SCXIe4tsWdfUJmEf+B79g== X-Google-Smtp-Source: AMsMyM4g9SEChS2cDoFy56KqHM6jIzhuvYrCfP+tx/93jqcbv5HpmSttMMHmMBPh28yIgS2p7qDl9g== X-Received: by 2002:a17:90b:3b92:b0:20d:4fae:1261 with SMTP id pc18-20020a17090b3b9200b0020d4fae1261mr6980704pjb.32.1665766168542; Fri, 14 Oct 2022 09:49:28 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id f3-20020a62db03000000b0056265011136sm1963368pfg.112.2022.10.14.09.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 09:49:28 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V4 17/34] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Date: Fri, 14 Oct 2022 22:18:19 +0530 Message-Id: <20221014164836.1513036-18-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221014164836.1513036-1-sunilvl@ventanamicro.com> References: <20221014164836.1513036-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/{ => Ia32X64}/CpuDxe.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuGdt.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuMp.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuPageTable.h | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuDxe.c | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuGdt.c | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuMp.c | 0 UefiCpuPkg/CpuDxe/{ => Ia32X64}/CpuPageTable.c | 0 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 235241899222..65961813f74b 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] + Ia32X64/CpuDxe.c + Ia32X64/CpuDxe.h + Ia32X64/CpuGdt.c + Ia32X64/CpuGdt.h + Ia32X64/CpuMp.c + Ia32X64/CpuMp.h + Ia32X64/CpuPageTable.h + Ia32X64/CpuPageTable.c [Sources.IA32] Ia32/CpuAsm.nasm diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuDxe.h rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.h diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.h b/UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuGdt.h rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.h diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h b/UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuMp.h rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.h diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.h b/UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.h similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuPageTable.h rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.h diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuDxe.c rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.c diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.c b/UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuGdt.c rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.c diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuMp.c rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.c diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.c similarity index 100% rename from UefiCpuPkg/CpuDxe/CpuPageTable.c rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.c -- 2.38.0