Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ff88f8a3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff88f8a3
编写于
7月 12, 2005
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use ei / di MIPS32 R2 instructions if available.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
1e5f1caa
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
85 addition
and
53 deletion
+85
-53
include/asm-mips/interrupt.h
include/asm-mips/interrupt.h
+85
-53
未找到文件。
include/asm-mips/interrupt.h
浏览文件 @
ff88f8a3
...
...
@@ -11,20 +11,25 @@
#ifndef _ASM_INTERRUPT_H
#define _ASM_INTERRUPT_H
#include <linux/config.h>
#include <asm/hazards.h>
__asm__
(
".macro
\t
local_irq_enable
\n\t
"
".set
\t
push
\n\t
"
".set
\t
reorder
\n\t
"
".set
\t
noat
\n\t
"
"mfc0
\t
$1,$12
\n\t
"
"ori
\t
$1,0x1f
\n\t
"
"xori
\t
$1,0x1e
\n\t
"
"mtc0
\t
$1,$12
\n\t
"
"irq_enable_hazard
\n\t
"
".set
\t
pop
\n\t
"
".endm"
);
" .macro local_irq_enable
\n
"
" .set push
\n
"
" .set reorder
\n
"
" .set noat
\n
"
#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
" ei
\n
"
#else
" mfc0 $1,$12
\n
"
" ori $1,0x1f
\n
"
" xori $1,0x1e
\n
"
" mtc0 $1,$12
\n
"
#endif
" irq_enable_hazard
\n
"
" .set pop
\n
"
" .endm"
);
static
inline
void
local_irq_enable
(
void
)
{
...
...
@@ -43,17 +48,21 @@ static inline void local_irq_enable(void)
* no nops at all.
*/
__asm__
(
".macro
\t
local_irq_disable
\n\t
"
".set
\t
push
\n\t
"
".set
\t
noat
\n\t
"
"mfc0
\t
$1,$12
\n\t
"
"ori
\t
$1,1
\n\t
"
"xori
\t
$1,1
\n\t
"
".set
\t
noreorder
\n\t
"
"mtc0
\t
$1,$12
\n\t
"
"irq_disable_hazard
\n\t
"
".set
\t
pop
\n\t
"
".endm"
);
" .macro local_irq_disable
\n
"
" .set push
\n
"
" .set noat
\n
"
#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
" di
\n
"
#else
" mfc0 $1,$12
\n
"
" ori $1,1
\n
"
" xori $1,1
\n
"
" .set noreorder
\n
"
" mtc0 $1,$12
\n
"
#endif
" irq_disable_hazard
\n
"
" .set pop
\n
"
" .endm
\n
"
);
static
inline
void
local_irq_disable
(
void
)
{
...
...
@@ -65,12 +74,12 @@ static inline void local_irq_disable(void)
}
__asm__
(
"
.macro
\t
local_save_flags flags
\n\t
"
"
.set
\t
push
\n\t
"
"
.set
\t
reorder
\n\t
"
"
mfc0
\t\\
flags, $12
\n\t
"
"
.set
\t
pop
\n\t
"
"
.endm
"
);
"
.macro local_save_flags flags
\n
"
"
.set push
\n
"
"
.set reorder
\n
"
"
mfc0
\\
flags, $12
\n
"
"
.set pop
\n
"
"
.endm
\n
"
);
#define local_save_flags(x) \
__asm__ __volatile__( \
...
...
@@ -78,18 +87,22 @@ __asm__ __volatile__( \
: "=r" (x))
__asm__
(
".macro
\t
local_irq_save result
\n\t
"
".set
\t
push
\n\t
"
".set
\t
reorder
\n\t
"
".set
\t
noat
\n\t
"
"mfc0
\t\\
result, $12
\n\t
"
"ori
\t
$1,
\\
result, 1
\n\t
"
"xori
\t
$1, 1
\n\t
"
".set
\t
noreorder
\n\t
"
"mtc0
\t
$1, $12
\n\t
"
"irq_disable_hazard
\n\t
"
".set
\t
pop
\n\t
"
".endm"
);
" .macro local_irq_save result
\n
"
" .set push
\n
"
" .set reorder
\n
"
" .set noat
\n
"
#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
" di
\\
result
\n
"
#else
" mfc0
\\
result, $12
\n
"
" ori $1,
\\
result, 1
\n
"
" xori $1, 1
\n
"
" .set noreorder
\n
"
" mtc0 $1, $12
\n
"
#endif
" irq_disable_hazard
\n
"
" .set pop
\n
"
" .endm
\n
"
);
#define local_irq_save(x) \
__asm__ __volatile__( \
...
...
@@ -99,19 +112,38 @@ __asm__ __volatile__( \
: "memory")
__asm__
(
".macro
\t
local_irq_restore flags
\n\t
"
".set
\t
noreorder
\n\t
"
".set
\t
noat
\n\t
"
"mfc0
\t
$1, $12
\n\t
"
"andi
\t\\
flags, 1
\n\t
"
"ori
\t
$1, 1
\n\t
"
"xori
\t
$1, 1
\n\t
"
"or
\t\\
flags, $1
\n\t
"
"mtc0
\t\\
flags, $12
\n\t
"
"irq_disable_hazard
\n\t
"
".set
\t
at
\n\t
"
".set
\t
reorder
\n\t
"
".endm"
);
" .macro local_irq_restore flags
\n
"
" .set noreorder
\n
"
" .set noat
\n
"
#if (defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)) && \
defined(CONFIG_IRQ_CPU)
/*
* Slow, but doesn't suffer from a relativly unlikely race
* condition we're having since days 1.
*/
" beqz
\\
flags, 1f
\n
"
" di
\n
"
" ei
\n
"
"1:
\n
"
#elif defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
/*
* Fast, dangerous. Life is fun, life is good.
*/
" mfc0 $1, $12
\n
"
" ins $1,
\\
flags, 0, 1
\n
"
" mtc0 $1, $12
\n
"
#else
" mfc0 $1, $12
\n
"
" andi
\\
flags, 1
\n
"
" ori $1, 1
\n
"
" xori $1, 1
\n
"
" or
\\
flags, $1
\n
"
" mtc0
\\
flags, $12
\n
"
#endif
" irq_disable_hazard
\n
"
" .set at
\n
"
" .set reorder
\n
"
" .endm
\n
"
);
#define local_irq_restore(flags) \
do { \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录