From c030074001cf9877d63cb4b7295c93dba2ca0110 Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Sat, 23 Jan 2010 18:28:14 +0000 Subject: [PATCH] [PERF]: Do not declare the PCR in KeGetPcr as volatile. It is only volatile as in "if there is a context switch, the PCR is different". You are in a LOT of trouble if the thread switches while your code is running in the first place, and your code is somehow running as a different thread! This change makes C code a lot neater, especially during PCR access, because it doesn't force reloading the PCR each time. For example, Read-Modify-Operations on the PCR, such as AND are 1 line of assembly instead of 3. This helps and will help further with the C HAL, as well as the C trap handlers. svn path=/trunk/; revision=45210 --- reactos/include/ndk/i386/ketypes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/ndk/i386/ketypes.h b/reactos/include/ndk/i386/ketypes.h index 05a8850fead..864fa9c8c13 100644 --- a/reactos/include/ndk/i386/ketypes.h +++ b/reactos/include/ndk/i386/ketypes.h @@ -27,10 +27,10 @@ Author: // KPCR Access for non-IA64 builds // #define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) -#define PCR ((volatile KPCR * const)K0IPCR) +#define PCR ((KPCR * const)K0IPCR) #if defined(CONFIG_SMP) || defined(NT_BUILD) #undef KeGetPcr -#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) +#define KeGetPcr() ((KPCR * const)__readfsdword(FIELD_OFFSET(KPCR, Self))) #endif //