Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
4bb73c3d
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看板
提交
4bb73c3d
编写于
5月 26, 2009
作者:
M
Michal Simek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
microblaze_mmu_v2: Add MMU related exceptions handling
Signed-off-by:
N
Michal Simek
<
monstr@monstr.eu
>
上级
0d6de953
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
37 addition
and
8 deletion
+37
-8
arch/microblaze/kernel/exceptions.c
arch/microblaze/kernel/exceptions.c
+37
-8
未找到文件。
arch/microblaze/kernel/exceptions.c
浏览文件 @
4bb73c3d
...
...
@@ -21,9 +21,9 @@
#include <asm/exceptions.h>
#include <asm/entry.h>
/* For KM CPU var */
#include <
asm
/uaccess.h>
#include <
asm
/errno.h>
#include <
asm
/ptrace.h>
#include <
linux
/uaccess.h>
#include <
linux
/errno.h>
#include <
linux
/ptrace.h>
#include <asm/current.h>
#define MICROBLAZE_ILL_OPCODE_EXCEPTION 0x02
...
...
@@ -31,7 +31,7 @@
#define MICROBLAZE_DBUS_EXCEPTION 0x04
#define MICROBLAZE_DIV_ZERO_EXCEPTION 0x05
#define MICROBLAZE_FPU_EXCEPTION 0x06
#define MICROBLAZE_PRIVILEG_EXCEPTION 0x07
#define MICROBLAZE_PRIVILEG
ED
_EXCEPTION 0x07
static
DEFINE_SPINLOCK
(
die_lock
);
...
...
@@ -66,6 +66,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
asmlinkage
void
full_exception
(
struct
pt_regs
*
regs
,
unsigned
int
type
,
int
fsr
,
int
addr
)
{
#ifdef CONFIG_MMU
int
code
;
addr
=
regs
->
pc
;
#endif
#if 0
printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n",
type, user_mode(regs) ? "user" : "kernel", fsr,
...
...
@@ -74,7 +79,13 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
switch
(
type
&
0x1F
)
{
case
MICROBLAZE_ILL_OPCODE_EXCEPTION
:
if
(
user_mode
(
regs
))
{
printk
(
KERN_WARNING
"Illegal opcode exception in user mode.
\n
"
);
_exception
(
SIGILL
,
regs
,
ILL_ILLOPC
,
addr
);
return
;
}
printk
(
KERN_WARNING
"Illegal opcode exception in kernel mode.
\n
"
);
die
(
"opcode exception"
,
regs
,
SIGBUS
);
break
;
case
MICROBLAZE_IBUS_EXCEPTION
:
if
(
user_mode
(
regs
))
{
...
...
@@ -95,11 +106,16 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
die
(
"bus exception"
,
regs
,
SIGBUS
);
break
;
case
MICROBLAZE_DIV_ZERO_EXCEPTION
:
printk
(
KERN_WARNING
"Divide by zero exception
\n
"
);
if
(
user_mode
(
regs
))
{
printk
(
KERN_WARNING
"Divide by zero exception in user mode
\n
"
);
_exception
(
SIGILL
,
regs
,
ILL_ILLOPC
,
addr
);
return
;
}
printk
(
KERN_WARNING
"Divide by zero exception in kernel mode.
\n
"
);
die
(
"Divide by exception"
,
regs
,
SIGBUS
);
break
;
case
MICROBLAZE_FPU_EXCEPTION
:
printk
(
KERN_WARNING
"FPU exception
\n
"
);
/* IEEE FP exception */
/* I removed fsr variable and use code var for storing fsr */
if
(
fsr
&
FSR_IO
)
...
...
@@ -115,7 +131,20 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
_exception
(
SIGFPE
,
regs
,
fsr
,
addr
);
break
;
#ifdef CONFIG_MMU
case
MICROBLAZE_PRIVILEGED_EXCEPTION
:
printk
(
KERN_WARNING
"Privileged exception
\n
"
);
/* "brk r0,r0" - used as debug breakpoint */
if
(
get_user
(
code
,
(
unsigned
long
*
)
regs
->
pc
)
==
0
&&
code
==
0x980c0000
)
{
_exception
(
SIGTRAP
,
regs
,
TRAP_BRKPT
,
addr
);
}
else
{
_exception
(
SIGILL
,
regs
,
ILL_PRVOPC
,
addr
);
}
break
;
#endif
default:
/* FIXME what to do in unexpected exception */
printk
(
KERN_WARNING
"Unexpected exception %02x "
"PC=%08x in %s mode
\n
"
,
type
,
(
unsigned
int
)
addr
,
kernel_mode
(
regs
)
?
"kernel"
:
"user"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录