goprife@gmail.com 3b11805964 add jffs2 code (porting from ecos v3.0)
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1919 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-01-13 18:45:44 +00:00

21 lines
730 B
C

#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 <asm/semaphore.h>
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__