diff --git a/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S b/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S index 566f37f5a0c..43b832788f2 100644 --- a/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S +++ b/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S @@ -155,8 +155,8 @@ PUBLIC @ExfInterlockedInsertHeadList@12 /*PLIST_ENTRY *FASTCALL *ExfInterlockedInsertTailList(IN PLIST_ENTRY ListHead, - * IN PLIST_ENTRY ListEntry, - * IN PKSPIN_LOCK Lock) + * IN PLIST_ENTRY ListEntry, + * IN PKSPIN_LOCK Lock) */ PUBLIC @ExfInterlockedInsertTailList@12 @ExfInterlockedInsertTailList@12: @@ -537,7 +537,7 @@ PUBLIC @Exfi386InterlockedDecrementLong@4 /*ULONG *FASTCALL - *Exfi386InterlockedExchangeUlong(IN PULONG Taget, + *Exfi386InterlockedExchangeUlong(IN PULONG Target, * IN ULONG Value) */ PUBLIC @Exfi386InterlockedExchangeUlong@8 @@ -591,16 +591,16 @@ PUBLIC @ExfInterlockedCompareExchange64@12 /*PVOID *FASTCALL - *ExfInterlockedCompareExchange64(IN PLONGLONG Destination, - * IN PLONGLONG Exchange, - * IN PLONGLONG Comperand, - * IN PKSPIN_LOCK Lock) + *ExInterlockedCompareExchange64(IN PLONGLONG Destination, + * IN PLONGLONG Exchange, + * IN PLONGLONG Comperand, + * IN PKSPIN_LOCK Lock) */ PUBLIC @ExInterlockedCompareExchange64@16 @ExInterlockedCompareExchange64@16: /* Save registers */ - push ebp + push ebx push ebp /* Get destination pointer, exchange value and comperand value/address */ diff --git a/reactos/ntoskrnl/ex/i386/interlck_asm.S b/reactos/ntoskrnl/ex/i386/interlck_asm.S index 755813e80d8..1cac56b50a9 100644 --- a/reactos/ntoskrnl/ex/i386/interlck_asm.S +++ b/reactos/ntoskrnl/ex/i386/interlck_asm.S @@ -5,7 +5,7 @@ * PURPOSE: STDCALL Interlocked Functions * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) */ - + /* INCLUDES ******************************************************************/ #include @@ -26,8 +26,8 @@ /*PLIST_ENTRY *NTAPI - *ExInterlockedAddLargeInteger(IN PLIST_ENTRY ListHead, - * IN PLIST_ENTRY ListEntry, + *ExInterlockedAddLargeInteger(IN PLARGE_INTEGER Addend, + * IN LARGE_INTEGER Increment, * IN PKSPIN_LOCK Lock) */ PUBLIC _ExInterlockedAddLargeInteger@16 @@ -92,9 +92,9 @@ _ExInterlockedAddLargeInteger@16: /*PLIST_ENTRY *NTAPI - *ExInterlockedInsertHeadList(IN PLIST_ENTRY ListHead, - * IN PLIST_ENTRY ListEntry, - * IN PKSPIN_LOCK Lock) + *ExInterlockedAddUlong(IN PULONG Addend, + * IN ULONG Increment, + * IN PKSPIN_LOCK Lock) */ PUBLIC _ExInterlockedAddUlong@12 _ExInterlockedAddUlong@12: @@ -471,14 +471,18 @@ _ExInterlockedDecrementLong@8: PUBLIC _ExInterlockedExchangeUlong@12 _ExInterlockedExchangeUlong@12: +#ifdef CONFIG_SMP /* Get pointers */ mov edx, [esp+4] mov eax, [esp+8] -#ifdef CONFIG_SMP /* On MP, do the exchange */ xchg [edx], eax #else + /* Get pointers */ + mov edx, [esp+4] + mov ecx, [esp+8] + /* On UP, disable interrupts and save flags */ pushfd cli @@ -494,8 +498,7 @@ _ExInterlockedExchangeUlong@12: /*INTERLOCKED_RESULT *NTAPI - *Exi386InterlockedIncrementLong(IN PLONG Addend, - * IN PKSPIN_LOCK Lock) + *Exi386InterlockedIncrementLong(IN PLONG Addend) */ PUBLIC _Exi386InterlockedIncrementLong@4 _Exi386InterlockedIncrementLong@4: @@ -513,8 +516,7 @@ _Exi386InterlockedIncrementLong@4: /*INTERLOCKED_RESULT *NTAPI - *Exi386InterlockedDecrementLong(IN PLONG Addend, - * IN PKSPIN_LOCK Lock) + *Exi386InterlockedDecrementLong(IN PLONG Addend) */ PUBLIC _Exi386InterlockedDecrementLong@4 _Exi386InterlockedDecrementLong@4: @@ -528,25 +530,28 @@ _Exi386InterlockedDecrementLong@4: /* Return */ lahf and eax, EFLAG_SELECT - ret 8 + ret 4 /*ULONG *NTAPI *Exi386InterlockedExchangeUlong(IN PULONG Target, - * IN ULONG Value, - * IN PKSPIN_LOCK Lock) + * IN ULONG Value) */ -PUBLIC _Exi386InterlockedExchangeUlong@12 -_Exi386InterlockedExchangeUlong@12: +PUBLIC _Exi386InterlockedExchangeUlong@8 +_Exi386InterlockedExchangeUlong@8: +#ifdef CONFIG_SMP /* Get pointers */ mov edx, [esp+4] mov eax, [esp+8] -#ifdef CONFIG_SMP /* On MP, do the exchange */ xchg [edx], eax #else + /* Get pointers */ + mov edx, [esp+4] + mov ecx, [esp+8] + /* On UP, disable interrupts and save flags */ pushfd cli diff --git a/reactos/ntoskrnl/ntoskrnl.pspec b/reactos/ntoskrnl/ntoskrnl.pspec index 81a43664101..78d357dc75d 100644 --- a/reactos/ntoskrnl/ntoskrnl.pspec +++ b/reactos/ntoskrnl/ntoskrnl.pspec @@ -198,7 +198,7 @@ @ FASTCALL -arch=i386 Exfi386InterlockedExchangeUlong(ptr long) @ FASTCALL -arch=i386 Exfi386InterlockedIncrementLong(ptr) @ stdcall -arch=i386 Exi386InterlockedDecrementLong(ptr) -@ stdcall -arch=i386 Exi386InterlockedExchangeUlong(ptr long long) +@ stdcall -arch=i386 Exi386InterlockedExchangeUlong(ptr long) @ stdcall -arch=i386 Exi386InterlockedIncrementLong(ptr) @ FASTCALL -arch=i386 ExiAcquireFastMutex(ptr) ExAcquireFastMutex @ FASTCALL -arch=i386 ExiReleaseFastMutex(ptr) ExReleaseFastMutex diff --git a/reactos/ntoskrnl/ntoskrnl.spec b/reactos/ntoskrnl/ntoskrnl.spec index c60c30cbb40..a4d99747be6 100644 --- a/reactos/ntoskrnl/ntoskrnl.spec +++ b/reactos/ntoskrnl/ntoskrnl.spec @@ -178,7 +178,7 @@ @ fastcall -arch=i386 Exfi386InterlockedExchangeUlong(ptr long) @ fastcall -arch=i386 Exfi386InterlockedIncrementLong(ptr) @ stdcall -arch=i386 Exi386InterlockedDecrementLong(ptr) -@ stdcall -arch=i386 Exi386InterlockedExchangeUlong(ptr long long) +@ stdcall -arch=i386 Exi386InterlockedExchangeUlong(ptr long) @ stdcall -arch=i386 Exi386InterlockedIncrementLong(ptr) @ fastcall -arch=i386 ExiAcquireFastMutex(ptr) ExAcquireFastMutex @ fastcall -arch=i386 ExiReleaseFastMutex(ptr) ExReleaseFastMutex