Skip to content

Conversation

@carlescufi
Copy link
Member

The code today relied on ATOMIC_OPERATIONS_BUILTIN being the default option if the other alternatives (_C and _ARCH) were not enabled. Instead, explicitly check for it to avoid confusion when browsing the code and to ensure that the user can always match a particular Kconfig option with the #ifdeffery in the header file.

@zephyrbot zephyrbot added the area: Base OS Base OS Library (lib/os) label Nov 11, 2025
tejlmand
tejlmand previously approved these changes Nov 11, 2025
@carlescufi
Copy link
Member Author

carlescufi commented Nov 11, 2025

@sylvioalves something is weird here: #99202. It seems that a lot of Espressif boards do not enable any CONFIG_ATOMIC_OPERATIONS_* options. Is this intended? they seem to be the only boards with this issue.

EDIT: I think the right course of action here is to change the menu into a choice so that SoCs that forget to set this have a reliable default.

The ATOMIC_OPERATIONS_* Kconfig option is not a choice, so it does not
have a default. However, the file that determines which actual atomic
operations backend will be used does default to
ATOMIC_OPERATIONS_BUILTIN:

https://github.com/zephyrproject-rtos/zephyr/blob/3e537db71ea277ccf98adcc9e05707701e53d084/include/zephyr/sys/atomic.h#L26-L41

Since we want to ensure that all SoCs intentionally select the atomic
operations backend they want to use, select it at the SoC level for all
SoCs.

Signed-off-by: Carles Cufi <[email protected]>
The code today relied on ATOMIC_OPERATIONS_BUILTIN being the default
option if the other alternatives (_C and _ARCH) were not enabled.
Instead, explicitly check for it to avoid confusion when browsing the
code and to ensure that the user can always match a particular Kconfig
option with the #ifdeffery in the header file.

Signed-off-by: Carles Cufi <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Base OS Base OS Library (lib/os) area: Boards/SoCs area: Xtensa Xtensa Architecture platform: ESP32 Espressif ESP32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants