[PERF]: Do not declare the PCR in KeGetPcr as volatile. It is only volatile as in...
authorSir Richard <sir_richard@svn.reactos.org>
Sat, 23 Jan 2010 18:28:14 +0000 (18:28 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Sat, 23 Jan 2010 18:28:14 +0000 (18:28 +0000)
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

index 05a8850..864fa9c 100644 (file)
@@ -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
 
 //