Skip to contentSkip to conversation

atomic add instruction

Linux-ia64 Swaminathan Sivasubramanian 2 participants 2 messages Jul 17, 2001 – Jul 18, 2001

lore
Share & tools
lore
#0 lore raw

Hello Everyone,

I want an atomic function that does addition of a constant to the value in a memory location and returns the previous value in that location.

Is there any macro/function defined in IA-64's atomic.h already. (will
fetch-and-add solve the purpose?) or one should write his own function for it

Thanking in advance,
Swami

#1 lore raw

There are compiler intrinisics for this purpose. See the IA-64 processor-specific ABI for a description. You have to include <ia64intrin.h> to get the intrinsics defined.

	--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Swaminathan Sivasubramanian

Swami> Hello Everyone,

Swami> I want an atomic function that does addition of a constant to Swami> the value in a memory location and returns the previous value Swami> in that location.

Swami> Is there any macro/function defined in IA-64's atomic.h Swami> already. (will fetch-and-add solve the purpose?) or one Swami> should write his own function for it

Swami> Thanking in advance, Swami

Swami> _______________________________________________ Linux-IA64 Swami> mailing list [email protected]
Swami> http://lists.linuxia64.org/lists/listinfo/linux-ia64