About atomic_add() and atomic_sub()

Can I specify atomic_add() and atomic_sub() to be data width 8, 16, 32, or
64 bits?

“Joseph” <tswu8@yahoo.com.tw> wrote in message
news:e7gjc2$938$1@inn.qnx.com

Can I specify atomic_add() and atomic_sub() to be data width 8, 16, 32,
or 64 bits?

No.

Do you mean
I can’t atomic_add or atomic_sub an 8bits, 16bits value. Only 32bits?

For example
atomic_add(0xa0) for 8-bits
atomic_add(0xa0a0) for 16-bits
atomic_add(0xa0a0a0a0) for 32-bits

“asmart” <tsunghsunwu@fpc.com-dot-tw.no-spam.invalid> wrote in message
news:e7qvia$bce$1@inn.qnx.com

Do you mean
I can’t atomic_add or atomic_sub an 8bits, 16bits value. Only 32bits?

For example
atomic_add(0xa0) for 8-bits
atomic_add(0xa0a0) for 16-bits
atomic_add(0xa0a0a0a0) for 32-bits

I don’t see how the documentation can be more clear about this.

the prototype to atomic_add looks like:

void atomic_add( volatile unsigned *loc, unsigned incr);

Because the fonction takes a pointer to an unsigned int (32 bits) the
fonction can only deal with unsigned int.