- Timestamp:
- Sep 20, 2012, 4:34:09 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/interlock.asm
r5938 r22018 123 123 _InterlockedExchangeAdd@8 endp 124 124 125 public _interlocked_cmpxchg64 126 _interlocked_cmpxchg64 proc near 127 push ebx; 128 push esi; 129 mov esi, 12[esp]; 130 mov ebx, 16[esp]; 131 mov ecx, 20[esp]; 132 mov eax, 24[esp]; 133 mov edx, 28[esp]; 134 lock cmpxchg8b [esi]; 135 pop esi; 136 pop ebx; 137 ret; 138 _interlocked_cmpxchg64 endp 139 125 140 CODE32 ENDS 126 141 -
trunk/src/kernel32/kernel32.def
r22017 r22018 47 47 _O32_RegSetValue = REGISTRY.42 48 48 _O32_RegSetValueEx = REGISTRY.43 49 50 InitializeSListHead = NTDLL.RtlInitializeSListHead 51 InterlockedFlushSList = NTDLL.RtlInterlockedFlushSList 52 InterlockedPopEntrySList = NTDLL.RtlInterlockedPopEntrySList 53 InterlockedPushEntrySList = NTDLL.RtlInterlockedPushEntrySList 54 QueryDepthSList = NTDLL.RtlQueryDepthSList 49 55 50 56 EXPORTS … … 1326 1332 GetUserDefaultUILanguage = "_GetUserDefaultUILanguage@0" @3165 1327 1333 1334 InitializeSListHead @3166 1335 InterlockedFlushSList @3167 1336 InterlockedPopEntrySList @3168 1337 InterlockedPushEntrySList @3169 1338 QueryDepthSList @3170 1339 1328 1340 ; RAS functions 1329 1341 RasRegisterObjectTracking = "_RasRegisterObjectTracking@24" @3500 … … 1364 1376 "_ForceWin32TIB@0" @3601 NONAME 1365 1377 ___seh_handler @3602 NONAME 1378 1379 interlocked_cmpxchg64 = "_interlocked_cmpxchg64" @3603 -
trunk/src/kernel32/kernel32dbg.def
r22017 r22018 47 47 _O32_RegSetValue = REGISTRY.42 48 48 _O32_RegSetValueEx = REGISTRY.43 49 50 InitializeSListHead = NTDLL.RtlInitializeSListHead 51 InterlockedFlushSList = NTDLL.RtlInterlockedFlushSList 52 InterlockedPopEntrySList = NTDLL.RtlInterlockedPopEntrySList 53 InterlockedPushEntrySList = NTDLL.RtlInterlockedPushEntrySList 54 QueryDepthSList = NTDLL.RtlQueryDepthSList 55 49 56 50 57 EXPORTS … … 1326 1333 GetUserDefaultUILanguage = "_GetUserDefaultUILanguage@0" @3165 1327 1334 1335 InitializeSListHead @3166 1336 InterlockedFlushSList @3167 1337 InterlockedPopEntrySList @3168 1338 InterlockedPushEntrySList @3169 1339 QueryDepthSList @3170 1340 1328 1341 ; RAS functions 1329 1342 RasRegisterObjectTracking = "_RasRegisterObjectTracking@24" @3500 … … 1364 1377 "_ForceWin32TIB@0" @3601 NONAME 1365 1378 ___seh_handler @3602 NONAME 1379 1380 interlocked_cmpxchg64 = "_interlocked_cmpxchg64" @3603 -
trunk/src/ntdll/ntdll.def
r21995 r22018 13 13 "_RtlEnterCriticalSection@4" = KERNEL32.EnterCriticalSection 14 14 "_RtlDeleteCriticalSection@4" = KERNEL32.DeleteCriticalSection 15 16 "_interlocked_cmpxchg64" = KERNEL32.interlocked_cmpxchg64 15 17 16 18 EXPORTS … … 1105 1107 VerSetConditionMask = "_VerSetConditionMask@16" @2011 1106 1108 RtlGetNtVersionNumbers = "_RtlGetNtVersionNumbers@12" @2012 1109 1110 RtlFirstEntrySList = "_RtlFirstEntrySList@4" @2013 1111 RtlInitializeSListHead = "_RtlInitializeSListHead@4" @2014 1112 RtlInterlockedFlushSList = "_RtlInterlockedFlushSList@4" @2015 1113 RtlInterlockedPopEntrySList = "_RtlInterlockedPopEntrySList@4" @2016 1114 RtlInterlockedPushEntrySList = "_RtlInterlockedPushEntrySList@8" @2017 1115 RtlInterlockedPushListSList = "_RtlInterlockedPushListSList@16" @2018 1116 RtlQueryDepthSList = "_RtlQueryDepthSList@4" @2019 -
trunk/src/ntdll/rtl.c
r21916 r22018 31 31 #include "winreg.h" 32 32 #include "heapstring.h" 33 #include "win/winnt.h" 34 #include "win/wine/exception.h" 33 35 34 36 #include <misc.h> … … 698 700 return ~crc; 699 701 } 702 703 /************************************************************************* 704 * RtlInitializeSListHead [NTDLL.@] 705 */ 706 VOID WINAPI RtlInitializeSListHead(PSLIST_HEADER list) 707 { 708 list->Alignment = 0; 709 } 710 711 /************************************************************************* 712 * RtlQueryDepthSList [NTDLL.@] 713 */ 714 WORD WINAPI RtlQueryDepthSList(PSLIST_HEADER list) 715 { 716 return list->Depth; 717 } 718 719 /************************************************************************* 720 * RtlFirstEntrySList [NTDLL.@] 721 */ 722 PSLIST_ENTRY WINAPI RtlFirstEntrySList(const SLIST_HEADER* list) 723 { 724 return list->Next.Next; 725 } 726 727 /************************************************************************* 728 * RtlInterlockedFlushSList [NTDLL.@] 729 */ 730 PSLIST_ENTRY WINAPI RtlInterlockedFlushSList(PSLIST_HEADER list) 731 { 732 SLIST_HEADER old, new; 733 734 if (!list->Depth) return NULL; 735 new.Alignment = 0; 736 do 737 { 738 old = *list; 739 new.Sequence = old.Sequence + 1; 740 } while (interlocked_cmpxchg64((__int64 *)&list->Alignment, new.Alignment, 741 old.Alignment) != old.Alignment); 742 return old.Next.Next; 743 } 744 745 /************************************************************************* 746 * RtlInterlockedPushEntrySList [NTDLL.@] 747 */ 748 PSLIST_ENTRY WINAPI RtlInterlockedPushEntrySList(PSLIST_HEADER list, PSLIST_ENTRY entry) 749 { 750 SLIST_HEADER old, new; 751 752 new.Next.Next = entry; 753 do 754 { 755 old = *list; 756 entry->Next = old.Next.Next; 757 new.Depth = old.Depth + 1; 758 new.Sequence = old.Sequence + 1; 759 } while (interlocked_cmpxchg64((__int64 *)&list->Alignment, new.Alignment, 760 old.Alignment) != old.Alignment); 761 return old.Next.Next; 762 } 763 764 /************************************************************************* 765 * RtlInterlockedPopEntrySList [NTDLL.@] 766 */ 767 PSLIST_ENTRY WINAPI RtlInterlockedPopEntrySList(PSLIST_HEADER list) 768 { 769 SLIST_HEADER old, new; 770 PSLIST_ENTRY entry; 771 772 do 773 { 774 old = *list; 775 if (!(entry = old.Next.Next)) return NULL; 776 /* entry could be deleted by another thread */ 777 __TRY 778 { 779 new.Next.Next = entry->Next; 780 new.Depth = old.Depth - 1; 781 new.Sequence = old.Sequence + 1; 782 } 783 __EXCEPT_PAGE_FAULT 784 { 785 } 786 __ENDTRY 787 } while (interlocked_cmpxchg64((__int64 *)&list->Alignment, new.Alignment, 788 old.Alignment) != old.Alignment); 789 return entry; 790 } 791 792 /************************************************************************* 793 * RtlInterlockedPushListSList [NTDLL.@] 794 */ 795 PSLIST_ENTRY WINAPI RtlInterlockedPushListSList(PSLIST_HEADER list, PSLIST_ENTRY first, 796 PSLIST_ENTRY last, ULONG count) 797 { 798 SLIST_HEADER old, new; 799 800 new.Next.Next = first; 801 do 802 { 803 old = *list; 804 new.Depth = old.Depth + count; 805 new.Sequence = old.Sequence + 1; 806 last->Next = old.Next.Next; 807 } while (interlocked_cmpxchg64((__int64 *)&list->Alignment, new.Alignment, 808 old.Alignment) != old.Alignment); 809 return old.Next.Next; 810 }
Note:
See TracChangeset
for help on using the changeset viewer.