Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
5a4f7c66
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看板
提交
5a4f7c66
编写于
11月 20, 2007
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: Share bug/debug traps across _32 and _64.
Signed-off-by:
N
Paul Mundt
<
lethal@linux-sh.org
>
上级
811d50cb
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
102 addition
and
89 deletion
+102
-89
arch/sh/kernel/Makefile_32
arch/sh/kernel/Makefile_32
+1
-1
arch/sh/kernel/Makefile_64
arch/sh/kernel/Makefile_64
+1
-1
arch/sh/kernel/cpu/sh2/entry.S
arch/sh/kernel/cpu/sh2/entry.S
+1
-1
arch/sh/kernel/process_32.c
arch/sh/kernel/process_32.c
+0
-46
arch/sh/kernel/process_64.c
arch/sh/kernel/process_64.c
+6
-9
arch/sh/kernel/traps.c
arch/sh/kernel/traps.c
+66
-0
arch/sh/kernel/traps_32.c
arch/sh/kernel/traps_32.c
+1
-24
include/asm-sh/ptrace.h
include/asm-sh/ptrace.h
+1
-1
include/asm-sh/system.h
include/asm-sh/system.h
+19
-6
include/asm-sh/types.h
include/asm-sh/types.h
+6
-0
未找到文件。
arch/sh/kernel/Makefile_32
浏览文件 @
5a4f7c66
...
...
@@ -6,7 +6,7 @@ extra-y := head_32.o init_task.o vmlinux.lds
obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process_32.o \
ptrace_32.o semaphore.o setup.o signal_32.o sys_sh.o sys_sh32.o \
syscalls_32.o time.o topology.o traps_32.o
syscalls_32.o time.o topology.o traps
.o traps
_32.o
obj-y += cpu/ timers/
obj-$(CONFIG_VSYSCALL) += vsyscall/
...
...
arch/sh/kernel/Makefile_64
浏览文件 @
5a4f7c66
...
...
@@ -2,7 +2,7 @@ extra-y := head_64.o init_task.o vmlinux.lds
obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process_64.o \
ptrace_64.o semaphore.o setup.o signal_64.o sys_sh.o sys_sh64.o \
syscalls_64.o time.o topology.o traps_64.o
syscalls_64.o time.o topology.o traps
.o traps
_64.o
obj-y += cpu/ timers/
obj-$(CONFIG_VSYSCALL) += vsyscall/
...
...
arch/sh/kernel/cpu/sh2/entry.S
浏览文件 @
5a4f7c66
...
...
@@ -250,7 +250,7 @@ ENTRY(sh_bios_handler)
1
:
.
long
gdb_vbr_vector
#endif /* CONFIG_SH_STANDARD_BIOS */
ENTRY
(
address_error_handler
)
ENTRY
(
address_error_
trap_
handler
)
mov
r15
,
r4
!
regs
add
#
4
,
r4
mov
#
OFF_PC
,
r0
...
...
arch/sh/kernel/process_32.c
浏览文件 @
5a4f7c66
...
...
@@ -482,49 +482,3 @@ asmlinkage void break_point_trap(void)
force_sig
(
SIGTRAP
,
current
);
}
/*
* Generic trap handler.
*/
asmlinkage
void
debug_trap_handler
(
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
,
struct
pt_regs
__regs
)
{
struct
pt_regs
*
regs
=
RELOC_HIDE
(
&
__regs
,
0
);
/* Rewind */
regs
->
pc
-=
instruction_size
(
ctrl_inw
(
regs
->
pc
-
4
));
if
(
notify_die
(
DIE_TRAP
,
"debug trap"
,
regs
,
0
,
regs
->
tra
&
0xff
,
SIGTRAP
)
==
NOTIFY_STOP
)
return
;
force_sig
(
SIGTRAP
,
current
);
}
/*
* Special handler for BUG() traps.
*/
asmlinkage
void
bug_trap_handler
(
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
,
struct
pt_regs
__regs
)
{
struct
pt_regs
*
regs
=
RELOC_HIDE
(
&
__regs
,
0
);
/* Rewind */
regs
->
pc
-=
instruction_size
(
ctrl_inw
(
regs
->
pc
-
4
));
if
(
notify_die
(
DIE_TRAP
,
"bug trap"
,
regs
,
0
,
TRAPA_BUG_OPCODE
&
0xff
,
SIGTRAP
)
==
NOTIFY_STOP
)
return
;
#ifdef CONFIG_BUG
if
(
__kernel_text_address
(
instruction_pointer
(
regs
)))
{
u16
insn
=
*
(
u16
*
)
instruction_pointer
(
regs
);
if
(
insn
==
TRAPA_BUG_OPCODE
)
handle_BUG
(
regs
);
}
#endif
force_sig
(
SIGTRAP
,
current
);
}
arch/sh/kernel/process_64.c
浏览文件 @
5a4f7c66
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
* arch/sh/kernel/process_64.c
*
*
arch/sh64/kernel/process.c
*
This file handles the architecture-dependent parts of process handling..
*
* Copyright (C) 2000, 2001 Paolo Alberelli
* Copyright (C) 2003 Paul Mundt
* Copyright (C) 2003
- 2007
Paul Mundt
* Copyright (C) 2003, 2004 Richard Curnow
*
* Started from SH3/4 version:
...
...
@@ -15,10 +13,9 @@
* In turn started from i386 version:
* Copyright (C) 1995 Linus Torvalds
*
*/
/*
* This file handles the architecture-dependent parts of process handling..
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/mm.h>
#include <linux/fs.h>
...
...
arch/sh/kernel/traps.c
0 → 100644
浏览文件 @
5a4f7c66
#include <linux/bug.h>
#include <linux/io.h>
#include <linux/types.h>
#include <linux/kdebug.h>
#include <asm/system.h>
#ifdef CONFIG_BUG
static
void
handle_BUG
(
struct
pt_regs
*
regs
)
{
enum
bug_trap_type
tt
;
tt
=
report_bug
(
regs
->
pc
,
regs
);
if
(
tt
==
BUG_TRAP_TYPE_WARN
)
{
regs
->
pc
+=
instruction_size
(
regs
->
pc
);
return
;
}
die
(
"Kernel BUG"
,
regs
,
TRAPA_BUG_OPCODE
&
0xff
);
}
int
is_valid_bugaddr
(
unsigned
long
addr
)
{
return
addr
>=
PAGE_OFFSET
;
}
#endif
/*
* Generic trap handler.
*/
BUILD_TRAP_HANDLER
(
debug
)
{
TRAP_HANDLER_DECL
;
/* Rewind */
regs
->
pc
-=
instruction_size
(
ctrl_inw
(
regs
->
pc
-
4
));
if
(
notify_die
(
DIE_TRAP
,
"debug trap"
,
regs
,
0
,
vec
&
0xff
,
SIGTRAP
)
==
NOTIFY_STOP
)
return
;
force_sig
(
SIGTRAP
,
current
);
}
/*
* Special handler for BUG() traps.
*/
BUILD_TRAP_HANDLER
(
bug
)
{
TRAP_HANDLER_DECL
;
/* Rewind */
regs
->
pc
-=
instruction_size
(
ctrl_inw
(
regs
->
pc
-
4
));
if
(
notify_die
(
DIE_TRAP
,
"bug trap"
,
regs
,
0
,
TRAPA_BUG_OPCODE
&
0xff
,
SIGTRAP
)
==
NOTIFY_STOP
)
return
;
#ifdef CONFIG_BUG
if
(
__kernel_text_address
(
instruction_pointer
(
regs
)))
{
opcode_t
insn
=
*
(
opcode_t
*
)
instruction_pointer
(
regs
);
if
(
insn
==
TRAPA_BUG_OPCODE
)
handle_BUG
(
regs
);
}
#endif
force_sig
(
SIGTRAP
,
current
);
}
arch/sh/kernel/traps_32.c
浏览文件 @
5a4f7c66
...
...
@@ -837,10 +837,6 @@ void *set_exception_table_vec(unsigned int vec, void *handler)
return
old_handler
;
}
extern
asmlinkage
void
address_error_handler
(
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
,
struct
pt_regs
__regs
);
void
__init
trap_init
(
void
)
{
set_exception_table_vec
(
TRAP_RESERVED_INST
,
do_reserved_inst
);
...
...
@@ -866,7 +862,7 @@ void __init trap_init(void)
#endif
#ifdef CONFIG_CPU_SH2
set_exception_table_vec
(
TRAP_ADDRESS_ERROR
,
address_error_handler
);
set_exception_table_vec
(
TRAP_ADDRESS_ERROR
,
address_error_
trap_
handler
);
#endif
#ifdef CONFIG_CPU_SH2A
set_exception_table_vec
(
TRAP_DIVZERO_ERROR
,
do_divide_error
);
...
...
@@ -877,25 +873,6 @@ void __init trap_init(void)
per_cpu_trap_init
();
}
#ifdef CONFIG_BUG
void
handle_BUG
(
struct
pt_regs
*
regs
)
{
enum
bug_trap_type
tt
;
tt
=
report_bug
(
regs
->
pc
,
regs
);
if
(
tt
==
BUG_TRAP_TYPE_WARN
)
{
regs
->
pc
+=
2
;
return
;
}
die
(
"Kernel BUG"
,
regs
,
TRAPA_BUG_OPCODE
&
0xff
);
}
int
is_valid_bugaddr
(
unsigned
long
addr
)
{
return
addr
>=
PAGE_OFFSET
;
}
#endif
void
show_trace
(
struct
task_struct
*
tsk
,
unsigned
long
*
sp
,
struct
pt_regs
*
regs
)
{
...
...
include/asm-sh/ptrace.h
浏览文件 @
5a4f7c66
...
...
@@ -95,7 +95,7 @@ struct pt_dspregs {
#include <asm/addrspace.h>
#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
#define instruction_pointer(regs) ((regs)->pc)
#define instruction_pointer(regs) ((
unsigned long)(
regs)->pc)
extern
void
show_regs
(
struct
pt_regs
*
);
...
...
include/asm-sh/system.h
浏览文件 @
5a4f7c66
...
...
@@ -185,12 +185,25 @@ void default_idle(void);
void
per_cpu_trap_init
(
void
);
asmlinkage
void
break_point_trap
(
void
);
asmlinkage
void
debug_trap_handler
(
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
,
struct
pt_regs
__regs
);
asmlinkage
void
bug_trap_handler
(
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
,
struct
pt_regs
__regs
);
#ifdef CONFIG_SUPERH32
#define BUILD_TRAP_HANDLER(name) \
asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
unsigned long r6, unsigned long r7, \
struct pt_regs __regs)
#define TRAP_HANDLER_DECL \
struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \
unsigned int vec = regs->tra;
#else
#define BUILD_TRAP_HANDLER(name) \
asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
#define TRAP_HANDLER_DECL
#endif
BUILD_TRAP_HANDLER
(
address_error
);
BUILD_TRAP_HANDLER
(
debug
);
BUILD_TRAP_HANDLER
(
bug
);
#define arch_align_stack(x) (x)
...
...
include/asm-sh/types.h
浏览文件 @
5a4f7c66
...
...
@@ -52,6 +52,12 @@ typedef unsigned long long u64;
typedef
u32
dma_addr_t
;
#ifdef CONFIG_SUPERH32
typedef
u16
opcode_t
;
#else
typedef
u32
opcode_t
;
#endif
#endif
/* __ASSEMBLY__ */
#endif
/* __KERNEL__ */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录