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
bd0409a8
Commit
bd0409a8
authored
Jun 16, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parisc: switch to ->regset_get()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
1b5b456e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
68 deletions
+16
-68
arch/parisc/kernel/ptrace.c
arch/parisc/kernel/ptrace.c
+16
-68
No files found.
arch/parisc/kernel/ptrace.c
View file @
bd0409a8
...
...
@@ -391,31 +391,11 @@ void do_syscall_trace_exit(struct pt_regs *regs)
static
int
fpr_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
struct
pt_regs
*
regs
=
task_regs
(
target
);
__u64
*
k
=
kbuf
;
__u64
__user
*
u
=
ubuf
;
__u64
reg
;
pos
/=
sizeof
(
reg
);
count
/=
sizeof
(
reg
);
if
(
kbuf
)
for
(;
count
>
0
&&
pos
<
ELF_NFPREG
;
--
count
)
*
k
++
=
regs
->
fr
[
pos
++
];
else
for
(;
count
>
0
&&
pos
<
ELF_NFPREG
;
--
count
)
if
(
__put_user
(
regs
->
fr
[
pos
++
],
u
++
))
return
-
EFAULT
;
kbuf
=
k
;
ubuf
=
u
;
pos
*=
sizeof
(
reg
);
count
*=
sizeof
(
reg
);
return
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
ELF_NFPREG
*
sizeof
(
reg
),
-
1
);
return
membuf_write
(
&
to
,
regs
->
fr
,
ELF_NFPREG
*
sizeof
(
__u64
));
}
static
int
fpr_set
(
struct
task_struct
*
target
,
...
...
@@ -527,30 +507,14 @@ static void set_reg(struct pt_regs *regs, int num, unsigned long val)
static
int
gpr_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
struct
pt_regs
*
regs
=
task_regs
(
target
);
unsigned
long
*
k
=
kbuf
;
unsigned
long
__user
*
u
=
ubuf
;
unsigned
long
reg
;
unsigned
int
pos
;
pos
/=
sizeof
(
reg
);
count
/=
sizeof
(
reg
);
if
(
kbuf
)
for
(;
count
>
0
&&
pos
<
ELF_NGREG
;
--
count
)
*
k
++
=
get_reg
(
regs
,
pos
++
);
else
for
(;
count
>
0
&&
pos
<
ELF_NGREG
;
--
count
)
if
(
__put_user
(
get_reg
(
regs
,
pos
++
),
u
++
))
return
-
EFAULT
;
kbuf
=
k
;
ubuf
=
u
;
pos
*=
sizeof
(
reg
);
count
*=
sizeof
(
reg
);
return
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
ELF_NGREG
*
sizeof
(
reg
),
-
1
);
for
(
pos
=
0
;
pos
<
ELF_NGREG
;
pos
++
)
membuf_store
(
&
to
,
get_reg
(
regs
,
pos
));
return
0
;
}
static
int
gpr_set
(
struct
task_struct
*
target
,
...
...
@@ -588,12 +552,12 @@ static const struct user_regset native_regsets[] = {
[
REGSET_GENERAL
]
=
{
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
ELF_NGREG
,
.
size
=
sizeof
(
long
),
.
align
=
sizeof
(
long
),
.
get
=
gpr_get
,
.
set
=
gpr_set
.
regset_
get
=
gpr_get
,
.
set
=
gpr_set
},
[
REGSET_FP
]
=
{
.
core_note_type
=
NT_PRFPREG
,
.
n
=
ELF_NFPREG
,
.
size
=
sizeof
(
__u64
),
.
align
=
sizeof
(
__u64
),
.
get
=
fpr_get
,
.
set
=
fpr_set
.
regset_
get
=
fpr_get
,
.
set
=
fpr_set
}
};
...
...
@@ -607,31 +571,15 @@ static const struct user_regset_view user_parisc_native_view = {
static
int
gpr32_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
struct
pt_regs
*
regs
=
task_regs
(
target
);
compat_ulong_t
*
k
=
kbuf
;
compat_ulong_t
__user
*
u
=
ubuf
;
compat_ulong_t
reg
;
unsigned
int
pos
;
pos
/=
sizeof
(
reg
);
count
/=
sizeof
(
reg
);
for
(
pos
=
0
;
pos
<
ELF_NGREG
;
pos
++
)
membuf_store
(
&
to
,
(
compat_ulong_t
)
get_reg
(
regs
,
pos
)
);
if
(
kbuf
)
for
(;
count
>
0
&&
pos
<
ELF_NGREG
;
--
count
)
*
k
++
=
get_reg
(
regs
,
pos
++
);
else
for
(;
count
>
0
&&
pos
<
ELF_NGREG
;
--
count
)
if
(
__put_user
((
compat_ulong_t
)
get_reg
(
regs
,
pos
++
),
u
++
))
return
-
EFAULT
;
kbuf
=
k
;
ubuf
=
u
;
pos
*=
sizeof
(
reg
);
count
*=
sizeof
(
reg
);
return
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
ELF_NGREG
*
sizeof
(
reg
),
-
1
);
return
0
;
}
static
int
gpr32_set
(
struct
task_struct
*
target
,
...
...
@@ -672,12 +620,12 @@ static const struct user_regset compat_regsets[] = {
[
REGSET_GENERAL
]
=
{
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
ELF_NGREG
,
.
size
=
sizeof
(
compat_long_t
),
.
align
=
sizeof
(
compat_long_t
),
.
get
=
gpr32_get
,
.
set
=
gpr32_set
.
regset_
get
=
gpr32_get
,
.
set
=
gpr32_set
},
[
REGSET_FP
]
=
{
.
core_note_type
=
NT_PRFPREG
,
.
n
=
ELF_NFPREG
,
.
size
=
sizeof
(
__u64
),
.
align
=
sizeof
(
__u64
),
.
get
=
fpr_get
,
.
set
=
fpr_set
.
regset_
get
=
fpr_get
,
.
set
=
fpr_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