mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[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
This commit is contained in:
parent
41563f3396
commit
c030074001
1 changed files with 2 additions and 2 deletions
|
@ -27,10 +27,10 @@ Author:
|
||||||
// KPCR Access for non-IA64 builds
|
// KPCR Access for non-IA64 builds
|
||||||
//
|
//
|
||||||
#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS))
|
#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS))
|
||||||
#define PCR ((volatile KPCR * const)K0IPCR)
|
#define PCR ((KPCR * const)K0IPCR)
|
||||||
#if defined(CONFIG_SMP) || defined(NT_BUILD)
|
#if defined(CONFIG_SMP) || defined(NT_BUILD)
|
||||||
#undef KeGetPcr
|
#undef KeGetPcr
|
||||||
#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C))
|
#define KeGetPcr() ((KPCR * const)__readfsdword(FIELD_OFFSET(KPCR, Self)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue