The change doesn't impact any functionality.
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
---
UefiCpuPkg/CpuDxe/CpuGdt.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.c b/UefiCpuPkg/CpuDxe/CpuGdt.c
index a1ab543f2d..8847bc4819 100644
--- a/UefiCpuPkg/CpuDxe/CpuGdt.c
+++ b/UefiCpuPkg/CpuDxe/CpuGdt.c
@@ -2,7 +2,7 @@
C based implementation of IA32 interrupt handling only
requiring a minimal assembly interrupt entry point.
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -13,7 +13,7 @@
//
// Global descriptor table (GDT) Template
//
-STATIC GDT_ENTRIES GdtTemplate = {
+STATIC GDT_ENTRIES mGdtTemplate = {
//
// NULL_SEL
//
@@ -124,27 +124,27 @@ InitGlobalDescriptorTable (
VOID
)
{
- GDT_ENTRIES *gdt;
- IA32_DESCRIPTOR gdtPtr;
+ GDT_ENTRIES *Gdt;
+ IA32_DESCRIPTOR Gdtr;
//
// Allocate Runtime Data for the GDT
//
- gdt = AllocateRuntimePool (sizeof (GdtTemplate) + 8);
- ASSERT (gdt != NULL);
- gdt = ALIGN_POINTER (gdt, 8);
+ Gdt = AllocateRuntimePool (sizeof (mGdtTemplate) + 8);
+ ASSERT (Gdt != NULL);
+ Gdt = ALIGN_POINTER (Gdt, 8);
//
// Initialize all GDT entries
//
- CopyMem (gdt, &GdtTemplate, sizeof (GdtTemplate));
+ CopyMem (Gdt, &mGdtTemplate, sizeof (mGdtTemplate));
//
// Write GDT register
//
- gdtPtr.Base = (UINT32)(UINTN)(VOID*) gdt;
- gdtPtr.Limit = (UINT16) (sizeof (GdtTemplate) - 1);
- AsmWriteGdtr (&gdtPtr);
+ Gdtr.Base = (UINT32) (UINTN) Gdt;
+ Gdtr.Limit = (UINT16) (sizeof (mGdtTemplate) - 1);
+ AsmWriteGdtr (&Gdtr);
//
// Update selector (segment) registers base on new GDT
@@ -152,4 +152,3 @@ InitGlobalDescriptorTable (
SetCodeSelector ((UINT16)CPU_CODE_SEL);
SetDataSelectors ((UINT16)CPU_DATA_SEL);
}
-
--
2.27.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72963): https://edk2.groups.io/g/devel/message/72963
Mute This Topic: https://groups.io/mt/81400141/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
On 03/17/21 12:06, Ray Ni wrote:
> The change doesn't impact any functionality.
>
> Signed-off-by: Ray Ni <ray.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> ---
> UefiCpuPkg/CpuDxe/CpuGdt.c | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.c b/UefiCpuPkg/CpuDxe/CpuGdt.c
> index a1ab543f2d..8847bc4819 100644
> --- a/UefiCpuPkg/CpuDxe/CpuGdt.c
> +++ b/UefiCpuPkg/CpuDxe/CpuGdt.c
> @@ -2,7 +2,7 @@
> C based implementation of IA32 interrupt handling only
> requiring a minimal assembly interrupt entry point.
>
> - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -13,7 +13,7 @@
> //
> // Global descriptor table (GDT) Template
> //
> -STATIC GDT_ENTRIES GdtTemplate = {
> +STATIC GDT_ENTRIES mGdtTemplate = {
> //
> // NULL_SEL
> //
> @@ -124,27 +124,27 @@ InitGlobalDescriptorTable (
> VOID
> )
> {
> - GDT_ENTRIES *gdt;
> - IA32_DESCRIPTOR gdtPtr;
> + GDT_ENTRIES *Gdt;
> + IA32_DESCRIPTOR Gdtr;
>
> //
> // Allocate Runtime Data for the GDT
> //
> - gdt = AllocateRuntimePool (sizeof (GdtTemplate) + 8);
> - ASSERT (gdt != NULL);
> - gdt = ALIGN_POINTER (gdt, 8);
> + Gdt = AllocateRuntimePool (sizeof (mGdtTemplate) + 8);
> + ASSERT (Gdt != NULL);
> + Gdt = ALIGN_POINTER (Gdt, 8);
>
> //
> // Initialize all GDT entries
> //
> - CopyMem (gdt, &GdtTemplate, sizeof (GdtTemplate));
> + CopyMem (Gdt, &mGdtTemplate, sizeof (mGdtTemplate));
>
> //
> // Write GDT register
> //
> - gdtPtr.Base = (UINT32)(UINTN)(VOID*) gdt;
> - gdtPtr.Limit = (UINT16) (sizeof (GdtTemplate) - 1);
> - AsmWriteGdtr (&gdtPtr);
> + Gdtr.Base = (UINT32) (UINTN) Gdt;
> + Gdtr.Limit = (UINT16) (sizeof (mGdtTemplate) - 1);
> + AsmWriteGdtr (&Gdtr);
>
> //
> // Update selector (segment) registers base on new GDT
> @@ -152,4 +152,3 @@ InitGlobalDescriptorTable (
> SetCodeSelector ((UINT16)CPU_CODE_SEL);
> SetDataSelectors ((UINT16)CPU_DATA_SEL);
> }
> -
>
This patch does *slightly* more than what it says on the tin (empty line
removed from the end, also a useless (VOID*) cast is dropped), but I'm
fine with those.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks!
Laszlo
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72972): https://edk2.groups.io/g/devel/message/72972
Mute This Topic: https://groups.io/mt/81400141/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Eric Dong <eric.dong@intel.com>
-----Original Message-----
From: Ni, Ray <ray.ni@intel.com>
Sent: Wednesday, March 17, 2021 7:07 PM
To: devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar, Rahul1 <rahul1.kumar@intel.com>
Subject: [PATCH v2 1/2] UefiCpuPkg/CpuDxe: Rename variables to follow EDKII coding standard
The change doesn't impact any functionality.
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
---
UefiCpuPkg/CpuDxe/CpuGdt.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.c b/UefiCpuPkg/CpuDxe/CpuGdt.c index a1ab543f2d..8847bc4819 100644
--- a/UefiCpuPkg/CpuDxe/CpuGdt.c
+++ b/UefiCpuPkg/CpuDxe/CpuGdt.c
@@ -2,7 +2,7 @@
C based implementation of IA32 interrupt handling only requiring a minimal assembly interrupt entry point. - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ -13,7 +13,7 @@
// // Global descriptor table (GDT) Template //-STATIC GDT_ENTRIES GdtTemplate = {+STATIC GDT_ENTRIES mGdtTemplate = { // // NULL_SEL //@@ -124,27 +124,27 @@ InitGlobalDescriptorTable (
VOID ) {- GDT_ENTRIES *gdt;- IA32_DESCRIPTOR gdtPtr;+ GDT_ENTRIES *Gdt;+ IA32_DESCRIPTOR Gdtr; // // Allocate Runtime Data for the GDT //- gdt = AllocateRuntimePool (sizeof (GdtTemplate) + 8);- ASSERT (gdt != NULL);- gdt = ALIGN_POINTER (gdt, 8);+ Gdt = AllocateRuntimePool (sizeof (mGdtTemplate) + 8);+ ASSERT (Gdt != NULL);+ Gdt = ALIGN_POINTER (Gdt, 8); // // Initialize all GDT entries //- CopyMem (gdt, &GdtTemplate, sizeof (GdtTemplate));+ CopyMem (Gdt, &mGdtTemplate, sizeof (mGdtTemplate)); // // Write GDT register //- gdtPtr.Base = (UINT32)(UINTN)(VOID*) gdt;- gdtPtr.Limit = (UINT16) (sizeof (GdtTemplate) - 1);- AsmWriteGdtr (&gdtPtr);+ Gdtr.Base = (UINT32) (UINTN) Gdt;+ Gdtr.Limit = (UINT16) (sizeof (mGdtTemplate) - 1);+ AsmWriteGdtr (&Gdtr); // // Update selector (segment) registers base on new GDT@@ -152,4 +152,3 @@ InitGlobalDescriptorTable (
SetCodeSelector ((UINT16)CPU_CODE_SEL); SetDataSelectors ((UINT16)CPU_DATA_SEL); }---
2.27.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72994): https://edk2.groups.io/g/devel/message/72994
Mute This Topic: https://groups.io/mt/81400141/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.