[NDK]: Fix KPCR definition.

[DDK]: KeGetCurrentProcessorNumber should not return a 32-bit DWORD combined of "ProcessorNumer", "VdmAlert" and "SecondLevelCacheAssociativity" because those 3 fields are probably not equal to a processor number. Having an L2 Cache will no longer result in ReactOS believing you have a 32000 core CPU.

svn path=/trunk/; revision=45299
This commit is contained in:
Sir Richard 2010-01-28 16:05:54 +00:00
parent 08d30b3abb
commit 8ae0ebe9dd
3 changed files with 4 additions and 20 deletions

View file

@ -5149,23 +5149,7 @@ FORCEINLINE
ULONG
KeGetCurrentProcessorNumber(VOID)
{
#if defined(__GNUC__)
ULONG ret;
__asm__ __volatile__ (
"movl %%fs:%c1, %0\n"
: "=r" (ret)
: "i" (FIELD_OFFSET(KPCR, Number))
);
return ret;
#elif defined(_MSC_VER)
#if _MSC_FULL_VER >= 13012035
return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number));
#else
__asm { movzx eax, fs:[0] KPCR.Number }
#endif
#else
#error Unknown compiler
#endif
return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number));
}
NTHALAPI

View file

@ -705,8 +705,8 @@ typedef struct _KIPCR
ULONG StallScaleFactor;
UCHAR SpareUnused;
UCHAR Number;
UCHAR Reserved;
UCHAR L2CacheAssociativity;
UCHAR Spare0;
UCHAR SecondLevelCacheAssociativity;
ULONG VdmAlert;
ULONG KernelReserved[14];
ULONG SecondLevelCacheSize;

View file

@ -1788,7 +1788,7 @@ KdbpCmdPcr(
Pcr->NtTib.Self, Pcr->Self, Pcr->Prcb, Pcr->Irql, Pcr->IRR, Pcr->IrrActive,
Pcr->IDR, Pcr->KdVersionBlock, Pcr->IDT, Pcr->GDT, Pcr->TSS,
Pcr->MajorVersion, Pcr->MinorVersion, Pcr->SetMember, Pcr->StallScaleFactor,
Pcr->Number, Pcr->L2CacheAssociativity,
Pcr->Number, Pcr->SecondLevelCacheAssociativity,
Pcr->VdmAlert, Pcr->SecondLevelCacheSize, Pcr->InterruptMode);
return TRUE;