Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
7d2f551f
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7d2f551f
编写于
10月 06, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
restore 32bit aout coredump
just getting rid of bitrot Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0f6ed63b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
34 deletion
+36
-34
arch/x86/ia32/ia32_aout.c
arch/x86/ia32/ia32_aout.c
+36
-34
未找到文件。
arch/x86/ia32/ia32_aout.c
浏览文件 @
7d2f551f
...
...
@@ -25,6 +25,7 @@
#include <linux/personality.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/perf_event.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
...
...
@@ -33,14 +34,18 @@
#include <asm/ia32.h>
#undef WARN_OLD
#undef CORE_DUMP
/* definitely broken */
static
int
load_aout_binary
(
struct
linux_binprm
*
);
static
int
load_aout_library
(
struct
file
*
);
#ifdef CORE_DUMP
static
int
aout_core_dump
(
long
signr
,
struct
pt_regs
*
regs
,
struct
file
*
file
,
unsigned
long
limit
);
#ifdef CONFIG_COREDUMP
static
int
aout_core_dump
(
struct
coredump_params
*
);
static
unsigned
long
get_dr
(
int
n
)
{
struct
perf_event
*
bp
=
current
->
thread
.
ptrace_bps
[
n
];
return
bp
?
bp
->
hw
.
info
.
address
:
0
;
}
/*
* fill in the user structure for a core dump..
...
...
@@ -48,6 +53,7 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file,
static
void
dump_thread32
(
struct
pt_regs
*
regs
,
struct
user32
*
dump
)
{
u32
fs
,
gs
;
memset
(
dump
,
0
,
sizeof
(
*
dump
));
/* changed the size calculations - should hopefully work better. lbt */
dump
->
magic
=
CMAGIC
;
...
...
@@ -57,15 +63,12 @@ static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
dump
->
u_dsize
=
((
unsigned
long
)
(
current
->
mm
->
brk
+
(
PAGE_SIZE
-
1
)))
>>
PAGE_SHIFT
;
dump
->
u_dsize
-=
dump
->
u_tsize
;
dump
->
u_ssize
=
0
;
dump
->
u_debugreg
[
0
]
=
current
->
thread
.
debugreg0
;
dump
->
u_debugreg
[
1
]
=
current
->
thread
.
debugreg1
;
dump
->
u_debugreg
[
2
]
=
current
->
thread
.
debugreg2
;
dump
->
u_debugreg
[
3
]
=
current
->
thread
.
debugreg3
;
dump
->
u_debugreg
[
4
]
=
0
;
dump
->
u_debugreg
[
5
]
=
0
;
dump
->
u_debugreg
[
0
]
=
get_dr
(
0
);
dump
->
u_debugreg
[
1
]
=
get_dr
(
1
);
dump
->
u_debugreg
[
2
]
=
get_dr
(
2
);
dump
->
u_debugreg
[
3
]
=
get_dr
(
3
);
dump
->
u_debugreg
[
6
]
=
current
->
thread
.
debugreg6
;
dump
->
u_debugreg
[
7
]
=
current
->
thread
.
debugreg
7
;
dump
->
u_debugreg
[
7
]
=
current
->
thread
.
ptrace_dr
7
;
if
(
dump
->
start_stack
<
0xc0000000
)
{
unsigned
long
tmp
;
...
...
@@ -74,24 +77,24 @@ static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
dump
->
u_ssize
=
tmp
>>
PAGE_SHIFT
;
}
dump
->
regs
.
bx
=
regs
->
bx
;
dump
->
regs
.
cx
=
regs
->
cx
;
dump
->
regs
.
dx
=
regs
->
dx
;
dump
->
regs
.
si
=
regs
->
si
;
dump
->
regs
.
di
=
regs
->
di
;
dump
->
regs
.
bp
=
regs
->
bp
;
dump
->
regs
.
ax
=
regs
->
ax
;
dump
->
regs
.
e
bx
=
regs
->
bx
;
dump
->
regs
.
e
cx
=
regs
->
cx
;
dump
->
regs
.
e
dx
=
regs
->
dx
;
dump
->
regs
.
e
si
=
regs
->
si
;
dump
->
regs
.
e
di
=
regs
->
di
;
dump
->
regs
.
e
bp
=
regs
->
bp
;
dump
->
regs
.
e
ax
=
regs
->
ax
;
dump
->
regs
.
ds
=
current
->
thread
.
ds
;
dump
->
regs
.
es
=
current
->
thread
.
es
;
savesegment
(
fs
,
fs
);
dump
->
regs
.
fs
=
fs
;
savesegment
(
gs
,
gs
);
dump
->
regs
.
gs
=
gs
;
dump
->
regs
.
orig_ax
=
regs
->
orig_ax
;
dump
->
regs
.
ip
=
regs
->
ip
;
dump
->
regs
.
orig_
e
ax
=
regs
->
orig_ax
;
dump
->
regs
.
e
ip
=
regs
->
ip
;
dump
->
regs
.
cs
=
regs
->
cs
;
dump
->
regs
.
flags
=
regs
->
flags
;
dump
->
regs
.
sp
=
regs
->
sp
;
dump
->
regs
.
e
flags
=
regs
->
flags
;
dump
->
regs
.
e
sp
=
regs
->
sp
;
dump
->
regs
.
ss
=
regs
->
ss
;
#if 1
/* FIXME */
...
...
@@ -107,7 +110,7 @@ static struct linux_binfmt aout_format = {
.
module
=
THIS_MODULE
,
.
load_binary
=
load_aout_binary
,
.
load_shlib
=
load_aout_library
,
#ifdef CO
RE_
DUMP
#ifdef CO
NFIG_CORE
DUMP
.
core_dump
=
aout_core_dump
,
#endif
.
min_coredump
=
PAGE_SIZE
...
...
@@ -122,7 +125,7 @@ static void set_brk(unsigned long start, unsigned long end)
vm_brk
(
start
,
end
-
start
);
}
#ifdef CO
RE_
DUMP
#ifdef CO
NFIG_CORE
DUMP
/*
* These are the only things you should do on a core-file: use only these
* macros to write out all the necessary info.
...
...
@@ -131,14 +134,14 @@ static void set_brk(unsigned long start, unsigned long end)
#include <linux/coredump.h>
#define DUMP_WRITE(addr, nr) \
if (!dump_write(file, (void *)(addr), (nr))) \
if (!dump_write(
cprm->
file, (void *)(addr), (nr))) \
goto end_coredump;
#define DUMP_SEEK(offset) \
if (!dump_seek(file, offset)) \
if (!dump_seek(
cprm->
file, offset)) \
goto end_coredump;
#define START_DATA() (u.u_tsize << PAGE_SHIFT)
#define START_DATA(
u
) (u.u_tsize << PAGE_SHIFT)
#define START_STACK(u) (u.start_stack)
/*
...
...
@@ -151,8 +154,7 @@ static void set_brk(unsigned long start, unsigned long end)
* dumping of the process results in another error..
*/
static
int
aout_core_dump
(
long
signr
,
struct
pt_regs
*
regs
,
struct
file
*
file
,
unsigned
long
limit
)
static
int
aout_core_dump
(
struct
coredump_params
*
cprm
)
{
mm_segment_t
fs
;
int
has_dumped
=
0
;
...
...
@@ -164,19 +166,19 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file,
has_dumped
=
1
;
strncpy
(
dump
.
u_comm
,
current
->
comm
,
sizeof
(
current
->
comm
));
dump
.
u_ar0
=
offsetof
(
struct
user32
,
regs
);
dump
.
signal
=
signr
;
dump_thread32
(
regs
,
&
dump
);
dump
.
signal
=
cprm
->
siginfo
->
si_signo
;
dump_thread32
(
cprm
->
regs
,
&
dump
);
/*
* If the size of the dump file exceeds the rlimit, then see
* what would happen if we wrote the stack, but not the data
* area.
*/
if
((
dump
.
u_dsize
+
dump
.
u_ssize
+
1
)
*
PAGE_SIZE
>
limit
)
if
((
dump
.
u_dsize
+
dump
.
u_ssize
+
1
)
*
PAGE_SIZE
>
cprm
->
limit
)
dump
.
u_dsize
=
0
;
/* Make sure we have enough room to write the stack and data areas. */
if
((
dump
.
u_ssize
+
1
)
*
PAGE_SIZE
>
limit
)
if
((
dump
.
u_ssize
+
1
)
*
PAGE_SIZE
>
cprm
->
limit
)
dump
.
u_ssize
=
0
;
/* make sure we actually have a data and stack area to dump */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录