Index: compat/linux/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/compat/linux/current/ChangeLog,v retrieving revision 1.6 diff -u -r1.6 ChangeLog --- compat/linux/current/ChangeLog 12 Aug 2004 21:32:39 -0000 1.6 +++ compat/linux/current/ChangeLog 22 Jan 2005 16:49:24 -0000 @@ -1,3 +1,11 @@ +2005-01-22 Andrew Lunn + + * include/linux/spinlock.h (DEFINE_SPINLOCK): Added. + * include/linux/slab.h (vfree): Added vmalloc and vfree which map + to malloc and free. + * include/linux/rwsem.h: New file. eCos does not have read/write + semaphores so these are mapped to normal semaphores. + 2004-08-12 Andrew Lunn * include/linux/spinlock.h: Add CYG_UNUSED_PARAM() calls to avoid Index: compat/linux/current/include/linux/rwsem.h =================================================================== RCS file: compat/linux/current/include/linux/rwsem.h diff -N compat/linux/current/include/linux/rwsem.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ compat/linux/current/include/linux/rwsem.h 22 Jan 2005 16:49:24 -0000 @@ -0,0 +1,20 @@ +#ifndef __LINUX_RWSEM_H__ +#define __LINUX_RWSEM_H__ + +// eCos does not have the concept of a read/write semaphore. So just +// map them onto normal semaphores and hope we don't deadlock +// somewhere. + +#include + +struct rw_semaphore; + +#define down_read(sem) cyg_drv_mutex_lock((cyg_drv_mutex_t *)sem) +#define down_read_trylock(sem) cyg_drv_mutex_trylock((cyg_drv_mutex_t *)sem) +#define down_write(sem) cyg_drv_mutex_lock((cyg_drv_mutex_t *)sem) +#define down_write_trylock(sem) cyg_drv_mutex_trylock((cyg_drv_mutex_t *)sem) +#define up_read(sem) cyg_drv_mutex_unlock((cyg_drv_mutex_t *)sem) +#define up_write(sem) cyg_drv_mutex_unlock((cyg_drv_mutex_t *)sem) +#define downgrade_write(sem) + +#endif // __LINUX_RWSEM_H__ Index: compat/linux/current/include/linux/slab.h =================================================================== RCS file: /cvs/ecos/ecos/packages/compat/linux/current/include/linux/slab.h,v retrieving revision 1.1 diff -u -r1.1 slab.h --- compat/linux/current/include/linux/slab.h 22 Jan 2003 01:10:41 -0000 1.1 +++ compat/linux/current/include/linux/slab.h 22 Jan 2005 16:49:24 -0000 @@ -7,6 +7,8 @@ #define kmalloc(x, y) malloc(x) #define kfree(x) free(x) +#define vmalloc(x) malloc(x) +#define vfree(x) free(x) #endif /* __LINUX_SLAB_H__ */ Index: compat/linux/current/include/linux/spinlock.h =================================================================== RCS file: /cvs/ecos/ecos/packages/compat/linux/current/include/linux/spinlock.h,v retrieving revision 1.2 diff -u -r1.2 spinlock.h --- compat/linux/current/include/linux/spinlock.h 12 Aug 2004 21:32:40 -0000 1.2 +++ compat/linux/current/include/linux/spinlock.h 22 Jan 2005 16:49:24 -0000 @@ -4,6 +4,7 @@ typedef struct { } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { } +#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED #define spin_lock_init(lock) \ CYG_MACRO_START; \