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
Kirill Smelkov
linux
Commits
8320514c
Commit
8320514c
authored
Jun 16, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hexagon: switch to ->regset_get()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4e5e7ea4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
41 deletions
+21
-41
arch/hexagon/kernel/ptrace.c
arch/hexagon/kernel/ptrace.c
+21
-41
No files found.
arch/hexagon/kernel/ptrace.c
View file @
8320514c
...
...
@@ -35,58 +35,38 @@ void user_disable_single_step(struct task_struct *child)
static
int
genregs_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
srtuct
membuf
to
)
{
int
ret
;
unsigned
int
dummy
;
struct
pt_regs
*
regs
=
task_pt_regs
(
target
);
if
(
!
regs
)
return
-
EIO
;
/* The general idea here is that the copyout must happen in
* exactly the same order in which the userspace expects these
* regs. Now, the sequence in userspace does not match the
* sequence in the kernel, so everything past the 32 gprs
* happens one at a time.
*/
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
&
regs
->
r00
,
0
,
32
*
sizeof
(
unsigned
long
));
#define ONEXT(KPT_REG, USR_REG) \
if (!ret) \
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, \
KPT_REG, offsetof(struct user_regs_struct, USR_REG), \
offsetof(struct user_regs_struct, USR_REG) + \
sizeof(unsigned long));
membuf_write
(
&
to
,
&
regs
->
r00
,
32
*
sizeof
(
unsigned
long
));
/* Must be exactly same sequence as struct user_regs_struct */
ONEXT
(
&
regs
->
sa0
,
sa0
);
ONEXT
(
&
regs
->
lc0
,
lc0
);
ONEXT
(
&
regs
->
sa1
,
sa1
);
ONEXT
(
&
regs
->
lc1
,
lc1
);
ONEXT
(
&
regs
->
m0
,
m0
);
ONEXT
(
&
regs
->
m1
,
m1
);
ONEXT
(
&
regs
->
usr
,
usr
);
ONEXT
(
&
regs
->
preds
,
p3_0
);
ONEXT
(
&
regs
->
gp
,
gp
);
ONEXT
(
&
regs
->
ugp
,
ugp
);
ONEXT
(
&
pt_elr
(
regs
),
pc
);
dummy
=
pt_cause
(
regs
);
ONEXT
(
&
dummy
,
cause
);
ONEXT
(
&
pt_badva
(
regs
),
badva
);
membuf_store
(
&
to
,
regs
->
sa0
);
membuf_store
(
&
to
,
regs
->
lc0
);
membuf_store
(
&
to
,
regs
->
sa1
);
membuf_store
(
&
to
,
regs
->
lc1
);
membuf_store
(
&
to
,
regs
->
m0
);
membuf_store
(
&
to
,
regs
->
m1
);
membuf_store
(
&
to
,
regs
->
usr
);
membuf_store
(
&
to
,
regs
->
p3_0
);
membuf_store
(
&
to
,
regs
->
gp
);
membuf_store
(
&
to
,
regs
->
ugp
);
membuf_store
(
&
to
,
pt_elr
(
regs
));
// pc
membuf_store
(
&
to
,
(
unsigned
long
)
pt_cause
(
regs
));
// cause
membuf_store
(
&
to
,
pt_badva
(
regs
));
// badva
#if CONFIG_HEXAGON_ARCH_VERSION >=4
ONEXT
(
&
regs
->
cs0
,
cs0
);
ONEXT
(
&
regs
->
cs1
,
cs1
);
membuf_store
(
&
to
,
regs
->
cs0
);
membuf_store
(
&
to
,
regs
->
cs1
);
return
membuf_zero
(
&
to
,
sizeof
(
unsigned
long
));
#else
return
membuf_zero
(
&
to
,
3
*
sizeof
(
unsigned
long
));
#endif
/* Pad the rest with zeros, if needed */
if
(
!
ret
)
ret
=
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
offsetof
(
struct
user_regs_struct
,
pad1
),
-
1
);
return
ret
;
}
static
int
genregs_set
(
struct
task_struct
*
target
,
...
...
@@ -159,7 +139,7 @@ static const struct user_regset hexagon_regsets[] = {
.
n
=
ELF_NGREG
,
.
size
=
sizeof
(
unsigned
long
),
.
align
=
sizeof
(
unsigned
long
),
.
get
=
genregs_get
,
.
regset_
get
=
genregs_get
,
.
set
=
genregs_set
,
},
};
...
...
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