[ros-dev] [ros-diffs] [tkreuzer] 34970: - update KPCR and KIPCR - add KeGetPcr() and update KeGetCurrentProcessorNumber
Timo Kreuzer
timo.kreuzer at web.de
Thu Jul 31 21:44:00 CEST 2008
You have probably noticed it's in the KIPCR, not the KPCR. I could not
find KIPCR documented anywhere, but maybe you can give me a hint where
to find one.
Thanks,
Timo
Alex Ionescu schrieb:
> Kinda curious why you have "unknowns" in a documented structure.
>
> On 30-Jul-08, at 7:17 PM, tkreuzer at svn.reactos.org wrote:
>
>
>> Author: tkreuzer
>> Date: Wed Jul 30 21:16:59 2008
>> New Revision: 34970
>>
>> URL: http://svn.reactos.org/svn/reactos?rev=34970&view=rev
>> Log:
>> - update KPCR and KIPCR
>> - add KeGetPcr() and update KeGetCurrentProcessorNumber
>>
>> Modified:
>> branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
>> branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h
>>
>> Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
>> URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/ddk/winddk.h?rev=34970&r1=34969&r2=34970&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> ======================================================================
>> --- branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
>> [iso-8859-1] (original)
>> +++ branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
>> [iso-8859-1] Wed Jul 30 21:16:59 2008
>> @@ -5516,23 +5516,38 @@
>>
>> typedef struct _KPCR
>> {
>> - NT_TIB NtTib;
>> - struct _KPRCB *CurrentPrcb;
>> - ULONG64 SavedRcx;
>> - ULONG64 SavedR11;
>> + union
>> + {
>> + NT_TIB NtTib;
>> + struct
>> + {
>> + union _KGDTENTRY64 *GdtBase;
>> + struct _KTSS64 *TssBase;
>> + ULONG64 UserRsp;
>> + struct _KPCR *Self;
>> + struct _KPRCB *CurrentPrcb;
>> + PKSPIN_LOCK_QUEUE LockArray;
>> + PVOID Used_Self;
>> + };
>> + };
>> + union _KIDTENTRY64 *IdtBase;
>> + ULONG64 Unused[2];
>> KIRQL Irql;
>> UCHAR SecondLevelCacheAssociativity;
>> - UCHAR Number;
>> + UCHAR ObsoleteNumber;
>> UCHAR Fill0;
>> - ULONG Irr;
>> - ULONG IrrActive;
>> - ULONG Idr;
>> + ULONG Unused0[3];
>> USHORT MajorVersion;
>> USHORT MinorVersion;
>> ULONG StallScaleFactor;
>> - union _KIDTENTRY64 *IdtBase;
>> - union _KGDTENTRY64 *GdtBase;
>> - struct _KTSS64 *TssBase;
>> + PVOID Unused1[3];
>> + ULONG KernelReserved[15];
>> + ULONG SecondLevelCacheSize;
>> + ULONG HalReserved[16];
>> + ULONG Unused2;
>> + PVOID KdVersionBlock;
>> + PVOID Unused3;
>> + ULONG PcrAlign1[24];
>> } KPCR, *PKPCR;
>>
>> typedef struct _KFLOATING_SAVE {
>> @@ -5552,10 +5567,17 @@
>> VOID);
>>
>> FORCEINLINE
>> +PKPCR
>> +KeGetPcr(VOID)
>> +{
>> + return (PKPCR)__readgsqword(FIELD_OFFSET(KPCR, Self));
>> +}
>> +
>> +FORCEINLINE
>> ULONG
>> KeGetCurrentProcessorNumber(VOID)
>> {
>> - return (ULONG)__readgsbyte(FIELD_OFFSET(KPCR, Number));
>> + return (ULONG)__readgsword(0x184);
>> }
>>
>> #elif defined(__PowerPC__)
>>
>> Modified: branches/ros-amd64-bringup/reactos/include/ndk/amd64/
>> ketypes.h
>> URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h?rev=34970&r1=34969&r2=34970&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> ======================================================================
>> --- branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h
>> [iso-8859-1] (original)
>> +++ branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h
>> [iso-8859-1] Wed Jul 30 21:16:59 2008
>> @@ -635,41 +635,42 @@
>> NT_TIB NtTib;
>> struct
>> {
>> - struct _EXCEPTION_REGISTRATION_RECORD
>> *Used_ExceptionList;
>> - PVOID Used_StackBase;
>> - PVOID PerfGlobalGroupMask;
>> - PVOID TssCopy;
>> - ULONG ContextSwitches;
>> - KAFFINITY SetMemberCopy;
>> + union _KGDTENTRY64 *GdtBase;
>> + struct _KTSS64 *TssBase;
>> + ULONG64 UserRsp;
>> + struct _KPCR *Self;
>> + struct _KPRCB *CurrentPrcb;
>> + PKSPIN_LOCK_QUEUE LockArray;
>> PVOID Used_Self;
>> };
>> };
>> - struct _KPCR *Self;
>> - struct _KPRCB *Prcb;
>> + union _KIDTENTRY64 *IdtBase;
>> + ULONG64 Unused[2];
>> KIRQL Irql;
>> - ULONG IRR;
>> - ULONG IrrActive;
>> - ULONG IDR;
>> - PVOID KdVersionBlock;
>> - PKIDTENTRY IDT;
>> - PKGDTENTRY GDT;
>> - struct _KTSS *TSS;
>> + UCHAR SecondLevelCacheAssociativity;
>> + UCHAR ObsoleteNumber;
>> + UCHAR Fill0;
>> + ULONG Unused0[3];
>> USHORT MajorVersion;
>> USHORT MinorVersion;
>> - KAFFINITY SetMember;
>> ULONG StallScaleFactor;
>> - UCHAR SparedUnused;
>> - UCHAR Number;
>> - UCHAR Reserved;
>> - UCHAR L2CacheAssociativity;
>> - ULONG VdmAlert;
>> - ULONG KernelReserved[14];
>> + PVOID Unused1[3];
>> + ULONG KernelReserved[15];
>> ULONG SecondLevelCacheSize;
>> ULONG HalReserved[16];
>> - ULONG InterruptMode;
>> - UCHAR Spare1;
>> - ULONG KernelReserved2[17];
>> - KPRCB PrcbData;
>> + ULONG Unused2;
>> + ULONG Fill1;
>> + PVOID KdVersionBlock; // 0x108
>> + PVOID Unused3;
>> + ULONG PcrAlign1[24];
>> +
>> + ULONG Unknown1; // 0x178
>> + ULONG Unknown2;
>> + ULONG Unknown3;
>> + USHORT CpuNumber; // 0x184
>> + // hack:
>> + ULONG ContextSwitches;
>> +
>> } KIPCR, *PKIPCR;
>> #pragma pack(pop)
>>
>>
>>
>
> Best regards,
> Alex Ionescu
>
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-dev/attachments/20080731/90ba29ee/attachment.html
More information about the Ros-dev
mailing list