mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/newlib_implement_atomic_load_store' into 'master'
newlib: implement __atomic_load/__atomic_store functions Closes LLVM-144 See merge request espressif/esp-idf!17561
This commit is contained in:
commit
849a296675
@ -9,6 +9,7 @@
|
||||
#include "sdkconfig.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "soc/soc_caps.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
||||
@ -494,3 +495,18 @@ ATOMIC_LOAD(8, long long unsigned int)
|
||||
ATOMIC_STORE(8, long long unsigned int)
|
||||
|
||||
#endif // !HAS_ATOMICS_64
|
||||
|
||||
// Clang generates calls to the __atomic_load/__atomic_store functions for object size more then 4 bytes
|
||||
void CLANG_ATOMIC_SUFFIX( __atomic_load ) (int size, void *src, void *dest, int model) {
|
||||
unsigned state = _ATOMIC_ENTER_CRITICAL();
|
||||
memcpy(dest, src, size);
|
||||
_ATOMIC_EXIT_CRITICAL(state);
|
||||
}
|
||||
CLANG_DECLARE_ALIAS( __atomic_load )
|
||||
|
||||
void CLANG_ATOMIC_SUFFIX( __atomic_store ) (int size, void *dest, void *src, int model) {
|
||||
unsigned state = _ATOMIC_ENTER_CRITICAL();
|
||||
memcpy(dest, src, size);
|
||||
_ATOMIC_EXIT_CRITICAL(state);
|
||||
}
|
||||
CLANG_DECLARE_ALIAS( __atomic_store)
|
||||
|
Loading…
x
Reference in New Issue
Block a user