changeset 1712:1cb94172ea76

* include/linux/spinlock.h: Add CYG_UNUSED_PARAM() calls to avoid compiler warnings. * include/linux/list.h (list_for_each_entry): New macro needed for latest jffs2 code.
author asl
date Thu, 12 Aug 2004 21:32:39 +0000
parents dd8ccc367dae
children 0492a413d138
files packages/compat/linux/current/ChangeLog packages/compat/linux/current/include/linux/list.h packages/compat/linux/current/include/linux/spinlock.h packages/compat/linux/current/include/linux/types.h
diffstat 4 files changed, 50 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/packages/compat/linux/current/ChangeLog
+++ b/packages/compat/linux/current/ChangeLog
@@ -1,3 +1,13 @@
+2004-08-12  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* include/linux/spinlock.h: Add CYG_UNUSED_PARAM() calls to avoid
+	compiler warnings.
+
+2004-08-04  Gary Thomas <gary@mlbassoc.com>
+
+	* include/linux/list.h (list_for_each_entry): New macro needed for
+	latest jffs2 code.
+
 2003-11-12  Thomas Koeller <thomas.koeller@baslerweb.com>
 
         * cdl/linux.cdl:
--- a/packages/compat/linux/current/include/linux/list.h
+++ b/packages/compat/linux/current/include/linux/list.h
@@ -63,6 +63,11 @@ struct list_head {
 
 /* MACROS */
 
+#define LIST_HEAD_INIT(name) { &(name), &(name) }
+
+#define LIST_HEAD(name) \
+        struct list_head name = LIST_HEAD_INIT(name)
+
 #define INIT_LIST_HEAD( _list_ )              \
 CYG_MACRO_START                               \
 (_list_)->next = (_list_)->prev = (_list_);   \
@@ -122,6 +127,15 @@ list_empty( struct list_head *list )
     (_ent_) != (_list_);                 \
     (_ent_) = (_ent_)->next )
 
+/*
+ * list_for_each_entry - this function can be use to iterate over all
+ * items in a list* _list_ with it's head at _head_ and link _item_
+ */
+#define list_for_each_entry(_list_, _head_, _item_)                     \
+for ((_list_) = list_entry((_head_)->next, typeof(*_list_), _item_); \
+     &((_list_)->_item_) != (_head_);                                 \
+     (_list_) = list_entry((_list_)->_item_.next, typeof(*_list_), _item_))
+
 /* -----------------------------------------------------------------------*/
 #endif /* #ifndef CYGONCE_FS_JFFS2_LIST_H */
 /* EOF list.h */
--- a/packages/compat/linux/current/include/linux/spinlock.h
+++ b/packages/compat/linux/current/include/linux/spinlock.h
@@ -4,10 +4,30 @@
 
 typedef struct { } spinlock_t;
 #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
-#define spin_lock_init(lock) do{} while (0)
-#define spin_lock(lock) do{} while (0)
-#define spin_unlock(lock) do{} while (0)
-#define spin_lock_bh(lock) do{} while (0)
-#define spin_unlock_bh(lock) do{} while (0)
+
+#define spin_lock_init(lock)             \
+CYG_MACRO_START;                         \
+CYG_UNUSED_PARAM(spinlock_t *, lock);    \
+CYG_MACRO_END
+
+#define spin_lock(lock)                  \
+CYG_MACRO_START;                         \
+CYG_UNUSED_PARAM(spinlock_t *, lock);    \
+CYG_MACRO_END
+
+#define spin_unlock(lock)                \
+CYG_MACRO_START;                         \
+CYG_UNUSED_PARAM(spinlock_t *, lock);    \
+CYG_MACRO_END
+
+#define spin_lock_bh(lock)               \
+CYG_MACRO_START;                         \
+CYG_UNUSED_PARAM(spinlock_t *, lock);    \
+CYG_MACRO_END
+
+#define spin_unlock_bh(lock)             \
+CYG_MACRO_START;                         \
+CYG_UNUSED_PARAM(spinlock_t *, lock);    \
+CYG_MACRO_END
 
 #endif /* __LINUX_SPINLOCK_H__ */
--- a/packages/compat/linux/current/include/linux/types.h
+++ b/packages/compat/linux/current/include/linux/types.h
@@ -8,5 +8,6 @@
 #define uint32_t cyg_uint32
 #define loff_t off_t
 
+#define kvec iovec
 #endif /* __LINUX_TYPES_H__ */