]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sandbox: Add generic asm/atomic.h
authorTom Rini <trini@konsulko.com>
Tue, 12 Aug 2025 17:59:08 +0000 (11:59 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 19 Aug 2025 17:25:28 +0000 (11:25 -0600)
In order to compile code that uses <asm/atomic.h> on sandbox, we must
provide this header. RISC-V shows us today how to do so with the generic
header implementation, so copy that.

Signed-off-by: Tom Rini <trini@konsulko.com>
arch/sandbox/include/asm/atomic.h [new file with mode: 0644]

diff --git a/arch/sandbox/include/asm/atomic.h b/arch/sandbox/include/asm/atomic.h
new file mode 100644 (file)
index 0000000..2fe49f5
--- /dev/null
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Based on arch/riscv/include/asm/atomic.h which is:
+ * Copyright 2023 SiFive, Inc.
+ */
+
+#ifndef __SANDBOX_ATOMIC_H
+#define __SANDBOX_ATOMIC_H
+
+/* use the generic asm/atomic.h until we define a better one */
+
+#include <asm/system.h>
+#include <asm-generic/atomic.h>
+
+#endif