mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:KE] Move KiGet/SetProcessorType function below KiGetCpuVendor
CORE-17974
This commit is contained in:
parent
d74ceb6559
commit
cc82bc14e2
2 changed files with 61 additions and 61 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue