* PROGRAMMERS: Timo Kreuzer
*/
-.intel_syntax noprefix
+#include <asm.inc>
/* FUNCTIONS ****************************************************************/
-
+.code
/* PSLIST_ENTRY
* NTAPI
* RtlInterlockedPopEntrySList(
* IN PSLIST_HEADER ListHead);
*/
-.global _ExpInterlockedPopEntrySListResume@0
-.global _ExpInterlockedPopEntrySListEnd@0
-.global _ExpInterlockedPopEntrySListFault@0
-.global _RtlInterlockedPopEntrySList@4
+PUBLIC _ExpInterlockedPopEntrySListResume@0
+PUBLIC _ExpInterlockedPopEntrySListEnd@0
+PUBLIC _ExpInterlockedPopEntrySListFault@0
+PUBLIC _RtlInterlockedPopEntrySList@4
_RtlInterlockedPopEntrySList@4:
/* Save registers */
/* Load ListHead->Depth and ListHead->Sequence into edx */
mov edx, [ebp + 4]
-1:
/* Check if ListHead->Next is NULL */
or eax, eax
- jz 2f
+ jz _ExpInterlockedPopEntrySList2
/* Copy Depth and Sequence number and adjust Depth */
lea ecx, [edx - 1]
jnz _ExpInterlockedPopEntrySListResume@0
/* Restore registers and return */
-2:
+_ExpInterlockedPopEntrySList2:
pop ebp
pop ebx
ret 4
* IN PSLIST_HEADER ListHead,
* IN PSLIST_ENTRY ListEntry);
*/
-.global _RtlInterlockedPushEntrySList@8
+PUBLIC _RtlInterlockedPushEntrySList@8
_RtlInterlockedPushEntrySList@8:
/* Save registers */
/* Load ListHead->Depth and ListHead->Sequence into edx */
mov edx, [ebp + 4]
-1:
+_RtlpInterlockedPushEntrySListResume:
/* Set ListEntry->Next to ListHead->Next */
mov [ebx], eax
/* Copy ListHead->Depth and ListHead->Sequence and adjust them */
- lea ecx, [edx + 0x10001]
+ lea ecx, [edx + HEX(10001)]
/* If [ebp] equals edx:eax, exchange it with ecx:ebx */
LOCK cmpxchg8b qword ptr [ebp]
/* If not equal, retry with edx:eax, being the content of [ebp] now */
- jnz 1b
+ jnz _RtlpInterlockedPushEntrySListResume
/* Restore registers and return */
pop ebp
* RtlInterlockedFlushSList(
* IN PSINGLE_LIST_ENTRY ListHead);
*/
-.global _RtlInterlockedFlushSList@4
+PUBLIC _RtlInterlockedFlushSList@4
_RtlInterlockedFlushSList@4:
/* Save registers */
/* Load ListHead->Depth and ListHead->Sequence into edx */
mov edx, [ebp + 4]
-1:
+_RtlpInterlockedFlushSListResume:
/* Check if ListHead->Next is NULL */
or eax, eax
- jz 2f
+ jz _RtlpInterlockedFlushSListEnd
/* Copy Depth and Sequence number to ecx */
mov ecx, edx
LOCK cmpxchg8b qword ptr [ebp]
/* If not equal, retry with edx:eax, being the content of [ebp] now */
- jnz 1b
+ jnz _RtlpInterlockedFlushSListResume
/* Restore registers and return */
-2:
+_RtlpInterlockedFlushSListEnd:
pop ebp
pop ebx
ret 4
+
+END