Chinaunix首页 | 论坛 | 博客
  • 博客访问: 565247
  • 博文数量: 70
  • 博客积分: 3736
  • 博客等级: 中校
  • 技术积分: 1728
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-08 09:15
文章分类
文章存档

2014年(1)

2012年(21)

2011年(7)

2010年(28)

2009年(13)

分类: LINUX

2009-12-16 13:40:30

linux-2.6.16.RT.x
如果定义了CONFIG_PREEMPT_RT,那么
struct semaphore {
    atomic_t count;
    struct rt_mutex lock;
};
struct compat_semaphore {
    atomic_t count;
    int sleepers;
    wait_queue_head_t wait;
};
如果没有定义CONFIG_PREEMPT_RT,那么
# define semaphore compat_semaphore
struct compat_semaphore {
    atomic_t count;
    int sleepers;
    wait_queue_head_t wait;
};


linux-2.6.29.RT.x
如果定义了CONFIG_PREEMPT_RT,那么
struct semaphore {
    atomic_t        count;
    struct rt_mutex        lock;
};
#define DECLARE_MUTEX(name) \
struct semaphore name = \
    { .count = { 1 }, .lock = __RT_MUTEX_INITIALIZER(name.lock) }
#define DECLARE_MUTEX_LOCKED(name) \
struct semaphore name = \
    { .count = { 0 }, .lock = __RT_MUTEX_INITIALIZER(name.lock) }

struct compat_semaphore {
    spinlock_t        lock;
    unsigned int        count;
    struct list_head    wait_list;
};
如果没有定义CONFIG_PREEMPT_RT,那么:
没有对semaphore的相关定义
#define compat_semaphore semaphore
因而也没有对compat_semaphore的相关定义
阅读(2066) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~