Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
4ffd8b38
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4ffd8b38
编写于
11月 30, 2006
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MIPS] Remove userspace proofing from <asm/bitops.h>.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
e303e088
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
42 deletion
+21
-42
include/asm-mips/bitops.h
include/asm-mips/bitops.h
+21
-42
未找到文件。
include/asm-mips/bitops.h
浏览文件 @
4ffd8b38
...
...
@@ -10,10 +10,13 @@
#define _ASM_BITOPS_H
#include <linux/compiler.h>
#include <linux/irqflags.h>
#include <linux/types.h>
#include <asm/bug.h>
#include <asm/byteorder.h>
/* sigh ... */
#include <asm/cpu-features.h>
#include <asm/sgidefs.h>
#include <asm/war.h>
#if (_MIPS_SZLONG == 32)
#define SZLONG_LOG 5
...
...
@@ -29,32 +32,12 @@
#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x))
#endif
#ifdef __KERNEL__
#include <linux/irqflags.h>
#include <asm/sgidefs.h>
#include <asm/war.h>
/*
* clear_bit() doesn't provide any barrier for the compiler.
*/
#define smp_mb__before_clear_bit() smp_mb()
#define smp_mb__after_clear_bit() smp_mb()
/*
* Only disable interrupt for kernel mode stuff to keep usermode stuff
* that dares to use kernel include files alive.
*/
#define __bi_flags unsigned long flags
#define __bi_local_irq_save(x) local_irq_save(x)
#define __bi_local_irq_restore(x) local_irq_restore(x)
#else
#define __bi_flags
#define __bi_local_irq_save(x)
#define __bi_local_irq_restore(x)
#endif
/* __KERNEL__ */
/*
* set_bit - Atomically set a bit in memory
* @nr: the bit to set
...
...
@@ -93,13 +76,13 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
}
else
{
volatile
unsigned
long
*
a
=
addr
;
unsigned
long
mask
;
__bi_
flags
;
unsigned
long
flags
;
a
+=
nr
>>
SZLONG_LOG
;
mask
=
1UL
<<
(
nr
&
SZLONG_MASK
);
__bi_
local_irq_save
(
flags
);
local_irq_save
(
flags
);
*
a
|=
mask
;
__bi_
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
}
}
...
...
@@ -141,13 +124,13 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
}
else
{
volatile
unsigned
long
*
a
=
addr
;
unsigned
long
mask
;
__bi_
flags
;
unsigned
long
flags
;
a
+=
nr
>>
SZLONG_LOG
;
mask
=
1UL
<<
(
nr
&
SZLONG_MASK
);
__bi_
local_irq_save
(
flags
);
local_irq_save
(
flags
);
*
a
&=
~
mask
;
__bi_
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
}
}
...
...
@@ -191,13 +174,13 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
}
else
{
volatile
unsigned
long
*
a
=
addr
;
unsigned
long
mask
;
__bi_
flags
;
unsigned
long
flags
;
a
+=
nr
>>
SZLONG_LOG
;
mask
=
1UL
<<
(
nr
&
SZLONG_MASK
);
__bi_
local_irq_save
(
flags
);
local_irq_save
(
flags
);
*
a
^=
mask
;
__bi_
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
}
}
...
...
@@ -258,14 +241,14 @@ static inline int test_and_set_bit(unsigned long nr,
volatile
unsigned
long
*
a
=
addr
;
unsigned
long
mask
;
int
retval
;
__bi_
flags
;
unsigned
long
flags
;
a
+=
nr
>>
SZLONG_LOG
;
mask
=
1UL
<<
(
nr
&
SZLONG_MASK
);
__bi_
local_irq_save
(
flags
);
local_irq_save
(
flags
);
retval
=
(
mask
&
*
a
)
!=
0
;
*
a
|=
mask
;
__bi_
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
return
retval
;
}
...
...
@@ -330,14 +313,14 @@ static inline int test_and_clear_bit(unsigned long nr,
volatile
unsigned
long
*
a
=
addr
;
unsigned
long
mask
;
int
retval
;
__bi_
flags
;
unsigned
long
flags
;
a
+=
nr
>>
SZLONG_LOG
;
mask
=
1UL
<<
(
nr
&
SZLONG_MASK
);
__bi_
local_irq_save
(
flags
);
local_irq_save
(
flags
);
retval
=
(
mask
&
*
a
)
!=
0
;
*
a
&=
~
mask
;
__bi_
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
return
retval
;
}
...
...
@@ -399,23 +382,19 @@ static inline int test_and_change_bit(unsigned long nr,
}
else
{
volatile
unsigned
long
*
a
=
addr
;
unsigned
long
mask
,
retval
;
__bi_
flags
;
unsigned
long
flags
;
a
+=
nr
>>
SZLONG_LOG
;
mask
=
1UL
<<
(
nr
&
SZLONG_MASK
);
__bi_
local_irq_save
(
flags
);
local_irq_save
(
flags
);
retval
=
(
mask
&
*
a
)
!=
0
;
*
a
^=
mask
;
__bi_
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
return
retval
;
}
}
#undef __bi_flags
#undef __bi_local_irq_save
#undef __bi_local_irq_restore
#include <asm-generic/bitops/non-atomic.h>
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录