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
Show 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)
...
@@ -391,31 +391,11 @@ void do_syscall_trace_exit(struct pt_regs *regs)
static
int
fpr_get
(
struct
task_struct
*
target
,
static
int
fpr_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
struct
membuf
to
)
void
*
kbuf
,
void
__user
*
ubuf
)
{
{
struct
pt_regs
*
regs
=
task_regs
(
target
);
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
;
return
membuf_write
(
&
to
,
regs
->
fr
,
ELF_NFPREG
*
sizeof
(
__u64
));
ubuf
=
u
;
pos
*=
sizeof
(
reg
);
count
*=
sizeof
(
reg
);
return
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
ELF_NFPREG
*
sizeof
(
reg
),
-
1
);
}
}
static
int
fpr_set
(
struct
task_struct
*
target
,
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)
...
@@ -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
,
static
int
gpr_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
struct
membuf
to
)
void
*
kbuf
,
void
__user
*
ubuf
)
{
{
struct
pt_regs
*
regs
=
task_regs
(
target
);
struct
pt_regs
*
regs
=
task_regs
(
target
);
unsigned
long
*
k
=
kbuf
;
unsigned
int
pos
;
unsigned
long
__user
*
u
=
ubuf
;
unsigned
long
reg
;
pos
/=
sizeof
(
reg
);
for
(
pos
=
0
;
pos
<
ELF_NGREG
;
pos
++
)
count
/=
sizeof
(
reg
);
membuf_store
(
&
to
,
get_reg
(
regs
,
pos
));
return
0
;
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
);
}
}
static
int
gpr_set
(
struct
task_struct
*
target
,
static
int
gpr_set
(
struct
task_struct
*
target
,
...
@@ -588,12 +552,12 @@ static const struct user_regset native_regsets[] = {
...
@@ -588,12 +552,12 @@ static const struct user_regset native_regsets[] = {
[
REGSET_GENERAL
]
=
{
[
REGSET_GENERAL
]
=
{
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
ELF_NGREG
,
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
ELF_NGREG
,
.
size
=
sizeof
(
long
),
.
align
=
sizeof
(
long
),
.
size
=
sizeof
(
long
),
.
align
=
sizeof
(
long
),
.
get
=
gpr_get
,
.
set
=
gpr_set
.
regset_
get
=
gpr_get
,
.
set
=
gpr_set
},
},
[
REGSET_FP
]
=
{
[
REGSET_FP
]
=
{
.
core_note_type
=
NT_PRFPREG
,
.
n
=
ELF_NFPREG
,
.
core_note_type
=
NT_PRFPREG
,
.
n
=
ELF_NFPREG
,
.
size
=
sizeof
(
__u64
),
.
align
=
sizeof
(
__u64
),
.
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 = {
...
@@ -607,31 +571,15 @@ static const struct user_regset_view user_parisc_native_view = {
static
int
gpr32_get
(
struct
task_struct
*
target
,
static
int
gpr32_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
struct
membuf
to
)
void
*
kbuf
,
void
__user
*
ubuf
)
{
{
struct
pt_regs
*
regs
=
task_regs
(
target
);
struct
pt_regs
*
regs
=
task_regs
(
target
);
compat_ulong_t
*
k
=
kbuf
;
unsigned
int
pos
;
compat_ulong_t
__user
*
u
=
ubuf
;
compat_ulong_t
reg
;
pos
/=
sizeof
(
reg
);
count
/=
sizeof
(
reg
);
if
(
kbuf
)
for
(
pos
=
0
;
pos
<
ELF_NGREG
;
pos
++
)
for
(;
count
>
0
&&
pos
<
ELF_NGREG
;
--
count
)
membuf_store
(
&
to
,
(
compat_ulong_t
)
get_reg
(
regs
,
pos
));
*
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
;
return
0
;
ubuf
=
u
;
pos
*=
sizeof
(
reg
);
count
*=
sizeof
(
reg
);
return
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
ELF_NGREG
*
sizeof
(
reg
),
-
1
);
}
}
static
int
gpr32_set
(
struct
task_struct
*
target
,
static
int
gpr32_set
(
struct
task_struct
*
target
,
...
@@ -672,12 +620,12 @@ static const struct user_regset compat_regsets[] = {
...
@@ -672,12 +620,12 @@ static const struct user_regset compat_regsets[] = {
[
REGSET_GENERAL
]
=
{
[
REGSET_GENERAL
]
=
{
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
ELF_NGREG
,
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
ELF_NGREG
,
.
size
=
sizeof
(
compat_long_t
),
.
align
=
sizeof
(
compat_long_t
),
.
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
]
=
{
[
REGSET_FP
]
=
{
.
core_note_type
=
NT_PRFPREG
,
.
n
=
ELF_NFPREG
,
.
core_note_type
=
NT_PRFPREG
,
.
n
=
ELF_NFPREG
,
.
size
=
sizeof
(
__u64
),
.
align
=
sizeof
(
__u64
),
.
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