what's the standard mutex code for peripheral access?

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, just saw the atomic instructions that AVR32 GCC sipport:

Quote:

int __sync_fetch_and_ (int *ptr, int value)
int __sync__and_fetch (int *ptr, int value)
bool __sync_bool_compare_and_swap ( int *ptr, int oldval, int newval)
int __sync_val_compare_and_swap ( int *ptr, int oldval, int newval)
int __sync_lock_test_and_set (int *ptr, int value)

which one do you use for mutex of peripheral access?

Cheng