Commit 84cf6aa2 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

ntdll: Implement RtlU(short|long)ByteSwap() using fastcall bits.

parent 4708bb74
...@@ -1038,7 +1038,7 @@ ...@@ -1038,7 +1038,7 @@
@ stdcall RtlTryAcquireSRWLockShared(ptr) @ stdcall RtlTryAcquireSRWLockShared(ptr)
@ stdcall RtlTryEnterCriticalSection(ptr) @ stdcall RtlTryEnterCriticalSection(ptr)
@ stdcall RtlUTF8ToUnicodeN(ptr long ptr ptr long) @ stdcall RtlUTF8ToUnicodeN(ptr long ptr ptr long)
@ cdecl -i386 -norelay RtlUlongByteSwap() NTDLL_RtlUlongByteSwap @ stdcall -fastcall -arch=i386 -norelay RtlUlongByteSwap(long)
@ stdcall -fastcall -arch=i386 -norelay RtlUlonglongByteSwap(int64) @ stdcall -fastcall -arch=i386 -norelay RtlUlonglongByteSwap(int64)
# @ stub RtlUnhandledExceptionFilter2 # @ stub RtlUnhandledExceptionFilter2
# @ stub RtlUnhandledExceptionFilter # @ stub RtlUnhandledExceptionFilter
...@@ -1072,7 +1072,7 @@ ...@@ -1072,7 +1072,7 @@
@ stdcall RtlUpperString(ptr ptr) @ stdcall RtlUpperString(ptr ptr)
@ stub RtlUsageHeap @ stub RtlUsageHeap
@ stdcall -norelay RtlUserThreadStart(ptr ptr) @ stdcall -norelay RtlUserThreadStart(ptr ptr)
@ cdecl -i386 -norelay RtlUshortByteSwap() NTDLL_RtlUshortByteSwap @ stdcall -fastcall -arch=i386 -norelay RtlUshortByteSwap(long)
@ stdcall RtlValidAcl(ptr) @ stdcall RtlValidAcl(ptr)
@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) @ stdcall RtlValidRelativeSecurityDescriptor(ptr long long)
@ stdcall RtlValidSecurityDescriptor(ptr) @ stdcall RtlValidSecurityDescriptor(ptr)
......
...@@ -659,10 +659,10 @@ __ASM_FASTCALL_FUNC(RtlUlonglongByteSwap, 8, ...@@ -659,10 +659,10 @@ __ASM_FASTCALL_FUNC(RtlUlonglongByteSwap, 8,
* ix86 version takes argument in %ecx. Other systems use the inline version. * ix86 version takes argument in %ecx. Other systems use the inline version.
*/ */
#ifdef __i386__ #ifdef __i386__
__ASM_GLOBAL_FUNC(NTDLL_RtlUlongByteSwap, __ASM_FASTCALL_FUNC(RtlUlongByteSwap, 4,
"movl %ecx,%eax\n\t" "movl %ecx,%eax\n\t"
"bswap %eax\n\t" "bswap %eax\n\t"
"ret") "ret")
#endif #endif
/************************************************************************* /*************************************************************************
...@@ -674,10 +674,10 @@ __ASM_GLOBAL_FUNC(NTDLL_RtlUlongByteSwap, ...@@ -674,10 +674,10 @@ __ASM_GLOBAL_FUNC(NTDLL_RtlUlongByteSwap,
* i386 version takes argument in %cx. Other systems use the inline version. * i386 version takes argument in %cx. Other systems use the inline version.
*/ */
#ifdef __i386__ #ifdef __i386__
__ASM_GLOBAL_FUNC(NTDLL_RtlUshortByteSwap, __ASM_FASTCALL_FUNC(RtlUshortByteSwap, 4,
"movb %ch,%al\n\t" "movb %ch,%al\n\t"
"movb %cl,%ah\n\t" "movb %cl,%ah\n\t"
"ret") "ret")
#endif #endif
......
...@@ -2188,6 +2188,22 @@ LONG FASTCALL NTOSKRNL_InterlockedIncrement( LONG volatile *dest ) ...@@ -2188,6 +2188,22 @@ LONG FASTCALL NTOSKRNL_InterlockedIncrement( LONG volatile *dest )
#ifdef __i386__ #ifdef __i386__
/************************************************************************* /*************************************************************************
* RtlUshortByteSwap (NTOSKRNL.EXE.@)
*/
__ASM_FASTCALL_FUNC(RtlUshortByteSwap, 4,
"movb %ch,%al\n\t"
"movb %cl,%ah\n\t"
"ret")
/*************************************************************************
* RtlUlongByteSwap (NTOSKRNL.EXE.@)
*/
__ASM_FASTCALL_FUNC(RtlUlongByteSwap, 4,
"movl %ecx,%eax\n\t"
"bswap %eax\n\t"
"ret")
/*************************************************************************
* RtlUlonglongByteSwap (NTOSKRNL.EXE.@) * RtlUlonglongByteSwap (NTOSKRNL.EXE.@)
*/ */
__ASM_FASTCALL_FUNC(RtlUlonglongByteSwap, 8, __ASM_FASTCALL_FUNC(RtlUlonglongByteSwap, 8,
......
...@@ -67,9 +67,9 @@ ...@@ -67,9 +67,9 @@
@ stdcall -fastcall ObfDereferenceObject(ptr) @ stdcall -fastcall ObfDereferenceObject(ptr)
@ stdcall -fastcall ObfReferenceObject(ptr) @ stdcall -fastcall ObfReferenceObject(ptr)
@ stub RtlPrefetchMemoryNonTemporal @ stub RtlPrefetchMemoryNonTemporal
@ cdecl -i386 -norelay RtlUlongByteSwap() @ stdcall -fastcall -arch=i386 -norelay RtlUlongByteSwap(long)
@ stdcall -fastcall -arch=i386 -norelay RtlUlonglongByteSwap(int64) @ stdcall -fastcall -arch=i386 -norelay RtlUlonglongByteSwap(int64)
@ cdecl -i386 -norelay RtlUshortByteSwap() @ stdcall -fastcall -arch=i386 -norelay RtlUshortByteSwap(long)
@ stub WmiGetClock @ stub WmiGetClock
@ stub Kei386EoiHelper @ stub Kei386EoiHelper
@ stub Kii386SpinOnSpinLock @ stub Kii386SpinOnSpinLock
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment