X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Flib%2Frtl%2Famd64%2Fslist.S;h=c677aa609f4c77ed80b76a4f84432f55f1a9ed91;hp=38f257f0fc402e7c15de3d2f01c136e3e6319b68;hb=0100d8de0ce8d4779228bd13e6b6073b93dbad26;hpb=e31acf630c72170959f775bd0b89bb2050525877 diff --git a/reactos/lib/rtl/amd64/slist.S b/reactos/lib/rtl/amd64/slist.S index 38f257f0fc4..c677aa609f4 100644 --- a/reactos/lib/rtl/amd64/slist.S +++ b/reactos/lib/rtl/amd64/slist.S @@ -9,6 +9,8 @@ #include #include +EXTERN RtlpUse16ByteSLists:BYTE + /* typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER { @@ -99,11 +101,11 @@ ExpInterlockedPopEntrySList: /* Load ListHead->Alignment into rax */ mov rax, [rcx] - /* Check what kind of header this is */ - test rdx, SLIST8B_HEADERTYPE_MASK - jnz RtlInterlockedPopEntrySList16 + /* Check for 16 byte SList support */ + cmp byte ptr [RtlpUse16ByteSLists], 0 + jne RtlInterlockedPopEntrySList16 - /* We have an 8 byte header */ + /* Use the 8 byte header */ ExpInterlockedPopEntrySListResume: @@ -229,6 +231,13 @@ ExpInterlockedPushEntrySList: /* Not aligned, raise an assertion */ int HEX(2C) ExpInterlockedPushEntrySListChecked: + + /* Make sure RtlpUse16ByteSLists is initialized */ + cmp byte ptr [RtlpUse16ByteSLists], HEX(FF) + jne ExpInterlockedPushEntrySListChecked2 + /* Not initialized, raise an assertion */ + int HEX(2C) +ExpInterlockedPushEntrySListChecked2: #endif /* Load ListHead->Alignment into rax */ @@ -237,11 +246,11 @@ ExpInterlockedPushEntrySListChecked: /* Load ListHead->Region into r9 */ mov r9, [rcx + 8] - /* Check what kind of header this is */ - test r9, SLIST8B_HEADERTYPE_MASK - jnz RtlInterlockedPushEntrySList16 + /* Check for 16 byte SList support */ + cmp byte ptr [RtlpUse16ByteSLists], 0 + jne RtlInterlockedPushEntrySList16 - /* We have an 8 byte header */ + /* Use the 8 byte header */ RtlInterlockedPushEntrySListLoop: @@ -358,11 +367,11 @@ ExpInterlockedFlushSList: /* Load ListHead->Alignment into rax */ mov rax, [rcx] - /* Check what kind of header this is */ - test rdx, SLIST8B_HEADERTYPE_MASK - jnz RtlInterlockedFlushSList16 + /* Check for 16 byte SList support */ + cmp byte ptr [RtlpUse16ByteSLists], 0 + jne RtlInterlockedFlushSList16 - /* We have an 8 byte header */ + /* Use the 8 byte header */ RtlInterlockedFlushSListLoop: