diff --git a/reactos/lib/kernel32/kernel32.xml b/reactos/lib/kernel32/kernel32.xml index 12a17f1ffb3..c715c21d050 100644 --- a/reactos/lib/kernel32/kernel32.xml +++ b/reactos/lib/kernel32/kernel32.xml @@ -88,7 +88,6 @@ critical.c event.c - intrlck.c mutex.c sem.c timer.c diff --git a/reactos/lib/kernel32/synch/intrlck.c b/reactos/lib/kernel32/synch/intrlck.c deleted file mode 100644 index bf834bd8f87..00000000000 --- a/reactos/lib/kernel32/synch/intrlck.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/kernel32/sync/intrlck.c - * PURPOSE: Inter lock increments - * UPDATE HISTORY: - * Created 30/09/99 - */ - -/* - * Win32 kernel functions - * - * Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - */ - -#include - - -/************************************************************************ -* InterlockedIncrement * -* * -* InterlockedIncrement adds 1 to a long variable and returns * -* - a negative number if the result < 0 * -* - zero if the result == 0 * -* - a positive number if the result > 0 * -* * -* The returned number need not be equal to the result!!!! * -* note: * -* * -* -* @implemented -* -************************************************************************/ -LONG -STDCALL -InterlockedIncrement(PLONG Addend) -{ - long ret = 0; - __asm__ - ( - "\tlock\n" /* for SMP systems */ - "\tincl (%1)\n" - "\tje 2f\n" - "\tjl 1f\n" - "\tincl %0\n" - "\tjmp 2f\n" - "1:\tdec %0\n" - "2:\n" - :"=r" (ret):"r" (Addend), "0" (0): "memory" - ); - return ret; -} - -/************************************************************************ -* InterlockedDecrement * -* * -* InterlockedIncrement adds 1 to a long variable and returns * -* - a negative number if the result < 0 * -* - zero if the result == 0 * -* - a positive number if the result > 0 * -* * -* The returned number need not be equal to the result!!!! * -* -* -* @implemented -* -************************************************************************/ -LONG -STDCALL -InterlockedDecrement(LPLONG lpAddend) -{ - long ret; - __asm__ - ( - "\tlock\n" /* for SMP systems */ - "\tdecl (%1)\n" - "\tje 2f\n" - "\tjl 1f\n" - "\tincl %0\n" - "\tjmp 2f\n" - "1:\tdec %0\n" - "2:\n" - :"=r" (ret):"r" (lpAddend), "0" (0): "memory" - ); - return ret; - - -} - -/************************************************************************ - * InterlockedExchange - * - * Atomically exchanges a pair of values. - * - * RETURNS - * Prior value of value pointed to by Target - * - * @implemented - */ -LONG -STDCALL -InterlockedExchange(LPLONG target, LONG value ) -{ - - long ret; - __asm__ ( /* lock for SMP systems */ - "lock\n\txchgl %0,(%1)" - :"=r" (ret):"r" (target), "0" (value):"memory" ); - return ret; - - -} - -/************************************************************************ - * InterlockedCompareExchange - * - * Atomically compares Destination and Comperand, and if found equal exchanges - * the value of Destination with Exchange - * - * RETURNS - * Prior value of value pointed to by Destination - * - * @implemented - */ -LONG -STDCALL -InterlockedCompareExchange( - PLONG Destination, - LONG Exchange, - LONG Comperand ) -{ - LONG ret; - __asm__ ( /* lock for SMP systems */ - "lock\n\t" - "cmpxchgl %2,(%1)" - :"=r" (ret) - :"r" (Destination),"r" (Exchange), "0" (Comperand) - :"memory" ); - return ret; -} - -/************************************************************************ - * InterlockedExchangeAdd - * - * Atomically adds Increment to Addend and returns the previous value of - * Addend - * - * RETURNS - * Prior value of value pointed to by Addend - * - * @implemented - */ -LONG -STDCALL -InterlockedExchangeAdd( - PLONG Addend, - LONG Increment -) -{ - - LONG ret; - __asm__ ( /* lock for SMP systems */ - "lock\n\t" - "xaddl %0,(%1)" - :"=r" (ret) - :"r" (Addend), "0" (Increment) - :"memory" ); - return ret; -} diff --git a/reactos/lib/ntdll/ntdll.xml b/reactos/lib/ntdll/ntdll.xml index 5ac88fcd8d1..d4fde463359 100644 --- a/reactos/lib/ntdll/ntdll.xml +++ b/reactos/lib/ntdll/ntdll.xml @@ -39,7 +39,6 @@ dbgbuffer.c exception.c handle.c - intrlck.c libsupp.c math.c message.c diff --git a/reactos/lib/ntdll/rtl/intrlck.c b/reactos/lib/ntdll/rtl/intrlck.c deleted file mode 100644 index 9504cb30dcb..00000000000 --- a/reactos/lib/ntdll/rtl/intrlck.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/ntdll/rtl/intrlck.c - * PURPOSE: Inter lock increments - * UPDATE HISTORY: - * Created 30/09/99 - */ - -/* - * Win32 kernel functions - * - * Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - * Copied from kernel32 - */ - - -/************************************************************************ -* InterlockedIncrement * -* * -* InterlockedIncrement adds 1 to a long variable and returns * -* - a negative number if the result < 0 * -* - zero if the result == 0 * -* - a positive number if the result > 0 * -* * -* The returned number need not be equal to the result!!!! * -* note: * -* * -************************************************************************/ - -#include - -LONG -STDCALL -InterlockedIncrement(PLONG Addend) -{ - long ret = 0; - __asm__ - ( - "\tlock\n" /* for SMP systems */ - "\tincl (%1)\n" - "\tje 2f\n" - "\tjl 1f\n" - "\tincl %0\n" - "\tjmp 2f\n" - "1:\tdec %0\n" - "2:\n" - :"=r" (ret):"r" (Addend), "0" (0): "memory" - ); - return ret; -} - -/************************************************************************ -* InterlockedDecrement * -* * -* InterlockedIncrement adds 1 to a long variable and returns * -* - a negative number if the result < 0 * -* - zero if the result == 0 * -* - a positive number if the result > 0 * -* * -* The returned number need not be equal to the result!!!! * -************************************************************************/ - -LONG -STDCALL -InterlockedDecrement(LPLONG lpAddend) -{ - long ret; - __asm__ - ( - "\tlock\n" /* for SMP systems */ - "\tdecl (%1)\n" - "\tje 2f\n" - "\tjl 1f\n" - "\tincl %0\n" - "\tjmp 2f\n" - "1:\tdec %0\n" - "2:\n" - :"=r" (ret):"r" (lpAddend), "0" (0): "memory" - ); - return ret; - - -} - -/************************************************************************ - * InterlockedExchange - * - * Atomically exchanges a pair of values. - * - * RETURNS - * Prior value of value pointed to by Target - */ - -LONG -STDCALL -InterlockedExchange(LPLONG target, LONG value ) -{ - - long ret; - __asm__ ( /* lock for SMP systems */ - "lock\n\txchgl %0,(%1)" - :"=r" (ret):"r" (target), "0" (value):"memory" ); - return ret; - - -} - -/************************************************************************ - * InterlockedCompareExchange - * - * Atomically compares Destination and Comperand, and if found equal exchanges - * the value of Destination with Exchange - * - * RETURNS - * Prior value of value pointed to by Destination - */ -LONG -STDCALL -InterlockedCompareExchange( - PLONG Destination, - LONG Exchange, - LONG Comperand) -{ - LONG ret; - __asm__ ( /* lock for SMP systems */ - "lock\n\t" - "cmpxchgl %2,(%1)" - :"=r" (ret) - :"r" (Destination),"r" (Exchange), "0" (Comperand) - :"memory" ); - return ret; - -} - -/************************************************************************ - * InterlockedExchangeAdd - * - * Atomically adds Increment to Addend and returns the previous value of - * Addend - * - * RETURNS - * Prior value of value pointed to by Addend - */ -LONG -STDCALL -InterlockedExchangeAdd( - PLONG Addend, - LONG Increment -) -{ - - LONG ret; - __asm__ ( /* lock for SMP systems */ - "lock\n\t" - "xaddl %0,(%1)" - :"=r" (ret) - :"r" (Addend), "0" (Increment) - :"memory" ); - return ret; - -}