zephyr/kernel
Lingutla Chandrasekhar a5fbcbb12c arch: riscv: skip ATOMIC_OPERATIONS_C if arch-specific atomics are enabled
Previously, ATOMIC_OPERATIONS_C was selected for RISC-V whenever the
'A' (atomic) ISA extension (RISCV_ISA_EXT_A) was absent. This caused
a conflict on platforms that lack the 'A' extension but still provide
their own arch-level atomic implementation via ATOMIC_OPERATIONS_ARCH
(e.g. future RISC-V SoCs with custom atomic support).

Add !ATOMIC_OPERATIONS_ARCH to the select condition so that the
generic C fallback (interrupt-locking) is only chosen when neither
the ISA extension nor an arch-specific implementation is available.

This condition creates a Kconfig dependency cycle:

  RISCV selects ATOMIC_OPERATIONS_C if !ATOMIC_OPERATIONS_ARCH
  => ATOMIC_OPERATIONS_C depends on !ATOMIC_OPERATIONS_ARCH
  => ATOMIC_OPERATIONS_ARCH depends on SMP (fvp_base_revc_2xaem board)
  => SMP depends on !ATOMIC_OPERATIONS_C

Break the cycle by removing 'depends on !ATOMIC_OPERATIONS_C' from
SMP in kernel/smp/Kconfig. This is safe because ATOMIC_OPERATIONS_C
is now only selected when ATOMIC_OPERATIONS_ARCH is absent, so the
two symbols are mutually exclusive by construction. The existing
BUILD_ASSERT(!IS_ENABLED(CONFIG_SMP)) in lib/os/atomic_c.c provides
a compile-time backstop against any misconfiguration.

Suggested-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Lingutla Chandrasekhar <lingutla@qti.qualcomm.com>
2026-05-22 10:44:26 +02:00
..
include pm: keep irq restore ownership in idle 2026-05-21 17:02:03 -04:00
paging kernel: mm: rename z_num_pagefaults_get to k_mem_num_* 2024-06-12 21:13:26 -04:00
smp arch: riscv: skip ATOMIC_OPERATIONS_C if arch-specific atomics are enabled 2026-05-22 10:44:26 +02:00
sys kernel: move thread_entry from lib/os to kernel 2026-04-14 22:31:16 -04:00
userspace kernel: userspace: fix validate_kernel_object type/init 2026-05-20 20:07:59 -04:00
busy_wait.c kernel: busy_wait: handle runtime system timer frequency updates 2026-02-20 13:31:07 +01:00
CMakeLists.txt kernel: move atomic_c.c to lib/os 2026-05-01 11:17:27 -05:00
compiler_stack_protect.c arch: riscv: use TLS-based stack canary guard 2026-05-14 21:52:56 +02:00
condvar.c kernel: fix k_condvar_wait mutex re-acquisition on timeout 2026-05-21 17:00:29 -04:00
deadline.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
device.c device: remove duplicate code 2025-11-24 17:33:13 +01:00
dynamic.c kernel: dynamic: update storage size for pool of dynamic thread stacks 2025-10-02 11:46:22 +03:00
dynamic_disabled.c kernel: dynamic: declare dynamic stubs when disabled 2023-07-24 12:59:43 -04:00
events.c kernel: sched: move public scheduler API to scheduler.c/scheduler.h 2026-04-24 15:39:20 -04:00
fatal.c Revert "arch: deprecate _current" 2025-01-10 07:49:08 +01:00
float.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
idle.c pm: keep irq restore ownership in idle 2026-05-21 17:02:03 -04:00
init.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
irq_offload.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
Kconfig kernel: move atomic_c.c to lib/os 2026-05-01 11:17:27 -05:00
Kconfig.device kernel: Kconfig.device: fix CONFIG_DEVICE_DEINIT_SUPPORT help text 2026-03-08 16:36:39 +01:00
Kconfig.init kernel/Kconfig.init: update description of SOC_RESET_HOOK 2025-10-07 12:50:10 +02:00
Kconfig.obj_core kernel: Rewrite k_pipe_* API 2025-01-17 19:43:44 +01:00
Kconfig.vm arch: mmu: do not make MMU user configurable 2025-02-19 04:59:19 +01:00
kheap.c Revert "kernel: avoid recursive scheduler lock in k_heap_free path" 2026-05-01 09:44:00 +02:00
mailbox.c kernel: mailbox: emit tracing EXIT on async-send matched-receiver path 2026-04-21 18:39:55 -04:00
main_weak.c kernel: Switch main return type from void to int 2023-04-14 07:49:41 +09:00
mem_slab.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
mempool.c kernel: ensure kheap.c is linked for static heap initialization 2026-05-01 09:44:00 +02:00
mmu.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
msg_q.c Revert "kernel: avoid recursive scheduler lock in k_heap_free path" 2026-05-01 09:44:00 +02:00
mutex.c kernel: Disable k_mutex priority inheritance 2026-02-16 00:13:23 +00:00
nothread.c kernel: nothread: fix build when CONFIG_SYS_CLOCK_EXISTS=n 2026-01-13 17:27:58 +01:00
obj_core.c kernel: reduce k_spin_unlock calls using if-else if-else structure 2024-07-27 20:48:07 +03:00
pipe.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
poll.c kernel: poll: z_vrfy_k_poll() to free memory 2026-05-20 20:08:10 -04:00
priority_queues.c kernel: priority queues: declare as static inlines 2024-04-22 16:40:11 -04:00
queue.c kernel: queue: remove spurious BLOCKING trace in queue_insert 2026-04-21 18:39:55 -04:00
sched.c kernel: thread timeout: Fix race condition 2026-05-11 04:04:02 +02:00
scheduler.c kernel: sched: move public scheduler API to scheduler.c/scheduler.h 2026-04-24 15:39:20 -04:00
sem.c kernel: Allow for fast return on k_sem_reset() 2025-02-03 19:51:20 +01:00
sleep.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
spinlock_validate.c spinlock: Validate support for up to 8 CPUs on 64-bit systems 2026-05-15 23:27:26 +02:00
stack.c Revert "kernel: avoid recursive scheduler lock in k_heap_free path" 2026-05-01 09:44:00 +02:00
sys_clock_hw_cycles.c kernel: refactor sys_clock_hw_cycles_per_sec runtime support 2026-02-20 13:31:07 +01:00
system_work_q.c kernel: workq: introduce work timeout: 2025-06-06 08:42:53 +02:00
thread.c sys: util: move lowercase min/max/clamp to a new minmax.h 2026-05-19 17:49:24 -04:00
thread_monitor.c kernel: thread_monitor: reafactor and remove duplicate code 2025-04-04 07:42:20 +02:00
timeout.c kernel: timeout: make in-announce check CPU-aware 2026-05-20 10:55:56 +02:00
timer.c kernel: timer: make k_timer_start duration match documented semantics 2026-05-04 21:55:33 +02:00
timeslicing.c kernel: timeslicing: rearm with slice_size-1 when slicer just fired 2026-05-20 10:55:56 +02:00
usage.c kernel: usage: Fix CPU stats retrieval in z_sched_cpu_usage() 2025-10-22 09:04:13 +02:00
version.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
work.c kernel: sched: move public scheduler API to scheduler.c/scheduler.h 2026-04-24 15:39:20 -04:00