projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5db202
)
[NTOSKRNL] Properly align runrefs on SMP in ExInitializeRundownProtectionCacheAware()
author
Pierre Schweitzer
<pierre@reactos.org>
Sat, 17 Nov 2018 14:49:50 +0000
(15:49 +0100)
committer
Pierre Schweitzer
<pierre@reactos.org>
Sat, 17 Nov 2018 15:44:36 +0000
(16:44 +0100)
ntoskrnl/ex/rundown.c
patch
|
blob
|
history
diff --git
a/ntoskrnl/ex/rundown.c
b/ntoskrnl/ex/rundown.c
index
cde0bf7
..
340a2d8
100644
(file)
--- a/
ntoskrnl/ex/rundown.c
+++ b/
ntoskrnl/ex/rundown.c
@@
-581,7
+581,7
@@
ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCac
{
PVOID Pool;
PEX_RUNDOWN_REF RunRef;
- ULONG Count, RunRefSize, Offset;
+ ULONG Count, RunRefSize, Offset
, Align
;
PAGED_CODE();
@@
-601,8
+601,13
@@
ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCac
}
else
{
- /* FIXME: Properly align on SMP */
- UNIMPLEMENTED;
+ /* Get alignment constraint */
+ Align = KeGetRecommendedSharedDataAlignment();
+
+ /* How many runrefs given the alignment? */
+ RunRefSize = Align;
+ Count = ((Size - sizeof(EX_RUNDOWN_REF_CACHE_AWARE)) / Align) - 1;
+ Pool = (PVOID)ALIGN_UP_BY(Pool, Align);
}
/* Initialize the structure */