Some more fixes for 'fastcall' support.

svn path=/trunk/; revision=1991
This commit is contained in:
Eric Kohl 2001-06-20 20:00:36 +00:00
parent 93eeaf2b3e
commit c280651aa2
4 changed files with 82 additions and 137 deletions

View file

@ -500,7 +500,7 @@ ExInterlockedPopEntryList (
PKSPIN_LOCK Lock PKSPIN_LOCK Lock
); );
PSINGLE_LIST_ENTRY PSINGLE_LIST_ENTRY
STDCALL FASTCALL
ExInterlockedPopEntrySList ( ExInterlockedPopEntrySList (
PSLIST_HEADER ListHead, PSLIST_HEADER ListHead,
PKSPIN_LOCK Lock PKSPIN_LOCK Lock
@ -513,7 +513,7 @@ ExInterlockedPushEntryList (
PKSPIN_LOCK Lock PKSPIN_LOCK Lock
); );
PSINGLE_LIST_ENTRY PSINGLE_LIST_ENTRY
STDCALL FASTCALL
ExInterlockedPushEntrySList ( ExInterlockedPushEntrySList (
PSLIST_HEADER ListHead, PSLIST_HEADER ListHead,
PSINGLE_LIST_ENTRY ListEntry, PSINGLE_LIST_ENTRY ListEntry,
@ -662,7 +662,7 @@ ExReleaseResource (
(ExReleaseResourceLite (Resource)) (ExReleaseResourceLite (Resource))
VOID VOID
STDCALL FASTCALL
ExReleaseResourceLite ( ExReleaseResourceLite (
PERESOURCE Resource PERESOURCE Resource
); );

View file

@ -1,4 +1,4 @@
/* $Id: list.c,v 1.2 2000/10/07 13:41:50 dwelch Exp $ /* $Id: list.c,v 1.3 2001/06/20 19:59:35 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -137,24 +137,18 @@ ExInterlockedRemoveTailList (
} }
PSINGLE_LIST_ENTRY PSINGLE_LIST_ENTRY FASTCALL
STDCALL ExInterlockedPopEntrySList(PSLIST_HEADER ListHead,
ExInterlockedPopEntrySList ( PKSPIN_LOCK Lock)
PSLIST_HEADER ListHead,
PKSPIN_LOCK Lock
)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
PSINGLE_LIST_ENTRY PSINGLE_LIST_ENTRY FASTCALL
STDCALL ExInterlockedPushEntrySList(PSLIST_HEADER ListHead,
ExInterlockedPushEntrySList (
PSLIST_HEADER ListHead,
PSINGLE_LIST_ENTRY ListEntry, PSINGLE_LIST_ENTRY ListEntry,
PKSPIN_LOCK Lock PKSPIN_LOCK Lock)
)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }

View file

@ -1,4 +1,4 @@
/* $Id: resource.c,v 1.16 2001/03/07 16:48:40 dwelch Exp $ /* $Id: resource.c,v 1.17 2001/06/20 19:59:35 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -674,7 +674,7 @@ ExReinitializeResourceLite (
} }
VOID VOID
STDCALL FASTCALL
ExReleaseResourceLite ( ExReleaseResourceLite (
PERESOURCE Resource PERESOURCE Resource
) )

View file

@ -1,4 +1,4 @@
/* $Id: interlck.c,v 1.7 2001/06/04 11:26:12 chorns Exp $ /* $Id: interlck.c,v 1.8 2001/06/20 20:00:36 ekohl Exp $
* *
* reactos/ntoskrnl/rtl/interlck.c * reactos/ntoskrnl/rtl/interlck.c
* *
@ -9,6 +9,8 @@
#include <ntos.h> #include <ntos.h>
#include <internal/debug.h> #include <internal/debug.h>
//#define USE_FASTCALL
#if 0 #if 0
LONG FASTCALL InterlockedIncrement(PLONG Addend) LONG FASTCALL InterlockedIncrement(PLONG Addend)
{ {
@ -84,10 +86,11 @@ InterlockedCompareExchange (
#else /* I386_FIX */ #else /* I386_FIX */
/********************************************************************** /**********************************************************************
* FASTCALL: @InterlockedIncrement@0 * FASTCALL: @InterlockedIncrement@4
* STDCALL : _InterlockedIncrement@4 * STDCALL : _InterlockedIncrement@4
*/ */
LONG FASTCALL InterlockedIncrement (PLONG Addend); LONG FASTCALL
InterlockedIncrement(PLONG Addend);
/* /*
* FUNCTION: Increments a caller supplied variable of type LONG as an * FUNCTION: Increments a caller supplied variable of type LONG as an
* atomic operation * atomic operation
@ -95,6 +98,8 @@ LONG FASTCALL InterlockedIncrement (PLONG Addend);
* Addend = Points to a variable whose value is to be increment * Addend = Points to a variable whose value is to be increment
* RETURNS: The incremented value * RETURNS: The incremented value
*/ */
#ifndef USE_FASTCALL
__asm__("\n\t.global _InterlockedIncrement@4\n\t" __asm__("\n\t.global _InterlockedIncrement@4\n\t"
"_InterlockedIncrement@4:\n\t" "_InterlockedIncrement@4:\n\t"
"pushl %ebp\n\t" "pushl %ebp\n\t"
@ -108,33 +113,23 @@ __asm__("\n\t.global _InterlockedIncrement@4\n\t"
"movl %ebp,%esp\n\t" "movl %ebp,%esp\n\t"
"popl %ebp\n\t" "popl %ebp\n\t"
"ret $4\n\t"); "ret $4\n\t");
#if 0
/*
__asm__(
#ifndef CONFIG_USE_FASTCALL
".global _InterlockedIncrement@4\n"
"\t_InterlockedIncrement@4:\n"
"\tmovl 4(%esp), %ecx\n"
#else #else
".global @InterlockedIncrement@0\n" __asm__("\n\t.global @InterlockedIncrement@4\n\t"
"\t@InterlockedIncrement@0:\n" "@InterlockedIncrement@4:\n\t"
#endif "movl $1,%eax\n\t"
"\tmov $1, %eax\n" "xaddl %eax,(%ecx)\n\t"
"\txadd %ecx, %eax\n" "incl %eax\n\t"
"\tinc %eax\n\n" "ret\n\t");
#ifndef CONFIG_USE_FASTCALL
"\tret $4\n"
#endif
);
*/
#endif #endif
/********************************************************************** /**********************************************************************
* FASTCALL: @InterlockedDecrement@0 * FASTCALL: @InterlockedDecrement@4
* STDCALL : _InterlockedDecrement@4 * STDCALL : _InterlockedDecrement@4
*/ */
LONG FASTCALL InterlockedDecrement(PLONG Addend); LONG FASTCALL
InterlockedDecrement(PLONG Addend);
#ifndef USE_FASTCALL
__asm__("\n\t.global _InterlockedDecrement@4\n\t" __asm__("\n\t.global _InterlockedDecrement@4\n\t"
"_InterlockedDecrement@4:\n\t" "_InterlockedDecrement@4:\n\t"
"pushl %ebp\n\t" "pushl %ebp\n\t"
@ -148,20 +143,26 @@ __asm__("\n\t.global _InterlockedDecrement@4\n\t"
"movl %ebp,%esp\n\t" "movl %ebp,%esp\n\t"
"popl %ebp\n\t" "popl %ebp\n\t"
"ret $4\n\t"); "ret $4\n\t");
#else
__asm__("\n\t.global @InterlockedDecrement@4\n\t"
"@InterlockedDecrement@4:\n\t"
"movl $-1,%eax\n\t"
"xaddl %eax,(%ecx)\n\t"
"decl %eax\n\t"
"ret\n\t");
#endif
/********************************************************************** /**********************************************************************
* FASTCALL: @InterlockedExchange@0 * FASTCALL: @InterlockedExchange@8
* STDCALL : _InterlockedExchange@8 * STDCALL : _InterlockedExchange@8
*/ */
LONG LONG FASTCALL
FASTCALL InterlockedExchange(PLONG Target,
InterlockedExchange ( LONG Value);
PLONG Target,
LONG Value #ifndef USE_FASTCALL
); __asm__("\n\t.global _InterlockedExchange@8\n\t"
__asm__(
"\n\t.global _InterlockedExchange@8\n\t"
"_InterlockedExchange@8:\n\t" "_InterlockedExchange@8:\n\t"
"pushl %ebp\n\t" "pushl %ebp\n\t"
"movl %esp,%ebp\n\t" "movl %esp,%ebp\n\t"
@ -172,115 +173,65 @@ __asm__(
"popl %ebx\n\t" "popl %ebx\n\t"
"movl %ebp,%esp\n\t" "movl %ebp,%esp\n\t"
"popl %ebp\n\t" "popl %ebp\n\t"
"ret $8\n\t" "ret $8\n\t");
);
/*
__asm__(
#ifndef CONFIG_USE_FASTCALL
".global _InterlockedExchange@8\n"
"_InterlockedExchange@8:\n"
"\tmovl 4(%esp), %ecx\n"
"\tmovl 8(%esp), %edx\n"
#else #else
".global @InterlockedExchange@0\n" __asm__("\n\t.global @InterlockedExchange@8\n\t"
"@InterlockedExchange@0:\n" "@InterlockedExchange@8:\n\t"
"movl (%ecx),%eax\n"
"xchgl %edx,(%ecx)\n\t"
"ret\n\t");
#endif #endif
"\tmovl %ecx, %eax\n"
"__InterlockedExchange_Loop:\n"
"\tlock\n"
"\tcmpxchg %ecx, %edx\n"
"\tjne __InterlockedExchange_Loop\n"
#ifndef CONFIG_USE_FASTCALL
"\tmovl %ecx, 4(%esp)\n"
"\tret $8\n"
#else
"\tret\n"
#endif
);
*/
/********************************************************************** /**********************************************************************
* FASTCALL: @InterlockedExchangeAdd@0 * FASTCALL: @InterlockedExchangeAdd@8
* STDCALL : _InterlockedExchangeAdd@8 * STDCALL : _InterlockedExchangeAdd@8
*/ */
LONG LONG FASTCALL
FASTCALL InterlockedExchangeAdd(PLONG Addend,
InterlockedExchangeAdd ( LONG Value);
PLONG Addend,
LONG Value #ifndef USE_FASTCALL
); __asm__("\n\t.global _InterlockedExchangeAdd@8\n\t"
__asm__(
"\n\t.global _InterlockedExchangeAdd@8\n\t"
"_InterlockedExchangeAdd@8:\n\t" "_InterlockedExchangeAdd@8:\n\t"
"movl 8(%esp),%eax\n\t" "movl 8(%esp),%eax\n\t"
"movl 4(%esp),%ebx\n\t" "movl 4(%esp),%ebx\n\t"
"xaddl %eax,(%ebx)\n\t" "xaddl %eax,(%ebx)\n\t"
"ret $8\n\t" "ret $8\n\t");
);
/*
__asm__(
#ifndef CONFIG_USE_FASTCALL
".global _InterlockedExchangeAdd@8\n"
"\t_InterlockedExchangeAdd@8:\n"
"\tmovl 4(%esp), %ecx\n"
"\tmovl 8(%esp), %edx\n"
#else #else
".global @InterlockedExchangeAdd@0\n" __asm__("\n\t.global @InterlockedExchangeAdd@8\n\t"
"\t@InterlockedExchangeAdd@0:\n" "@InterlockedExchangeAdd@8:\n\t"
"xaddl %edx,(%ecx)\n\t"
"movl %edx,%eax\n\t"
"ret\n\t");
#endif #endif
"\txadd %edx, %ecx\n"
"\tmovl %edx, %eax\n"
#ifndef CONFIG_USE_FASTCALL
"\tret $8\n"
#else
"\tret\n"
#endif
);
*/
/********************************************************************** /**********************************************************************
* FASTCALL: @InterlockedCompareExchange@4 * FASTCALL: @InterlockedCompareExchange@12
* STDCALL : _InterlockedCompareExchange@12 * STDCALL : _InterlockedCompareExchange@12
*/ */
PVOID PVOID FASTCALL
FASTCALL InterlockedCompareExchange(PVOID *Destination,
InterlockedCompareExchange (
PVOID * Destination,
PVOID Exchange, PVOID Exchange,
PVOID Comperand PVOID Comperand);
);
__asm__( #ifndef USE_FASTCALL
"\n\t.global _InterlockedCompareExchange@12\n\t" __asm__("\n\t.global _InterlockedCompareExchange@12\n\t"
"_InterlockedCompareExchange@12:\n\t" "_InterlockedCompareExchange@12:\n\t"
"movl 12(%esp),%eax\n\t" "movl 12(%esp),%eax\n\t"
"movl 8(%esp),%edx\n\t" "movl 8(%esp),%edx\n\t"
"movl 4(%esp),%ebx\n\t" "movl 4(%esp),%ebx\n\t"
"cmpxchg %edx,(%ebx)\n\t" "cmpxchg %edx,(%ebx)\n\t"
"movl %edx,%eax\n\t" "movl %edx,%eax\n\t"
"ret $12\n\t" "ret $12\n\t");
);
/*
__asm__(
#ifndef CONFIG_USE_FASTCALL
".global _InterlockedCompareExchange@12\n"
"\t_InterlockedCompareExchange@12:\n"
"\tmovl 4(%esp), %ecx\n"
"\tmovl 8(%esp), %edx\n"
"\tmovl 12(%esp), %eax\n"
#else #else
".global @InterlockedCompareExchange@4\n" __asm__("\n\t.global @InterlockedCompareExchange@12\n\t"
"\t@InterlockedCompareExchange@4:\n" "@InterlockedCompareExchange@12:\n\t"
"\tmovl 4(%esp), %eax\n" "movl 4(%esp),%eax\n\t"
"cmpxchg %edx,(%ecx)\n\t"
"ret $4\n\t");
#endif #endif
"\tcmpxchg %ecx, %edx\n"
#ifndef CONFIG_USE_FASTCALL
"\tret $12\n"
#else
"\tret $4\n"
#endif
*/
#endif /* I386_FIX */ #endif /* I386_FIX */