3 * reactos/ntoskrnl/ex/i386/interlck.c
9 INTERLOCKED_RESULT FASTCALL
10 Exfi386InterlockedIncrementLong(IN PLONG Addend);
12 __asm__("\n\t.global @Exfi386InterlockedIncrementLong@4\n\t"
13 "@Exfi386InterlockedIncrementLong@4:\n\t"
16 "andl $0xC000, %eax\n\t"
20 INTERLOCKED_RESULT FASTCALL
21 Exfi386InterlockedDecrementLong(IN PLONG Addend);
23 __asm__("\n\t.global @Exfi386InterlockedDecrementLong@4\n\t"
24 "@Exfi386InterlockedDecrementLong@4:\n\t"
27 "andl $0xC000, %eax\n\t"
32 Exfi386InterlockedExchangeUlong(IN PULONG Target,
35 __asm__("\n\t.global @Exfi386InterlockedExchangeUlong@8\n\t"
36 "@Exfi386InterlockedExchangeUlong@8:\n\t"
37 "xchgl %edx,(%ecx)\n\t"
43 INTERLOCKED_RESULT STDCALL
44 Exi386InterlockedIncrementLong(IN PLONG Addend);
46 __asm__("\n\t.global _Exi386InterlockedIncrementLong@4\n\t"
47 "_Exi386InterlockedIncrementLong@4:\n\t"
48 "movl 4(%esp),%eax\n\t"
51 "andl $0xC000, %eax\n\t"
55 INTERLOCKED_RESULT STDCALL
56 Exi386InterlockedDecrementLong(IN PLONG Addend);
58 __asm__("\n\t.global _Exi386InterlockedDecrementLong@4\n\t"
59 "_Exi386InterlockedDecrementLong@4:\n\t"
60 "movl 4(%esp),%eax\n\t"
63 "andl $0xC000, %eax\n\t"
68 Exi386InterlockedExchangeUlong(IN PULONG Target,
71 __asm__("\n\t.global _Exi386InterlockedExchangeUlong@8\n\t"
72 "_Exi386InterlockedExchangeUlong@8:\n\t"
73 "movl 4(%esp),%edx\n\t"
74 "movl 8(%esp),%eax\n\t"
75 "xchgl %eax,(%edx)\n\t"
79 /**********************************************************************
80 * FASTCALL: @InterlockedIncrement@4
81 * STDCALL : _InterlockedIncrement@4
84 InterlockedIncrement(PLONG Addend);
86 * FUNCTION: Increments a caller supplied variable of type LONG as an
89 * Addend = Points to a variable whose value is to be increment
90 * RETURNS: The incremented value
93 __asm__("\n\t.global @InterlockedIncrement@4\n\t"
94 "@InterlockedIncrement@4:\n\t"
96 "xaddl %eax,(%ecx)\n\t"
101 /**********************************************************************
102 * FASTCALL: @InterlockedDecrement@4
103 * STDCALL : _InterlockedDecrement@4
106 InterlockedDecrement(PLONG Addend);
108 __asm__("\n\t.global @InterlockedDecrement@4\n\t"
109 "@InterlockedDecrement@4:\n\t"
111 "xaddl %eax,(%ecx)\n\t"
116 /**********************************************************************
117 * FASTCALL: @InterlockedExchange@8
118 * STDCALL : _InterlockedExchange@8
122 InterlockedExchange(PLONG Target,
125 __asm__("\n\t.global @InterlockedExchange@8\n\t"
126 "@InterlockedExchange@8:\n\t"
127 "xchgl %edx,(%ecx)\n\t"
132 /**********************************************************************
133 * FASTCALL: @InterlockedExchangeAdd@8
134 * STDCALL: _InterlockedExchangeAdd@8
137 InterlockedExchangeAdd(PLONG Addend,
140 __asm__("\n\t.global @InterlockedExchangeAdd@8\n\t"
141 "@InterlockedExchangeAdd@8:\n\t"
142 "xaddl %edx,(%ecx)\n\t"
147 /**********************************************************************
148 * FASTCALL: @InterlockedCompareExchange@12
149 * STDCALL: _InterlockedCompareExchange@12
152 InterlockedCompareExchange(PLONG Destination,
156 __asm__("\n\t.global @InterlockedCompareExchange@12\n\t"
157 "@InterlockedCompareExchange@12:\n\t"
158 "movl 4(%esp),%eax\n\t"
159 "cmpxchg %edx,(%ecx)\n\t"