ARM: Add a fallback atomic_add() for bootloader

When ATOMIC_FUNCS_ARE_SYSCALLS atomic.S doesn't export it,
but it's used by packagefs.
This commit is contained in:
François Revol 2013-10-12 19:43:33 +02:00
parent 39d26e3cdb
commit 8fa75a8cca

View File

@ -11,6 +11,7 @@
#include <OS.h>
#include <lock.h>
#include <arch_config.h>
extern "C" bool
@ -45,3 +46,16 @@ _mutex_unlock(mutex*, bool)
{
}
#ifdef ATOMIC_FUNCS_ARE_SYSCALLS
/* needed by packagefs */
extern "C" int32
atomic_add(vint32 *value, int32 addValue)
{
int32 old = *value;
*value += addValue;
return old;
}
#endif /*ATOMIC_FUNCS_ARE_SYSCALLS*/