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:
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
#include <lock.h>
|
#include <lock.h>
|
||||||
|
#include <arch_config.h>
|
||||||
|
|
||||||
|
|
||||||
extern "C" bool
|
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*/
|
||||||
|
|||||||
Reference in New Issue
Block a user