kernel32: Move interlocked functions to kernelbase.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
765815729f
commit
c683e7e5a1
|
@ -940,9 +940,9 @@
|
||||||
@ stdcall IdnToNameprepUnicode(long wstr long ptr long)
|
@ stdcall IdnToNameprepUnicode(long wstr long ptr long)
|
||||||
@ stdcall IdnToUnicode(long wstr long ptr long)
|
@ stdcall IdnToUnicode(long wstr long ptr long)
|
||||||
@ stdcall InitAtomTable(long)
|
@ stdcall InitAtomTable(long)
|
||||||
@ stdcall InitOnceBeginInitialize(ptr long ptr ptr)
|
@ stdcall InitOnceBeginInitialize(ptr long ptr ptr) kernelbase.InitOnceBeginInitialize
|
||||||
@ stdcall InitOnceComplete(ptr long ptr)
|
@ stdcall InitOnceComplete(ptr long ptr) kernelbase.InitOnceComplete
|
||||||
@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr)
|
@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr) kernelbase.InitOnceExecuteOnce
|
||||||
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
|
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
|
||||||
@ stdcall InitializeConditionVariable(ptr) ntdll.RtlInitializeConditionVariable
|
@ stdcall InitializeConditionVariable(ptr) ntdll.RtlInitializeConditionVariable
|
||||||
# @ stub InitializeContext
|
# @ stub InitializeContext
|
||||||
|
|
|
@ -1071,35 +1071,6 @@ BOOL WINAPI QueryMemoryResourceNotification(HANDLE handle, PBOOL state)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* InitOnceBeginInitialize (KERNEL32.@)
|
|
||||||
*/
|
|
||||||
BOOL WINAPI InitOnceBeginInitialize( INIT_ONCE *once, DWORD flags, BOOL *pending, void **context )
|
|
||||||
{
|
|
||||||
NTSTATUS status = RtlRunOnceBeginInitialize( once, flags, context );
|
|
||||||
if (status >= 0) *pending = (status == STATUS_PENDING);
|
|
||||||
else SetLastError( RtlNtStatusToDosError(status) );
|
|
||||||
return status >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* InitOnceComplete (KERNEL32.@)
|
|
||||||
*/
|
|
||||||
BOOL WINAPI InitOnceComplete( INIT_ONCE *once, DWORD flags, void *context )
|
|
||||||
{
|
|
||||||
NTSTATUS status = RtlRunOnceComplete( once, flags, context );
|
|
||||||
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
||||||
return !status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* InitOnceExecuteOnce (KERNEL32.@)
|
|
||||||
*/
|
|
||||||
BOOL WINAPI InitOnceExecuteOnce( INIT_ONCE *once, PINIT_ONCE_FN func, void *param, void **context )
|
|
||||||
{
|
|
||||||
return !RtlRunOnceExecuteOnce( once, (PRTL_RUN_ONCE_INIT_FN)func, param, context );
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -794,9 +794,9 @@
|
||||||
@ stdcall ImpersonateNamedPipeClient(long)
|
@ stdcall ImpersonateNamedPipeClient(long)
|
||||||
@ stdcall ImpersonateSelf(long)
|
@ stdcall ImpersonateSelf(long)
|
||||||
# @ stub IncrementPackageStatusVersion
|
# @ stub IncrementPackageStatusVersion
|
||||||
@ stdcall InitOnceBeginInitialize(ptr long ptr ptr) kernel32.InitOnceBeginInitialize
|
@ stdcall InitOnceBeginInitialize(ptr long ptr ptr)
|
||||||
@ stdcall InitOnceComplete(ptr long ptr) kernel32.InitOnceComplete
|
@ stdcall InitOnceComplete(ptr long ptr)
|
||||||
@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr) kernel32.InitOnceExecuteOnce
|
@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr)
|
||||||
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
|
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
|
||||||
@ stdcall InitializeAcl(ptr long long)
|
@ stdcall InitializeAcl(ptr long long)
|
||||||
@ stdcall InitializeConditionVariable(ptr) ntdll.RtlInitializeConditionVariable
|
@ stdcall InitializeConditionVariable(ptr) ntdll.RtlInitializeConditionVariable
|
||||||
|
@ -813,13 +813,13 @@
|
||||||
@ stdcall InitializeSid(ptr ptr long)
|
@ stdcall InitializeSid(ptr ptr long)
|
||||||
# @ stub InitializeSynchronizationBarrier
|
# @ stub InitializeSynchronizationBarrier
|
||||||
# @ stub InstallELAMCertificateInfo
|
# @ stub InstallELAMCertificateInfo
|
||||||
@ stdcall -arch=i386 InterlockedCompareExchange(ptr long long) kernel32.InterlockedCompareExchange
|
@ stdcall -arch=i386 InterlockedCompareExchange(ptr long long)
|
||||||
@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) ntdll.RtlInterlockedCompareExchange64
|
@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) ntdll.RtlInterlockedCompareExchange64
|
||||||
@ stdcall -arch=i386 InterlockedDecrement(ptr) kernel32.InterlockedDecrement
|
@ stdcall -arch=i386 InterlockedDecrement(ptr)
|
||||||
@ stdcall -arch=i386 InterlockedExchange(ptr long) kernel32.InterlockedExchange
|
@ stdcall -arch=i386 InterlockedExchange(ptr long)
|
||||||
@ stdcall -arch=i386 InterlockedExchangeAdd(ptr long ) kernel32.InterlockedExchangeAdd
|
@ stdcall -arch=i386 InterlockedExchangeAdd(ptr long )
|
||||||
@ stdcall InterlockedFlushSList(ptr) ntdll.RtlInterlockedFlushSList
|
@ stdcall InterlockedFlushSList(ptr) ntdll.RtlInterlockedFlushSList
|
||||||
@ stdcall -arch=i386 InterlockedIncrement(ptr) kernel32.InterlockedIncrement
|
@ stdcall -arch=i386 InterlockedIncrement(ptr)
|
||||||
@ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList
|
@ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList
|
||||||
@ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList
|
@ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList
|
||||||
@ stdcall -fastcall InterlockedPushListSList(ptr ptr ptr long) ntdll.RtlInterlockedPushListSList
|
@ stdcall -fastcall InterlockedPushListSList(ptr ptr ptr long) ntdll.RtlInterlockedPushListSList
|
||||||
|
|
|
@ -1383,3 +1383,93 @@ BOOL WINAPI DECLSPEC_HOTPATCH WaitNamedPipeW( LPCWSTR name, DWORD timeout )
|
||||||
NtClose( pipe_dev );
|
NtClose( pipe_dev );
|
||||||
return set_ntstatus( status );
|
return set_ntstatus( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Interlocked functions
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InitOnceBeginInitialize (kernelbase.@)
|
||||||
|
*/
|
||||||
|
BOOL WINAPI DECLSPEC_HOTPATCH InitOnceBeginInitialize( INIT_ONCE *once, DWORD flags,
|
||||||
|
BOOL *pending, void **context )
|
||||||
|
{
|
||||||
|
NTSTATUS status = RtlRunOnceBeginInitialize( once, flags, context );
|
||||||
|
if (status >= 0) *pending = (status == STATUS_PENDING);
|
||||||
|
else SetLastError( RtlNtStatusToDosError(status) );
|
||||||
|
return status >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InitOnceComplete (kernelbase.@)
|
||||||
|
*/
|
||||||
|
BOOL WINAPI DECLSPEC_HOTPATCH InitOnceComplete( INIT_ONCE *once, DWORD flags, void *context )
|
||||||
|
{
|
||||||
|
return set_ntstatus( RtlRunOnceComplete( once, flags, context ));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InitOnceExecuteOnce (kernelbase.@)
|
||||||
|
*/
|
||||||
|
BOOL WINAPI DECLSPEC_HOTPATCH InitOnceExecuteOnce( INIT_ONCE *once, PINIT_ONCE_FN func,
|
||||||
|
void *param, void **context )
|
||||||
|
{
|
||||||
|
return !RtlRunOnceExecuteOnce( once, (PRTL_RUN_ONCE_INIT_FN)func, param, context );
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InterlockedCompareExchange (kernelbase.@)
|
||||||
|
*/
|
||||||
|
__ASM_STDCALL_FUNC(InterlockedCompareExchange, 12,
|
||||||
|
"movl 12(%esp),%eax\n\t"
|
||||||
|
"movl 8(%esp),%ecx\n\t"
|
||||||
|
"movl 4(%esp),%edx\n\t"
|
||||||
|
"lock; cmpxchgl %ecx,(%edx)\n\t"
|
||||||
|
"ret $12")
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InterlockedExchange (kernelbase.@)
|
||||||
|
*/
|
||||||
|
__ASM_STDCALL_FUNC(InterlockedExchange, 8,
|
||||||
|
"movl 8(%esp),%eax\n\t"
|
||||||
|
"movl 4(%esp),%edx\n\t"
|
||||||
|
"lock; xchgl %eax,(%edx)\n\t"
|
||||||
|
"ret $8")
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InterlockedExchangeAdd (kernelbase.@)
|
||||||
|
*/
|
||||||
|
__ASM_STDCALL_FUNC(InterlockedExchangeAdd, 8,
|
||||||
|
"movl 8(%esp),%eax\n\t"
|
||||||
|
"movl 4(%esp),%edx\n\t"
|
||||||
|
"lock; xaddl %eax,(%edx)\n\t"
|
||||||
|
"ret $8")
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InterlockedIncrement (kernelbase.@)
|
||||||
|
*/
|
||||||
|
__ASM_STDCALL_FUNC(InterlockedIncrement, 4,
|
||||||
|
"movl 4(%esp),%edx\n\t"
|
||||||
|
"movl $1,%eax\n\t"
|
||||||
|
"lock; xaddl %eax,(%edx)\n\t"
|
||||||
|
"incl %eax\n\t"
|
||||||
|
"ret $4")
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InterlockedDecrement (kernelbase.@)
|
||||||
|
*/
|
||||||
|
__ASM_STDCALL_FUNC(InterlockedDecrement, 4,
|
||||||
|
"movl 4(%esp),%edx\n\t"
|
||||||
|
"movl $-1,%eax\n\t"
|
||||||
|
"lock; xaddl %eax,(%edx)\n\t"
|
||||||
|
"decl %eax\n\t"
|
||||||
|
"ret $4")
|
||||||
|
|
||||||
|
#endif /* __i386__ */
|
||||||
|
|
Loading…
Reference in New Issue