uclinux-2008R1-RC8(bf561)到VDSP5的移植(46): raw_rwlock_t

 
由于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);
}

你可能感兴趣的:(uclinux-2008R1-RC8(bf561)到VDSP5的移植(46): raw_rwlock_t)