Transplantation of Uclinux-2008r1-rc8 (bf561) to VDSP5 (+): raw_rwlock_t

Source: Internet
Author: User

Since Uclinux does not support SMP, there is no such definition for raw_rwlock_t, which requires adding this definition to include/asm/spinlock_types.h:

typedef struct {
     volatile testset_t lock;
} raw_rwlock_t;

#define __RAW_RW_LOCK_UNLOCKED { 0 }

Then add the associated actions in the 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);
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.