Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a96dacf9
Commit
a96dacf9
authored
May 15, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arm64: take fetching compat reg out of pt_regs into a new helper
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b3a9e3b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
arch/arm64/kernel/ptrace.c
arch/arm64/kernel/ptrace.c
+17
-17
No files found.
arch/arm64/kernel/ptrace.c
View file @
a96dacf9
...
...
@@ -1237,6 +1237,22 @@ enum compat_regset {
REGSET_COMPAT_VFP
,
};
static
inline
compat_ulong_t
compat_get_user_reg
(
struct
task_struct
*
task
,
int
idx
)
{
struct
pt_regs
*
regs
=
task_pt_regs
(
task
);
switch
(
idx
)
{
case
15
:
return
regs
->
pc
;
case
16
:
return
pstate_to_compat_psr
(
regs
->
pstate
);
case
17
:
return
regs
->
orig_x0
;
default:
return
regs
->
regs
[
idx
];
}
}
static
int
compat_gpr_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
...
...
@@ -1255,23 +1271,7 @@ static int compat_gpr_get(struct task_struct *target,
return
-
EIO
;
for
(
i
=
0
;
i
<
num_regs
;
++
i
)
{
unsigned
int
idx
=
start
+
i
;
compat_ulong_t
reg
;
switch
(
idx
)
{
case
15
:
reg
=
task_pt_regs
(
target
)
->
pc
;
break
;
case
16
:
reg
=
task_pt_regs
(
target
)
->
pstate
;
reg
=
pstate_to_compat_psr
(
reg
);
break
;
case
17
:
reg
=
task_pt_regs
(
target
)
->
orig_x0
;
break
;
default:
reg
=
task_pt_regs
(
target
)
->
regs
[
idx
];
}
compat_ulong_t
reg
=
compat_get_user_reg
(
target
,
start
+
i
);
if
(
kbuf
)
{
memcpy
(
kbuf
,
&
reg
,
sizeof
(
reg
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment