Author: tkreuzer Date: Wed Jul 20 13:48:06 2011 New Revision: 52735
URL: http://svn.reactos.org/svn/reactos?rev=52735&view=rev Log: [NTOSKRNL] Patch by Thomas Faber: Fix broken interlocked functions
See issue #6374 for more details.
Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S trunk/reactos/ntoskrnl/ex/i386/interlck_asm.S trunk/reactos/ntoskrnl/ntoskrnl.pspec trunk/reactos/ntoskrnl/ntoskrnl.spec
Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/i386/fastinterl... ============================================================================== --- trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S [iso-8859-1] Wed Jul 20 13:48:06 2011 @@ -155,8 +155,8 @@ /*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 @@
/*ULONG *FASTCALL - *Exfi386InterlockedExchangeUlong(IN PULONG Taget, + *Exfi386InterlockedExchangeUlong(IN PULONG Target, * IN ULONG Value) */ PUBLIC @Exfi386InterlockedExchangeUlong@8 @@ -591,16 +591,16 @@
/*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 */
Modified: trunk/reactos/ntoskrnl/ex/i386/interlck_asm.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/i386/interlck_a... ============================================================================== --- trunk/reactos/ntoskrnl/ex/i386/interlck_asm.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/i386/interlck_asm.S [iso-8859-1] Wed Jul 20 13:48:06 2011 @@ -5,7 +5,7 @@ * PURPOSE: STDCALL Interlocked Functions * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) */ - + /* INCLUDES ******************************************************************/
#include <asm.inc> @@ -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 @@
/*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 @@ 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 @@
/*INTERLOCKED_RESULT *NTAPI - *Exi386InterlockedIncrementLong(IN PLONG Addend, - * IN PKSPIN_LOCK Lock) + *Exi386InterlockedIncrementLong(IN PLONG Addend) */ PUBLIC _Exi386InterlockedIncrementLong@4 _Exi386InterlockedIncrementLong@4: @@ -513,8 +516,7 @@
/*INTERLOCKED_RESULT *NTAPI - *Exi386InterlockedDecrementLong(IN PLONG Addend, - * IN PKSPIN_LOCK Lock) + *Exi386InterlockedDecrementLong(IN PLONG Addend) */ PUBLIC _Exi386InterlockedDecrementLong@4 _Exi386InterlockedDecrementLong@4: @@ -528,25 +530,28 @@ /* Return */ lahf and eax, EFLAG_SELECT - ret 8 + ret 4
/*ULONG *NTAPI *Exi386InterlockedExchangeUlong(IN PULONG Target, - * IN ULONG Value, - * IN PKSPIN_LOCK Lock) - */ -PUBLIC _Exi386InterlockedExchangeUlong@12 -_Exi386InterlockedExchangeUlong@12: - + * IN ULONG Value) + */ +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
Modified: trunk/reactos/ntoskrnl/ntoskrnl.pspec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.pspec?rev... ============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.pspec [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.pspec [iso-8859-1] Wed Jul 20 13:48:06 2011 @@ -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
Modified: trunk/reactos/ntoskrnl/ntoskrnl.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.spec?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] Wed Jul 20 13:48:06 2011 @@ -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