From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mx.groups.io with SMTP id smtpd.web08.8061.1667136576355143813 for ; Sun, 30 Oct 2022 06:29:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=DmkIMIiX; spf=pass (domain: ventanamicro.com, ip: 209.85.210.172, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pf1-f172.google.com with SMTP id g62so8556792pfb.10 for ; Sun, 30 Oct 2022 06:29:36 -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=DmkIMIiXm3zyA4C2HjxgSTLSksyQ2mopiV9ELQvHxo/t0DoCvJHWP97ob5qptQK6ya FW9UxbGm3SROFpyCSznTgLoRGivY8oZ2pLhUUAVxZEWnQbHVspDRIUFz9qTiT9kENeRJ S8WupC9vC87lPWVEcogIQ2f3EC5wR7Pvop/R3FVwLBHhYrn1O6r3XR539sKcDq8TfwiE 1zlUi15jtgisdsXHGIPCvPIwqZ2RdSH6NYutLjvIzB/Rm7RFkcdYfCrPz0qIszULMvSm ZENvoEjlsECOkYvt1Ds9krQtLto8GqLLL1MVC4h9CCq57q7yf7ffCeLGhXPAdJEKbtkY 7OWw== 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=m9uVdiD/QAAvMccvWamMR93puQJSg7fomKqD1M0LPUXAiZM/MzM6wplOkwTUooECD7 z9b11DNQxcd6MMkNz5noImh+klVIK4h9uv7ff9/ZP0oaa1dYybH6mII9rBWlvSzgM4kR ZkCFHtIFghcFBWLAE0kbZ+W6CxAaWciu6DbKn9bZRf2dZ0eCA3tz9ymWtVqoYdYSlwU7 PukWklbPpls4dW6aL+sNOoY5MahEfmtj3u2tGfjUZu6Fob8B4hsQBacx8UlB9EVfAb15 AxgePX+mG+aqisI9uSdaVDvsKf54BrTKARKZ2f83UjS+QyYatJrPKREBKZtJfIUh+H/g q5mg== X-Gm-Message-State: ACrzQf3mR1V7VLRi44mQ0PZhPRmztqS3Yu0RRB8ZzgQWnKOn/5oLqXBD 0EX18PS4rSlTuu4teZQQZHi64kmCd9Pk5Q== X-Google-Smtp-Source: AMsMyM5KiDHAMW9Z55d0ZD+NwnbEN0XD1Y2W5HjnOKepv1e/4Uyiws7w/7WLwfGEbZfVsp8oC7ueZw== X-Received: by 2002:a05:6a00:15c8:b0:565:bc96:1c5b with SMTP id o8-20020a056a0015c800b00565bc961c5bmr9218968pfu.52.1667136575699; Sun, 30 Oct 2022 06:29:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 06:29:34 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-staging/RiscV64QemuVirt PATCH V5 17/30] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Date: Sun, 30 Oct 2022 18:58:29 +0530 Message-Id: <20221030132842.54077-18-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, 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