Transplantation of Uclinux-2008r1-rc8 (bf561) to VDSP5 (est.): Spinlock_types.h

Source: Internet
Author: User
Tags volatile

To support multi-core, a macro is defined in Config.h:

#define CONFIG_SMP 1

After you define a macro, you are prompted to not find Asm/spinlock_types.h, which is used to define two structures and two macros, as follows:

#ifndef __ASM_SPINLOCK_TYPES_H
#define __ASM_SPINLOCK_TYPES_H

#ifndef __LINUX_SPINLOCK_TYPES_H
# error "please don't include this file directly"
#endif

typedef struct {
     volatile unsigned int lock;
} raw_spinlock_t;

#define __RAW_SPIN_LOCK_UNLOCKED { 0 }

typedef struct {
     volatile unsigned int lock;
} raw_rwlock_t;

#define __RAW_RW_LOCK_UNLOCKED { 0 }

#endif

Here, because I don't know the exact meaning of __raw_spin_lock_unlocked and __raw_rw_lock_unlocked, we first define it as 0, and LOCK seems to be defined as the type of testset_t, for the time being.

Of course, since Uclinux does not support SMP, this file must be created by hand and placed in the Include/asm directory.

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.