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

svn path=/trunk/; revision=22347
This commit is contained in:
Hervé Poussineau 2006-06-14 09:36:15 +00:00
parent 30c84451ef
commit 2aa4dc8052
6 changed files with 192 additions and 158 deletions

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS system libraries
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/intrlck/i386/compareexchange.s
* FILE: lib/intrlck/i386/compareexchange.c
* PURPOSE: Inter lock compare exchanges
* PROGRAMMERS: Copyright 1995 Martin von Loewis
* Copyright 1997 Onno Hovers
@ -21,13 +21,17 @@
* 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
#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;
}

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS system libraries
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/intrlck/i386/decrement.s
* FILE: lib/intrlck/i386/decrement.c
* PURPOSE: Inter lock decrements
* PROGRAMMERS: Copyright 1995 Martin von Loewis
* Copyright 1997 Onno Hovers
@ -19,13 +19,20 @@
* LONG NTAPI InterlockedDecrement(LPLONG lpAddend)
*/
.globl _InterlockedDecrement@4
_InterlockedDecrement@4:
movl $-1,%ebx
lock
xaddl %eax,%ebx
decl %eax
leave
ret $4
#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;
}

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS system libraries
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/intrlck/i386/exchange.s
* FILE: lib/intrlck/i386/exchange.c
* PURPOSE: Inter lock exchanges
* PROGRAMMERS: Copyright 1995 Martin von Loewis
* Copyright 1997 Onno Hovers
@ -20,10 +20,15 @@
* LONG NTAPI InterlockedExchange(LPLONG target, LONG value)
*/
.globl _InterlockedExchange@8
_InterlockedExchange@8:
lock
xchgl %eax,%ebx
leave
ret $8
#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;
}

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS system libraries
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/intrlck/i386/exchangeadd.s
* FILE: lib/intrlck/i386/exchangeadd.c
* PURPOSE: Inter lock exchange adds
* PROGRAMMERS: Copyright 1995 Martin von Loewis
* Copyright 1997 Onno Hovers
@ -21,10 +21,20 @@
* LONG NTAPI InterlockedExchangeAdd(PLONG Addend, LONG Increment)
*/
.globl _InterlockedExchangeAdd@8
_InterlockedExchangeAdd@8:
lock
xaddl %eax,%ebx
leave
ret $4
#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;
}

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS system libraries
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/intrlck/i386/increment.s
* FILE: lib/intrlck/i386/increment.c
* PURPOSE: Inter lock increments
* PROGRAMMERS: Copyright 1995 Martin von Loewis
* Copyright 1997 Onno Hovers
@ -19,12 +19,20 @@
* LONG NTAPI InterlockedIncrement(PLONG Addend)
*/
.globl _InterlockedIncrement@4
_InterlockedIncrement@4:
movl $1,%ebx
lock
xaddl %eax,%ebx
incl %eax
leave
ret $4
#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;
}

View file

@ -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">