From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web10.4742.1665396777635748491 for ; Mon, 10 Oct 2022 03:12:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=iicpAPuD; spf=pass (domain: ventanamicro.com, ip: 209.85.216.46, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pj1-f46.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso11359840pjq.1 for ; Mon, 10 Oct 2022 03:12:57 -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=iicpAPuDUVPYDg2yp/4mbasSMGJXRXGYs8uzRpk1OMN9YnJNRropmXpo7sBrTjAuAT SpQzfEXsShe3XmKh60jvkZLY6ij82UVdA0vOu1Z7KtxK4SpZPYJtBq20sdUE0NY1GKY6 RKqmyldmrFAjSJxdE+A38bCrwXZyejtXeYWueWm95bkmDZXwQ/w2Mdy0PKDLj3rPotwk 7A1XnAhXrPHPIAg5GMNCH26W6g1V3atUYhG4oCyH3wAoMquF/oIHlWKBgVMZQsx1fYgr GQIe/kiDVY5I9csDSA8WbWZTNC1/qVuAUoJCzvKZDS3u7i/LsaUPXk0vrxqEoZwPGCu1 0org== 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=HpLVK9cI09LagudmmatvGFWKjiWZ9EVRF5TpuO16lzULXDjwSIvupqb2YFkT6RdnSQ 5E3a0y+zteM9Xn7s+x+IqnCk+hWKVHqvm5HxNUBygzi746XXEvSisYKpNIFHaVuwho+M 8Voou8RZkbI3p/8szPnG94tgnCp0WNJ6L2j8CGMHF0WDqwW/x953xSd3foSA58bsc1n+ U2IkMLmgRZEvr26mRQ0clLHQL5Wdsij7QVVcvImIeXExV9BfAzpMJI36j8fgguJJTcjO zvEsN0kqbmnmX5qxQ/o4PpfMFP0qBpRK7LvyWpJVr+JCdq77aT9Gk8vF2etzTSJwPIuP t0Cg== X-Gm-Message-State: ACrzQf06BTegUHn96deFokGlha2QUsMQedQEgOSnLV463ZRy4a1mg+rt oUxn0wmDqhqF1PE93ArZ9s9MCm4cxwcpcQ== X-Google-Smtp-Source: AMsMyM7oXHFWxtukBCvMLFaRNyID9P77imWGZ7eee1Spn++EGS7q6EHgijzBpZbfwBqBlTrTLtZEhw== X-Received: by 2002:a17:903:248b:b0:17d:ea45:d76a with SMTP id p11-20020a170903248b00b0017dea45d76amr18563500plw.97.1665396776863; Mon, 10 Oct 2022 03:12:56 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id h17-20020a170902f55100b001788ccecbf5sm6302138plf.31.2022.10.10.03.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 03:12:56 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH 17/29] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Date: Mon, 10 Oct 2022 15:41:50 +0530 Message-Id: <20221010101202.1146624-18-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221010101202.1146624-1-sunilvl@ventanamicro.com> References: <20221010101202.1146624-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