[PATCH 15/23] sandbox: asm: implement <asm/atomic.h>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For easier code-sharing, the UBIFS code still uses the Kernel's
atomic accessors. Provide a sandbox <asm/atomic.h> header, so we
can compile-test UBI under sandbox.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 arch/sandbox/include/asm/atomic.h | 11 +++++++++++
 arch/sandbox/include/asm/system.h | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 arch/sandbox/include/asm/atomic.h
 create mode 100644 arch/sandbox/include/asm/system.h

diff --git a/arch/sandbox/include/asm/atomic.h b/arch/sandbox/include/asm/atomic.h
new file mode 100644
index 000000000000..ef1043493b8f
--- /dev/null
+++ b/arch/sandbox/include/asm/atomic.h
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ *  Copyright (c) 2020 Ahmad Fatoum
+ */
+#ifndef __ASM_SANDBOX_ATOMIC_H
+#define __ASM_SANDBOX_ATOMIC_H
+
+#include <asm/system.h>
+#include <asm-generic/atomic.h>
+
+#endif
diff --git a/arch/sandbox/include/asm/system.h b/arch/sandbox/include/asm/system.h
new file mode 100644
index 000000000000..a9b99b07b9a6
--- /dev/null
+++ b/arch/sandbox/include/asm/system.h
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ *  Copyright (c) 2020 Ahmad Fatoum
+ */
+#ifndef __ASM_SANDBOX_SYSTEM_H
+#define __ASM_SANDBOX_SYSTEM_H
+
+#define local_irq_enable() do { } while (0)
+#define local_irq_disable() do { } while (0)
+#define local_save_flags(x) do { (void)x; } while (0)
+#define local_irq_save(x) do { (void)x; } while (0)
+#define local_irq_restore(x) do { (void)x; } while (0)
+
+#endif
-- 
2.26.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux