1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-15 09:33:50 +01:00
RIOT/cpu/esp32/stdatomic.c
Gunar Schorcht 4f136fb3ad cpu/esp32: add missing atomic built-in functions
Atomic built-in function __atomic_test_and_set seem to be missing in GCC 14.2.0 for some ESP32x SoCs.
2025-03-02 12:39:18 +01:00

27 lines
550 B
C

/*
* Copyright (C) 2025 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_esp_common
* @{
*
* @file
* @brief Missing atomic built-in functions
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @}
*/
#include <stdbool.h>
__attribute__((weak))
bool __atomic_test_and_set(volatile void *ptr, int memorder)
{
return __atomic_exchange_1(ptr, true, memorder);
}