2 * PROJECT: ReactOS system libraries
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: lib/intrlck/i386/exchange.c
5 * PURPOSE: Inter lock exchanges
6 * PROGRAMMERS: Copyright 1995 Martin von Loewis
7 * Copyright 1997 Onno Hovers
10 /************************************************************************
13 * Atomically exchanges a pair of values.
16 * Prior value of value pointed to by Target
20 * LONG NTAPI InterlockedExchange(LPLONG target, LONG value)
26 InterlockedExchange(LPLONG target
, LONG value
)
30 /* lock for SMP systems */
31 "lock\n\txchgl %0,(%1)"
32 :"=r" (ret
):"r" (target
), "0" (value
):"memory" );