Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openthos
linux
提交
6d9c5d94
L
linux
项目概览
openthos
/
linux
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6d9c5d94
编写于
4月 21, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge
rsync://rsync.kernel.org/pub/linux/kernel/people/davem/sparc-2.6.git
上级
858eaca1
489ec5f5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
17 deletion
+31
-17
include/asm-sparc64/spinlock.h
include/asm-sparc64/spinlock.h
+31
-17
未找到文件。
include/asm-sparc64/spinlock.h
浏览文件 @
6d9c5d94
...
...
@@ -31,15 +31,20 @@
#ifndef CONFIG_DEBUG_SPINLOCK
typedef
unsigned
char
spinlock_t
;
#define SPIN_LOCK_UNLOCKED 0
typedef
struct
{
volatile
unsigned
char
lock
;
#ifdef CONFIG_PREEMPT
unsigned
int
break_lock
;
#endif
}
spinlock_t
;
#define SPIN_LOCK_UNLOCKED (spinlock_t) {0,}
#define spin_lock_init(l
ock) (*((unsigned char *)(lock)) =
0)
#define spin_is_locked(l
ock) (*((volatile unsigned char *)(lock))
!= 0)
#define spin_lock_init(l
p) do { *(lp)= SPIN_LOCK_UNLOCKED; } while(
0)
#define spin_is_locked(l
p) ((lp)->lock
!= 0)
#define spin_unlock_wait(l
ock
) \
#define spin_unlock_wait(l
p
) \
do { membar("#LoadLoad"); \
} while(
*((volatile unsigned char *)lock)
)
} while(
lp->lock
)
static
inline
void
_raw_spin_lock
(
spinlock_t
*
lock
)
{
...
...
@@ -109,20 +114,19 @@ static inline void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags)
#else
/* !(CONFIG_DEBUG_SPINLOCK) */
typedef
struct
{
unsigned
char
lock
;
volatile
unsigned
char
lock
;
unsigned
int
owner_pc
,
owner_cpu
;
#ifdef CONFIG_PREEMPT
unsigned
int
break_lock
;
#endif
}
spinlock_t
;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 0, 0xff }
#define spin_lock_init(__lock) \
do { (__lock)->lock = 0; \
(__lock)->owner_pc = 0; \
(__lock)->owner_cpu = 0xff; \
} while(0)
#define spin_is_locked(__lock) (*((volatile unsigned char *)(&((__lock)->lock))) != 0)
#define spin_lock_init(lp) do { *(lp)= SPIN_LOCK_UNLOCKED; } while(0)
#define spin_is_locked(__lock) ((__lock)->lock != 0)
#define spin_unlock_wait(__lock) \
do { \
membar("#LoadLoad"); \
} while(
*((volatile unsigned char *)(&((__lock)->lock)))
)
} while(
(__lock)->lock
)
extern
void
_do_spin_lock
(
spinlock_t
*
lock
,
char
*
str
);
extern
void
_do_spin_unlock
(
spinlock_t
*
lock
);
...
...
@@ -139,8 +143,13 @@ extern int _do_spin_trylock (spinlock_t *lock);
#ifndef CONFIG_DEBUG_SPINLOCK
typedef
unsigned
int
rwlock_t
;
#define RW_LOCK_UNLOCKED 0
typedef
struct
{
volatile
unsigned
int
lock
;
#ifdef CONFIG_PREEMPT
unsigned
int
break_lock
;
#endif
}
rwlock_t
;
#define RW_LOCK_UNLOCKED {0,}
#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
static
void
inline
__read_lock
(
rwlock_t
*
lock
)
...
...
@@ -251,9 +260,12 @@ static int inline __write_trylock(rwlock_t *lock)
#else
/* !(CONFIG_DEBUG_SPINLOCK) */
typedef
struct
{
unsigned
long
lock
;
volatile
unsigned
long
lock
;
unsigned
int
writer_pc
,
writer_cpu
;
unsigned
int
reader_pc
[
NR_CPUS
];
#ifdef CONFIG_PREEMPT
unsigned
int
break_lock
;
#endif
}
rwlock_t
;
#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { } }
#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
...
...
@@ -304,6 +316,8 @@ do { unsigned long flags; \
#endif
/* CONFIG_DEBUG_SPINLOCK */
#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
#define read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
#define write_can_lock(rw) (!(rw)->lock)
#endif
/* !(__ASSEMBLY__) */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录