Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d256eb8d
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看板
提交
d256eb8d
编写于
2月 07, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC32]: Use regsets in arch_ptrace().
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
9473272a
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
47 addition
and
68 deletion
+47
-68
arch/sparc/kernel/ptrace.c
arch/sparc/kernel/ptrace.c
+47
-68
未找到文件。
arch/sparc/kernel/ptrace.c
浏览文件 @
d256eb8d
...
@@ -322,54 +322,39 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
...
@@ -322,54 +322,39 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
long
arch_ptrace
(
struct
task_struct
*
child
,
long
request
,
long
addr
,
long
data
)
long
arch_ptrace
(
struct
task_struct
*
child
,
long
request
,
long
addr
,
long
data
)
{
{
unsigned
long
addr2
=
current
->
thread
.
kregs
->
u_regs
[
UREG_I4
];
unsigned
long
addr2
=
current
->
thread
.
kregs
->
u_regs
[
UREG_I4
];
int
i
,
ret
;
const
struct
user_regset_view
*
view
;
int
ret
;
view
=
task_user_regset_view
(
child
);
switch
(
request
)
{
switch
(
request
)
{
case
PTRACE_GETREGS
:
{
case
PTRACE_GETREGS
:
{
struct
pt_regs
__user
*
pregs
=
(
struct
pt_regs
__user
*
)
addr
;
struct
pt_regs
__user
*
pregs
=
(
struct
pt_regs
__user
*
)
addr
;
struct
pt_regs
*
cregs
=
child
->
thread
.
kregs
;
ret
=
-
EFAULT
;
if
(
!
access_ok
(
VERIFY_WRITE
,
pregs
,
sizeof
(
struct
pt_regs
)))
break
;
__put_user
(
cregs
->
psr
,
(
&
pregs
->
psr
));
ret
=
copy_regset_to_user
(
child
,
view
,
REGSET_GENERAL
,
__put_user
(
cregs
->
pc
,
(
&
pregs
->
pc
));
32
*
sizeof
(
u32
),
__put_user
(
cregs
->
npc
,
(
&
pregs
->
npc
));
4
*
sizeof
(
u32
),
__put_user
(
cregs
->
y
,
(
&
pregs
->
y
));
&
pregs
->
psr
);
for
(
i
=
1
;
i
<
16
;
i
++
)
if
(
!
ret
)
__put_user
(
cregs
->
u_regs
[
i
],
&
pregs
->
u_regs
[
i
-
1
]);
copy_regset_to_user
(
child
,
view
,
REGSET_GENERAL
,
ret
=
0
;
1
*
sizeof
(
u32
),
15
*
sizeof
(
u32
),
&
pregs
->
u_regs
[
0
]);
break
;
break
;
}
}
case
PTRACE_SETREGS
:
{
case
PTRACE_SETREGS
:
{
struct
pt_regs
__user
*
pregs
=
(
struct
pt_regs
__user
*
)
addr
;
struct
pt_regs
__user
*
pregs
=
(
struct
pt_regs
__user
*
)
addr
;
struct
pt_regs
*
cregs
=
child
->
thread
.
kregs
;
unsigned
long
psr
,
pc
,
npc
,
y
;
/* Must be careful, tracing process can only set certain
ret
=
copy_regset_from_user
(
child
,
view
,
REGSET_GENERAL
,
* bits in the psr.
32
*
sizeof
(
u32
),
*/
4
*
sizeof
(
u32
),
ret
=
-
EFAULT
;
&
pregs
->
psr
);
if
(
!
access_ok
(
VERIFY_READ
,
pregs
,
sizeof
(
struct
pt_regs
)))
if
(
!
ret
)
break
;
copy_regset_from_user
(
child
,
view
,
REGSET_GENERAL
,
1
*
sizeof
(
u32
),
__get_user
(
psr
,
(
&
pregs
->
psr
));
15
*
sizeof
(
u32
),
__get_user
(
pc
,
(
&
pregs
->
pc
));
&
pregs
->
u_regs
[
0
]);
__get_user
(
npc
,
(
&
pregs
->
npc
));
__get_user
(
y
,
(
&
pregs
->
y
));
psr
&=
PSR_ICC
;
cregs
->
psr
&=
~
PSR_ICC
;
cregs
->
psr
|=
psr
;
if
(
!
((
pc
|
npc
)
&
3
))
{
cregs
->
pc
=
pc
;
cregs
->
npc
=
npc
;
}
cregs
->
y
=
y
;
for
(
i
=
1
;
i
<
16
;
i
++
)
__get_user
(
cregs
->
u_regs
[
i
],
&
pregs
->
u_regs
[
i
-
1
]);
ret
=
0
;
break
;
break
;
}
}
...
@@ -387,23 +372,23 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
...
@@ -387,23 +372,23 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
};
};
struct
fps
__user
*
fps
=
(
struct
fps
__user
*
)
addr
;
struct
fps
__user
*
fps
=
(
struct
fps
__user
*
)
addr
;
ret
=
-
EFAULT
;
ret
=
copy_regset_to_user
(
child
,
view
,
REGSET_FP
,
if
(
!
access_ok
(
VERIFY_WRITE
,
fps
,
sizeof
(
struct
fps
)))
0
*
sizeof
(
u32
),
break
;
32
*
sizeof
(
u32
),
&
fps
->
regs
[
0
]);
if
(
!
ret
)
ret
=
copy_regset_to_user
(
child
,
view
,
REGSET_FP
,
33
*
sizeof
(
u32
),
1
*
sizeof
(
u32
),
&
fps
->
fsr
);
for
(
i
=
0
;
i
<
32
;
i
++
)
if
(
!
ret
)
{
__put_user
(
child
->
thread
.
float_regs
[
i
],
&
fps
->
regs
[
i
]);
if
(
__put_user
(
0
,
&
fps
->
fpqd
)
||
__put_user
(
child
->
thread
.
fsr
,
(
&
fps
->
fsr
));
__put_user
(
0
,
&
fps
->
flags
)
||
__put_user
(
child
->
thread
.
fpqdepth
,
(
&
fps
->
fpqd
));
__put_user
(
0
,
&
fps
->
extra
)
||
__put_user
(
0
,
(
&
fps
->
flags
));
clear_user
(
fps
->
fpq
,
sizeof
(
fps
->
fpq
)))
__put_user
(
0
,
(
&
fps
->
extra
));
ret
=
-
EFAULT
;
for
(
i
=
0
;
i
<
16
;
i
++
)
{
__put_user
(
child
->
thread
.
fpqueue
[
i
].
insn_addr
,
(
&
fps
->
fpq
[
i
].
insnaddr
));
__put_user
(
child
->
thread
.
fpqueue
[
i
].
insn
,
&
fps
->
fpq
[
i
].
insn
);
}
}
ret
=
0
;
break
;
break
;
}
}
...
@@ -421,21 +406,15 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
...
@@ -421,21 +406,15 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
};
};
struct
fps
__user
*
fps
=
(
struct
fps
__user
*
)
addr
;
struct
fps
__user
*
fps
=
(
struct
fps
__user
*
)
addr
;
ret
=
-
EFAULT
;
ret
=
copy_regset_from_user
(
child
,
view
,
REGSET_FP
,
if
(
!
access_ok
(
VERIFY_READ
,
fps
,
sizeof
(
struct
fps
)))
0
*
sizeof
(
u32
),
break
;
32
*
sizeof
(
u32
),
&
fps
->
regs
[
0
]);
copy_from_user
(
&
child
->
thread
.
float_regs
[
0
],
&
fps
->
regs
[
0
],
if
(
!
ret
)
(
32
*
sizeof
(
unsigned
long
)));
ret
=
copy_regset_from_user
(
child
,
view
,
REGSET_FP
,
__get_user
(
child
->
thread
.
fsr
,
(
&
fps
->
fsr
));
33
*
sizeof
(
u32
),
__get_user
(
child
->
thread
.
fpqdepth
,
(
&
fps
->
fpqd
));
1
*
sizeof
(
u32
),
for
(
i
=
0
;
i
<
16
;
i
++
)
{
&
fps
->
fsr
);
__get_user
(
child
->
thread
.
fpqueue
[
i
].
insn_addr
,
(
&
fps
->
fpq
[
i
].
insnaddr
));
__get_user
(
child
->
thread
.
fpqueue
[
i
].
insn
,
&
fps
->
fpq
[
i
].
insn
);
}
ret
=
0
;
break
;
break
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录