Commit Graph

15 Commits

Author SHA1 Message Date
Ivan Grokhotkov
0c10b937f5 Merge branch 'bugfix/freertos_smp_disable_interrupt_usage' into 'master'
FreeRTOS: Replace portSET_INTERRUPT_MASK_FROM_ISR() call for SMP

Closes IDF-5062 and IDF-5066

See merge request espressif/esp-idf!18301
2022-06-01 00:18:26 +08:00
Anton Maklakov
bf3892acee newlib: stdatomic: fix conflicting types for __atomic_load/__atomic_store 2022-05-30 14:48:12 +07:00
Darian Leung
daa950d9ed freertos: Replace portSET_INTERRUPT_MASK_FROM_ISR() call for SMP
The behavior of portSET_INTERRUPT_MASK_FROM_ISR() has changed in SMP FreeRTOS. It's
previous behavior is now implemented in portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS().

This commit replaces all portSET_INTERRUPT_MASK_FROM_ISR() and portCLEAR_INTERRUPT_MASK_FROM_ISR()
calls with portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS() respectively
2022-05-30 06:11:24 +08:00
Andrei Safronov
3d9814bf8b newlib: implement __atomic_load/__atomic_store functions 2022-05-11 17:00:14 +03:00
Anton Maklakov
3ab9acddc1 newlib: stdatomic: fix conflicting types for atomic built-in functions
Also use `unsigned int`, `short unsigned int`,`long long unsigned int` etc types
instead of uintN_t. Because some platforms have uintN_t types that don't
conrrespont to built-in prototypes.
2022-03-02 16:22:45 +07:00
Ivan Grokhotkov
01033a3a60 newlib: stdatomic: implement missing "op_fetch", "nand" builtins
* Adds implementations of __{atomic,sync}_nand_fetch_n. These builtins
  were implemented for other operations but were not defined for NAND.
* Adds implementation of __atomic_OP_fetch_n for all OPs.
* Adds implementation of __sync_OP_and_fetch_n for all OPs.

Reported in https://github.com/espressif/arduino-esp32/issues/5948
2021-12-14 16:06:12 +01:00
Darian Leung
d6f2fa4bab freertos: Remove critical nested macros
This commit removes the following critical nested macros as follows:

- portENTER_CRITICAL_NESTED()
- portEXIT_CRITICAL_NESTED()

They are replaced with portSET_INTERRUPT_MASK_FROM_ISR() and
portCLEAR_INTERRUPT_MASK_FROM_ISR() which are the proper FreeRTOS interfaces.

Created a portmacro_deprecated.h for each port to contain deprecated API
that were originally from portmacro.h
2021-10-22 13:17:20 +08:00
Andrei Safronov
f4803c5aaf newlib: fix clang atomics
Correction of the SYNC_LOCK_* macros in stdatomic
2021-10-20 23:33:53 +03:00
Scott Mabin
d5e4fc8356 remove __clang ifdef around atomic emulation
* CI errors led me to believe these were needed, but as it turns out the
load/store intrinsics are required even when idf is built by gcc when
linking to a clang based project.
* remove ... postfix inside `SYNC_LOCK_TEST_AND_SET` expansion
2021-10-14 15:01:21 +01:00
Scott Mabin
d93b53b9e5 newlib: provide missing atomic libcalls
Provide emulated atomic load & store libcalls for u8, u16 & u32 integer
types. This is required when building with Clang as llvm does not lower
these operations to native load / stores, where as gcc does.

Provide `sync_lock_test_and_set` atomic implementations for all
supported integer types.

Closes https://github.com/espressif/esp-idf/issues/7591.
Closes https://github.com/espressif/esp-idf/issues/7592.
2021-10-08 18:46:09 +08:00
Andrei Safronov
40daaa9d56 newlib,clang: implement __sync_* atomics for clang/llvm toolchain. 2021-07-15 20:36:40 +03:00
Ivan Grokhotkov
742102079a newlib: stdatomic: emulate 64-bit atomics on 32-bit SMP SoCs
Closes https://github.com/espressif/esp-idf/issues/3163
2021-05-10 18:13:36 +02:00
Ivan Grokhotkov
32fcd4f02a newlib: stdatomic: fix prototypes, don't disable compiler warnings 2021-05-10 18:13:35 +02:00
Sachin Parekh
b1eacc24f2 stdatomic: Implemented legacy __sync APIs and __atomic_exchange_n
These APIs are used when the architecture doesn't have atomic
instruction support

Closes https://github.com/espressif/esp-idf/issues/6463
2021-04-23 11:18:58 +05:30
Renz Bagaporo
b1027005df arch: move stdatomic 2021-02-26 18:40:00 +08:00