由于uclinux不支持smp,因此也没有raw_rwlock_t这样的定义,为此需要在include/asm/spinlock_types.h中添加此定义:
typedef
struct {
volatile testset_t lock;
} raw_rwlock_t;
#define
__RAW_RW_LOCK_UNLOCKED { 0 }
然后在include/asm/spinlock_types.h中添加相关的操作:
static
inline void __raw_read_lock(raw_rwlock_t *rw)
{
adi_acquire_lock(&rw->lock);
}
static
inline void __raw_read_unlock(raw_rwlock_t *rw)
{
adi_release_lock(&rw->lock);
}
static
inline void __raw_write_lock(raw_rwlock_t *rw)
{
adi_acquire_lock(&rw->lock);
}
static
inline void __raw_write_unlock(raw_rwlock_t *rw)
{
adi_release_lock(&rw->lock);
}