mirror of
https://github.com/reactos/reactos.git
synced 2024-09-27 21:16:34 +00:00
[NTOS:KE] Move KiGet/SetProcessorType function below KiGetCpuVendor
CORE-17974
This commit is contained in:
parent
d74ceb6559
commit
cc82bc14e2
|
@ -37,36 +37,6 @@ static const CHAR CmpCentaurID[] = "CentaurHauls";
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* 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
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
KiGetCpuVendor(VOID)
|
KiGetCpuVendor(VOID)
|
||||||
|
@ -107,6 +77,36 @@ KiGetCpuVendor(VOID)
|
||||||
return Prcb->CpuVendor;
|
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
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
KiGetFeatureBits(VOID)
|
KiGetFeatureBits(VOID)
|
||||||
|
|
|
@ -85,37 +85,6 @@ setCx86(UCHAR reg, UCHAR data)
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* 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")
|
CODE_SEG("INIT")
|
||||||
ULONG
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -168,6 +137,37 @@ KiGetCpuVendor(VOID)
|
||||||
return CPU_UNKNOWN;
|
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")
|
CODE_SEG("INIT")
|
||||||
ULONG
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
Loading…
Reference in a new issue