Chinaunix首页 | 论坛 | 博客
  • 博客访问: 244698
  • 博文数量: 32
  • 博客积分: 557
  • 博客等级: 中士
  • 技术积分: 431
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-20 23:05
文章分类

全部博文(32)

文章存档

2015年(4)

2014年(2)

2012年(4)

2011年(22)

分类: LINUX

2011-06-26 22:47:04

Understanding the Linux Kernel:

spinlock header file relationships:
阅读(4137) | 评论(13) | 转发(2) |
给主人留下些什么吧!~~

wangjianchangdx2011-06-26 23:43:19

/*
* include/linux/spinlock.h - generic spinlock/rwlock declarations
*
* here's the role of the various spinlock/rwlock related include files:
*
* on SMP builds:
*
*  asm/spinlock_types.h: contains the arch_spinlock_t/arch_rwlock_t and the
*                        initializers
*
*  linux/spinlock_types.h:
*&nbs

wangjianchangdx2011-06-26 23:25:06

include/linux/spinlock_types.h:
根据UP/SMP包含不同的头文件,
#if defined(CONFIG_SMP)
# include <asm/spinlock_types.h>
#else
# include <linux/spinlock_types_up.h>
#endif
好吧,有的跟了
#include <linux/lockdep.h>

wangjianchangdx2011-06-26 23:05:56

include/linux/semaphore.h:
#include <linux/list.h>
#include <linux/spinlock.h>  可见semaphore建立在spinlock的基础上

/* Please don't access any members of this structure directly */
struct semaphore {
        spinlock_t                lock;
        unsigned int                count;