Author: hpoussin Date: Wed Jun 14 13:36:15 2006 New Revision: 22347
URL: http://svn.reactos.ru/svn/reactos?rev=22347&view=rev Log: Fix SESSION5_INITIALIZATION_ERROR by reverting part of 22219. The code is the same as in pre-22219 era, but separated in different files Thanks Alex for reporting the faulty revision
Added: trunk/reactos/lib/intrlck/i386/compareexchange.c trunk/reactos/lib/intrlck/i386/decrement.c trunk/reactos/lib/intrlck/i386/exchange.c trunk/reactos/lib/intrlck/i386/exchangeadd.c trunk/reactos/lib/intrlck/i386/increment.c Removed: trunk/reactos/lib/intrlck/i386/compareexchange.s trunk/reactos/lib/intrlck/i386/decrement.s trunk/reactos/lib/intrlck/i386/exchange.s trunk/reactos/lib/intrlck/i386/exchangeadd.s trunk/reactos/lib/intrlck/i386/increment.s Modified: trunk/reactos/lib/intrlck/intrlck.rbuild
Added: trunk/reactos/lib/intrlck/i386/compareexchange.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/compareexch... ============================================================================== --- trunk/reactos/lib/intrlck/i386/compareexchange.c (added) +++ trunk/reactos/lib/intrlck/i386/compareexchange.c Wed Jun 14 13:36:15 2006 @@ -1,0 +1,37 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL - See COPYING in the top level directory + * FILE: lib/intrlck/i386/compareexchange.c + * PURPOSE: Inter lock compare exchanges + * PROGRAMMERS: Copyright 1995 Martin von Loewis + * Copyright 1997 Onno Hovers + */ + +/************************************************************************ + * 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 NTAPI InterlockedCompareExchange(LPLONG Destination, LONG Exchange, LONG Comperand) + */ + +#include <windows.h> +LONG +NTAPI +InterlockedCompareExchange( + LPLONG Destination, + LONG Exchange, + LONG Comperand) +{ + LONG ret; + __asm__ __volatile__( + "lock; cmpxchgl %2,(%1)" + : "=a" (ret) : "r" (Destination), "r" (Exchange), "0" (Comperand) : "memory" ); + return ret; +}
Removed: trunk/reactos/lib/intrlck/i386/compareexchange.s URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/compareexch... ============================================================================== --- trunk/reactos/lib/intrlck/i386/compareexchange.s (original) +++ trunk/reactos/lib/intrlck/i386/compareexchange.s (removed) @@ -1,33 +1,0 @@ -/* - * PROJECT: ReactOS system libraries - * LICENSE: GPL - See COPYING in the top level directory - * FILE: lib/intrlck/i386/compareexchange.s - * PURPOSE: Inter lock compare exchanges - * PROGRAMMERS: Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - */ - -/************************************************************************ - * 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 NTAPI InterlockedCompareExchange(LPLONG Destination, LONG Exchange, LONG Comperand) - */ - -.globl _InterlockedCompareExchange@12 - -_InterlockedCompareExchange@12: - movl 12(%esp),%eax - movl 8(%esp),%ecx - movl 4(%esp),%edx - lock - cmpxchgl %ecx,(%edx) - leave - ret $12
Added: trunk/reactos/lib/intrlck/i386/decrement.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/decrement.c... ============================================================================== --- trunk/reactos/lib/intrlck/i386/decrement.c (added) +++ trunk/reactos/lib/intrlck/i386/decrement.c Wed Jun 14 13:36:15 2006 @@ -1,0 +1,38 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL - See COPYING in the top level directory + * FILE: lib/intrlck/i386/decrement.c + * PURPOSE: Inter lock decrements + * PROGRAMMERS: Copyright 1995 Martin von Loewis + * Copyright 1997 Onno Hovers + */ + +/************************************************************************ +* InterlockedDecrement * +* * +* InterlockedDecrement adds -1 to a long variable and returns * +* the resulting decremented value. * +* * +************************************************************************/ + +/* + * LONG NTAPI InterlockedDecrement(LPLONG lpAddend) + */ + +#include <windows.h> +LONG +NTAPI +InterlockedDecrement(LPLONG lpAddend) +{ + LONG ret; + __asm__ + ( + "\tlock\n" /* for SMP systems */ + "\txaddl %0, (%1)\n" + "\tdecl %0\n" + :"=r" (ret) + :"r" (lpAddend), "0" (-1) + : "memory" + ); + return ret; +}
Removed: trunk/reactos/lib/intrlck/i386/decrement.s URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/decrement.s... ============================================================================== --- trunk/reactos/lib/intrlck/i386/decrement.s (original) +++ trunk/reactos/lib/intrlck/i386/decrement.s (removed) @@ -1,31 +1,0 @@ -/* - * PROJECT: ReactOS system libraries - * LICENSE: GPL - See COPYING in the top level directory - * FILE: lib/intrlck/i386/decrement.s - * PURPOSE: Inter lock decrements - * PROGRAMMERS: Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - */ - -/************************************************************************ -* InterlockedDecrement * -* * -* InterlockedDecrement adds -1 to a long variable and returns * -* the resulting decremented value. * -* * -************************************************************************/ - -/* - * LONG NTAPI InterlockedDecrement(LPLONG lpAddend) - */ - -.globl _InterlockedDecrement@4 - -_InterlockedDecrement@4: - movl $-1,%ebx - lock - xaddl %eax,%ebx - decl %eax - leave - ret $4 -
Added: trunk/reactos/lib/intrlck/i386/exchange.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/exchange.c?... ============================================================================== --- trunk/reactos/lib/intrlck/i386/exchange.c (added) +++ trunk/reactos/lib/intrlck/i386/exchange.c Wed Jun 14 13:36:15 2006 @@ -1,0 +1,34 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL - See COPYING in the top level directory + * FILE: lib/intrlck/i386/exchange.c + * PURPOSE: Inter lock exchanges + * PROGRAMMERS: Copyright 1995 Martin von Loewis + * Copyright 1997 Onno Hovers + */ + +/************************************************************************ + * InterlockedExchange + * + * Atomically exchanges a pair of values. + * + * RETURNS + * Prior value of value pointed to by Target + */ + +/* + * LONG NTAPI InterlockedExchange(LPLONG target, LONG value) + */ + +#include <windows.h> +LONG +NTAPI +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; +}
Removed: trunk/reactos/lib/intrlck/i386/exchange.s URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/exchange.s?... ============================================================================== --- trunk/reactos/lib/intrlck/i386/exchange.s (original) +++ trunk/reactos/lib/intrlck/i386/exchange.s (removed) @@ -1,29 +1,0 @@ -/* - * PROJECT: ReactOS system libraries - * LICENSE: GPL - See COPYING in the top level directory - * FILE: lib/intrlck/i386/exchange.s - * PURPOSE: Inter lock exchanges - * PROGRAMMERS: Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - */ - -/************************************************************************ - * InterlockedExchange - * - * Atomically exchanges a pair of values. - * - * RETURNS - * Prior value of value pointed to by Target - */ - -/* - * LONG NTAPI InterlockedExchange(LPLONG target, LONG value) - */ - -.globl _InterlockedExchange@8 - -_InterlockedExchange@8: - lock - xchgl %eax,%ebx - leave - ret $8
Added: trunk/reactos/lib/intrlck/i386/exchangeadd.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/exchangeadd... ============================================================================== --- trunk/reactos/lib/intrlck/i386/exchangeadd.c (added) +++ trunk/reactos/lib/intrlck/i386/exchangeadd.c Wed Jun 14 13:36:15 2006 @@ -1,0 +1,40 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL - See COPYING in the top level directory + * FILE: lib/intrlck/i386/exchangeadd.c + * PURPOSE: Inter lock exchange adds + * PROGRAMMERS: Copyright 1995 Martin von Loewis + * Copyright 1997 Onno Hovers + */ + +/************************************************************************ + * InterlockedExchangeAdd + * + * Atomically adds Increment to Addend and returns the previous value of + * Addend + * + * RETURNS + * Prior value of value pointed to by Addend + */ + +/* + * LONG NTAPI InterlockedExchangeAdd(PLONG Addend, LONG Increment) + */ + +#include <windows.h> +LONG +NTAPI +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; +}
Removed: trunk/reactos/lib/intrlck/i386/exchangeadd.s URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/exchangeadd... ============================================================================== --- trunk/reactos/lib/intrlck/i386/exchangeadd.s (original) +++ trunk/reactos/lib/intrlck/i386/exchangeadd.s (removed) @@ -1,30 +1,0 @@ -/* - * PROJECT: ReactOS system libraries - * LICENSE: GPL - See COPYING in the top level directory - * FILE: lib/intrlck/i386/exchangeadd.s - * PURPOSE: Inter lock exchange adds - * PROGRAMMERS: Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - */ - -/************************************************************************ - * InterlockedExchangeAdd - * - * Atomically adds Increment to Addend and returns the previous value of - * Addend - * - * RETURNS - * Prior value of value pointed to by Addend - */ - -/* - * LONG NTAPI InterlockedExchangeAdd(PLONG Addend, LONG Increment) - */ - -.globl _InterlockedExchangeAdd@8 - -_InterlockedExchangeAdd@8: - lock - xaddl %eax,%ebx - leave - ret $4
Added: trunk/reactos/lib/intrlck/i386/increment.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/increment.c... ============================================================================== --- trunk/reactos/lib/intrlck/i386/increment.c (added) +++ trunk/reactos/lib/intrlck/i386/increment.c Wed Jun 14 13:36:15 2006 @@ -1,0 +1,38 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL - See COPYING in the top level directory + * FILE: lib/intrlck/i386/increment.c + * PURPOSE: Inter lock increments + * PROGRAMMERS: Copyright 1995 Martin von Loewis + * Copyright 1997 Onno Hovers + */ + +/************************************************************************ +* InterlockedIncrement * +* * +* InterlockedIncrement adds 1 to a long variable and returns * +* the resulting incremented value. * +* * +************************************************************************/ + +/* + * LONG NTAPI InterlockedIncrement(PLONG Addend) + */ + +#include <windows.h> +LONG +NTAPI +InterlockedIncrement(PLONG lpAddend) +{ + LONG ret; + __asm__ + ( + "\tlock\n" /* for SMP systems */ + "\txaddl %0, (%1)\n" + "\tincl %0\n" + :"=r" (ret) + :"r" (lpAddend), "0" (1) + : "memory" + ); + return ret; +}
Removed: trunk/reactos/lib/intrlck/i386/increment.s URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/i386/increment.s... ============================================================================== --- trunk/reactos/lib/intrlck/i386/increment.s (original) +++ trunk/reactos/lib/intrlck/i386/increment.s (removed) @@ -1,30 +1,0 @@ -/* - * PROJECT: ReactOS system libraries - * LICENSE: GPL - See COPYING in the top level directory - * FILE: lib/intrlck/i386/increment.s - * PURPOSE: Inter lock increments - * PROGRAMMERS: Copyright 1995 Martin von Loewis - * Copyright 1997 Onno Hovers - */ - -/************************************************************************ -* InterlockedIncrement * -* * -* InterlockedIncrement adds 1 to a long variable and returns * -* the resulting incremented value. * -* * -************************************************************************/ - -/* - * LONG NTAPI InterlockedIncrement(PLONG Addend) - */ - -.globl _InterlockedIncrement@4 - -_InterlockedIncrement@4: - movl $1,%ebx - lock - xaddl %eax,%ebx - incl %eax - leave - ret $4
Modified: trunk/reactos/lib/intrlck/intrlck.rbuild URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/intrlck.rbuild?r... ============================================================================== --- trunk/reactos/lib/intrlck/intrlck.rbuild (original) +++ trunk/reactos/lib/intrlck/intrlck.rbuild Wed Jun 14 13:36:15 2006 @@ -3,11 +3,11 @@
<if property="ARCH" value="i386"> <directory name="i386"> - <file>compareexchange.s</file> - <file>decrement.s</file> - <file>exchange.s</file> - <file>exchangeadd.s</file> - <file>increment.s</file> + <file>compareexchange.c</file> + <file>decrement.c</file> + <file>exchange.c</file> + <file>exchangeadd.c</file> + <file>increment.c</file> </directory> </if> <if property="ARCH" value="ppc">