2010-09-22 15:10:42 +02:00
|
|
|
#include <atomic.h>
|
|
|
|
#include <cpu.h>
|
|
|
|
|
2013-06-21 03:52:57 +02:00
|
|
|
unsigned int atomic_set_return(unsigned int *val, unsigned int set)
|
|
|
|
{
|
2010-09-22 15:10:42 +02:00
|
|
|
dINT();
|
|
|
|
unsigned int old_val = *val;
|
|
|
|
*val = set;
|
|
|
|
eINT();
|
|
|
|
return old_val;
|
|
|
|
}
|