[PATCH 6/8] extend barebox wrapper header

Sascha Hauer s.hauer at pengutronix.de
Tue Aug 6 09:07:06 EDT 2013


Add empty definitions for mutexes, spinlocks and other stuff from
the kernel to make it easier to reuse code from the kernel.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/linux/barebox-wrapper.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h
index 1ba4e32..753fb52 100644
--- a/include/linux/barebox-wrapper.h
+++ b/include/linux/barebox-wrapper.h
@@ -34,4 +34,36 @@ typedef int     gfp_t;
 #define MODULE_DESCRIPTION(x)
 #define MODULE_LICENSE(x)
 
+typedef int   spinlock_t;
+#define spin_lock_init(...)
+#define spin_lock(...)
+#define spin_unlock(...)
+
+#define mutex_init(...)
+#define mutex_lock(...)
+#define mutex_unlock(...)
+struct mutex { int i; };
+
+struct rw_semaphore { int i; };
+
+#define __user
+#define __init
+#define __exit
+
+#define init_rwsem(...)			do { } while (0)
+#define down_read(...)			do { } while (0)
+#define down_write(...)			do { } while (0)
+#define down_write_trylock(...)		1
+#define up_read(...)			do { } while (0)
+#define up_write(...)			do { } while (0)
+#define kthread_create(...)	__builtin_return_address(0)
+#define kthread_stop(...)	do { } while (0)
+#define wake_up_process(...)	do { } while (0)
+
+typedef int	wait_queue_head_t;
+
+#define cond_resched()			do { } while (0)
+
+#define init_waitqueue_head(...)	do { } while (0)
+
 #endif /* __INCLUDE_LINUX_BAREBOX_WRAPPER_H */
-- 
1.8.4.rc1




More information about the barebox mailing list