This adds required header files for the sandbox architecture, and a basic
description of what sandbox is (README.sandbox).
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v6:
- Remove volatile keyword from arch/sandbox/include/asm/bitops.h
arch/sandbox/include/asm/bitops.h | 162 +
arch/sandbox/include/asm/byteorder.h | 40 +++
arch/sandbox/include/asm/config.h | 26 +
arch/sandbox/include/asm/global_data.h| 66
arch/sandbox/include/asm/io.h | 41 +++
arch/sandbox/include/asm/posix_types.h| 57 ++
arch/sandbox/include/asm/ptrace.h | 38 +++
arch/sandbox/include/asm/string.h | 23
arch/sandbox/include/asm/system.h | 36 +++
arch/sandbox/include/asm/types.h | 72 +
arch/sandbox/include/asm/u-boot-sandbox.h | 38 +++
arch/sandbox/include/asm/u-boot.h | 61 +++
arch/sandbox/include/asm/unaligned.h | 23
doc/README.sandbox| 53 ++
include/common.h |3 +
15 files changed, 739 insertions(+), 0 deletions(-)
create mode 100644 arch/sandbox/include/asm/bitops.h
create mode 100644 arch/sandbox/include/asm/byteorder.h
create mode 100644 arch/sandbox/include/asm/config.h
create mode 100644 arch/sandbox/include/asm/global_data.h
create mode 100644 arch/sandbox/include/asm/io.h
create mode 100644 arch/sandbox/include/asm/posix_types.h
create mode 100644 arch/sandbox/include/asm/ptrace.h
create mode 100644 arch/sandbox/include/asm/string.h
create mode 100644 arch/sandbox/include/asm/system.h
create mode 100644 arch/sandbox/include/asm/types.h
create mode 100644 arch/sandbox/include/asm/u-boot-sandbox.h
create mode 100644 arch/sandbox/include/asm/u-boot.h
create mode 100644 arch/sandbox/include/asm/unaligned.h
create mode 100644 doc/README.sandbox
diff --git a/arch/sandbox/include/asm/bitops.h
b/arch/sandbox/include/asm/bitops.h
new file mode 100644
index 000..74219c5
--- /dev/null
+++ b/arch/sandbox/include/asm/bitops.h
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * Copyright 1995, Russell King.
+ * Various bits and pieces copyrights include:
+ * Linus Torvalds (test_bit).
+ *
+ * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
+ *
+ * Please note that the code in this file should never be included
+ * from user space. Many of these are not implemented in assembler
+ * since they would be too costly. Also, they require priviledged
+ * instructions (which are not available from user mode) to ensure
+ * that they are atomic.
+ */
+
+#ifndef __ASM_SANDBOX_BITOPS_H
+#define __ASM_SANDBOX_BITOPS_H
+
+#include asm/system.h
+
+#ifdef __KERNEL__
+
+#define smp_mb__before_clear_bit() do { } while (0)
+#define smp_mb__after_clear_bit() do { } while (0)
+
+/*
+ * Function prototypes to keep gcc -Wall happy.
+ */
+extern void set_bit(int nr, void *addr);
+
+extern void clear_bit(int nr, void *addr);
+
+extern void change_bit(int nr, void *addr);
+
+static inline void __change_bit(int nr, void *addr)
+{
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
+
+ *p ^= mask;
+}
+
+static inline int __test_and_set_bit(int nr, void *addr)
+{
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
+ unsigned long old = *p;
+
+ *p = old | mask;
+ return (old mask) != 0;
+}
+
+static inline int test_and_set_bit(int nr, void *addr)
+{
+ unsigned long flags;
+ int out;
+
+ local_irq_save(flags);
+ out = __test_and_set_bit(nr, addr);
+ local_irq_restore(flags);
+
+ return out;
+}
+
+static inline int __test_and_clear_bit(int nr, void *addr)
+{
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
+ unsigned long old = *p;
+
+ *p = old ~mask;
+ return (old mask) != 0;
+}
+
+static inline int test_and_clear_bit(int nr, void *addr)
+{
+ unsigned long flags;
+ int out;
+
+ local_irq_save(flags);
+ out = __test_and_clear_bit(nr, addr);
+ local_irq_restore(flags);
+
+ return out;
+}
+
+extern int test_and_change_bit(int nr, void *addr);
+
+static inline int __test_and_change_bit(int nr, void *addr)
+{
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
+ unsigned long old = *p;
+
+ *p = old ^ mask;
+ return (old mask) != 0;
+}
+
+extern int find_first_zero_bit(void *addr, unsigned size);
+extern int find_next_zero_bit(void *addr, int size, int offset);
+
+/*
+ * This routine doesn't need to be atomic.
+ */
+static inline int test_bit(int nr, const void *addr)
+{
+ return ((unsigned char *) addr)[nr 3] (1U (nr 7));
+}
+
+/*
+ *