https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc82bc14e2efd08e92ec7b532020d0a330003091

commit cc82bc14e2efd08e92ec7b532020d0a330003091
Author:     Stanislav Motylkov <[email protected]>
AuthorDate: Mon May 9 20:38:02 2022 +0300
Commit:     Stanislav Motylkov <[email protected]>
CommitDate: Mon May 9 21:50:19 2022 +0300

    [NTOS:KE] Move KiGet/SetProcessorType function below KiGetCpuVendor
    
    CORE-17974
---
 ntoskrnl/ke/amd64/cpu.c | 60 +++++++++++++++++++++++------------------------
 ntoskrnl/ke/i386/cpu.c  | 62 ++++++++++++++++++++++++-------------------------
 2 files changed, 61 insertions(+), 61 deletions(-)

diff --git a/ntoskrnl/ke/amd64/cpu.c b/ntoskrnl/ke/amd64/cpu.c
index 659264cde30..cbce873f619 100644
--- a/ntoskrnl/ke/amd64/cpu.c
+++ b/ntoskrnl/ke/amd64/cpu.c
@@ -37,36 +37,6 @@ static const CHAR CmpCentaurID[]     = "CentaurHauls";
 
 /* FUNCTIONS *****************************************************************/
 
-VOID
-NTAPI
-KiSetProcessorType(VOID)
-{
-    CPU_INFO CpuInfo;
-    ULONG Stepping, Type;
-
-    /* Do CPUID 1 now */
-    KiCpuId(&CpuInfo, 1);
-
-    /*
-     * Get the Stepping and Type. The stepping contains both the
-     * Model and the Step, while the Type contains the returned Type.
-     * We ignore the family.
-     *
-     * For the stepping, we convert this: zzzzzzxy into this: x0y
-     */
-    Stepping = CpuInfo.Eax & 0xF0;
-    Stepping <<= 4;
-    Stepping += (CpuInfo.Eax & 0xFF);
-    Stepping &= 0xF0F;
-    Type = CpuInfo.Eax & 0xF00;
-    Type >>= 8;
-
-    /* Save them in the PRCB */
-    KeGetCurrentPrcb()->CpuID = TRUE;
-    KeGetCurrentPrcb()->CpuType = (UCHAR)Type;
-    KeGetCurrentPrcb()->CpuStep = (USHORT)Stepping;
-}
-
 ULONG
 NTAPI
 KiGetCpuVendor(VOID)
@@ -107,6 +77,36 @@ KiGetCpuVendor(VOID)
     return Prcb->CpuVendor;
 }
 
+VOID
+NTAPI
+KiSetProcessorType(VOID)
+{
+    CPU_INFO CpuInfo;
+    ULONG Stepping, Type;
+
+    /* Do CPUID 1 now */
+    KiCpuId(&CpuInfo, 1);
+
+    /*
+     * Get the Stepping and Type. The stepping contains both the
+     * Model and the Step, while the Type contains the returned Type.
+     * We ignore the family.
+     *
+     * For the stepping, we convert this: zzzzzzxy into this: x0y
+     */
+    Stepping = CpuInfo.Eax & 0xF0;
+    Stepping <<= 4;
+    Stepping += (CpuInfo.Eax & 0xFF);
+    Stepping &= 0xF0F;
+    Type = CpuInfo.Eax & 0xF00;
+    Type >>= 8;
+
+    /* Save them in the PRCB */
+    KeGetCurrentPrcb()->CpuID = TRUE;
+    KeGetCurrentPrcb()->CpuType = (UCHAR)Type;
+    KeGetCurrentPrcb()->CpuStep = (USHORT)Stepping;
+}
+
 ULONG
 NTAPI
 KiGetFeatureBits(VOID)
diff --git a/ntoskrnl/ke/i386/cpu.c b/ntoskrnl/ke/i386/cpu.c
index e627efe228a..4a53f407800 100644
--- a/ntoskrnl/ke/i386/cpu.c
+++ b/ntoskrnl/ke/i386/cpu.c
@@ -85,37 +85,6 @@ setCx86(UCHAR reg, UCHAR data)
 
 /* FUNCTIONS *****************************************************************/
 
-CODE_SEG("INIT")
-VOID
-NTAPI
-KiSetProcessorType(VOID)
-{
-    CPU_INFO CpuInfo;
-    ULONG Stepping, Type;
-
-    /* Do CPUID 1 now */
-    KiCpuId(&CpuInfo, 1);
-
-    /*
-     * Get the Stepping and Type. The stepping contains both the
-     * Model and the Step, while the Type contains the returned Type.
-     * We ignore the family.
-     *
-     * For the stepping, we convert this: zzzzzzxy into this: x0y
-     */
-    Stepping = CpuInfo.Eax & 0xF0;
-    Stepping <<= 4;
-    Stepping += (CpuInfo.Eax & 0xFF);
-    Stepping &= 0xF0F;
-    Type = CpuInfo.Eax & 0xF00;
-    Type >>= 8;
-
-    /* Save them in the PRCB */
-    KeGetCurrentPrcb()->CpuID = TRUE;
-    KeGetCurrentPrcb()->CpuType = (UCHAR)Type;
-    KeGetCurrentPrcb()->CpuStep = (USHORT)Stepping;
-}
-
 CODE_SEG("INIT")
 ULONG
 NTAPI
@@ -168,6 +137,37 @@ KiGetCpuVendor(VOID)
     return CPU_UNKNOWN;
 }
 
+CODE_SEG("INIT")
+VOID
+NTAPI
+KiSetProcessorType(VOID)
+{
+    CPU_INFO CpuInfo;
+    ULONG Stepping, Type;
+
+    /* Do CPUID 1 now */
+    KiCpuId(&CpuInfo, 1);
+
+    /*
+     * Get the Stepping and Type. The stepping contains both the
+     * Model and the Step, while the Type contains the returned Type.
+     * We ignore the family.
+     *
+     * For the stepping, we convert this: zzzzzzxy into this: x0y
+     */
+    Stepping = CpuInfo.Eax & 0xF0;
+    Stepping <<= 4;
+    Stepping += (CpuInfo.Eax & 0xFF);
+    Stepping &= 0xF0F;
+    Type = CpuInfo.Eax & 0xF00;
+    Type >>= 8;
+
+    /* Save them in the PRCB */
+    KeGetCurrentPrcb()->CpuID = TRUE;
+    KeGetCurrentPrcb()->CpuType = (UCHAR)Type;
+    KeGetCurrentPrcb()->CpuStep = (USHORT)Stepping;
+}
+
 CODE_SEG("INIT")
 ULONG
 NTAPI

Reply via email to