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
1e6986c9
Commit
1e6986c9
authored
Jun 16, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regset: kill ->get()
no instances left Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
dcad7854
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
41 deletions
+5
-41
include/linux/regset.h
include/linux/regset.h
+0
-22
kernel/regset.c
kernel/regset.c
+5
-19
No files found.
include/linux/regset.h
View file @
1e6986c9
...
...
@@ -82,27 +82,6 @@ static inline int membuf_write(struct membuf *s, const void *v, size_t size)
typedef
int
user_regset_active_fn
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
);
/**
* user_regset_get_fn - type of @get function in &struct user_regset
* @target: thread being examined
* @regset: regset being examined
* @pos: offset into the regset data to access, in bytes
* @count: amount of data to copy, in bytes
* @kbuf: if not %NULL, a kernel-space pointer to copy into
* @ubuf: if @kbuf is %NULL, a user-space pointer to copy into
*
* Fetch register values. Return %0 on success; -%EIO or -%ENODEV
* are usual failure returns. The @pos and @count values are in
* bytes, but must be properly aligned. If @kbuf is non-null, that
* buffer is used and @ubuf is ignored. If @kbuf is %NULL, then
* ubuf gives a userland pointer to access directly, and an -%EFAULT
* return value is possible.
*/
typedef
int
user_regset_get_fn
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
);
typedef
int
user_regset_get2_fn
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
struct
membuf
to
);
...
...
@@ -235,7 +214,6 @@ typedef unsigned int user_regset_get_size_fn(struct task_struct *target,
* omitted when there is an @active function and it returns zero.
*/
struct
user_regset
{
user_regset_get_fn
*
get
;
user_regset_get2_fn
*
regset_get
;
user_regset_set_fn
*
set
;
user_regset_active_fn
*
active
;
...
...
kernel/regset.c
View file @
1e6986c9
...
...
@@ -11,7 +11,7 @@ static int __regset_get(struct task_struct *target,
void
*
p
=
*
data
,
*
to_free
=
NULL
;
int
res
;
if
(
!
regset
->
get
&&
!
regset
->
regset_get
)
if
(
!
regset
->
regset_get
)
return
-
EOPNOTSUPP
;
if
(
size
>
regset
->
n
*
regset
->
size
)
size
=
regset
->
n
*
regset
->
size
;
...
...
@@ -20,28 +20,14 @@ static int __regset_get(struct task_struct *target,
if
(
!
p
)
return
-
ENOMEM
;
}
if
(
regset
->
regset_get
)
{
res
=
regset
->
regset_get
(
target
,
regset
,
(
struct
membuf
){.
p
=
p
,
.
left
=
size
});
if
(
res
<
0
)
{
kfree
(
to_free
);
return
res
;
}
*
data
=
p
;
return
size
-
res
;
}
res
=
regset
->
get
(
target
,
regset
,
0
,
size
,
p
,
NULL
);
if
(
unlikely
(
res
<
0
))
{
res
=
regset
->
regset_get
(
target
,
regset
,
(
struct
membuf
){.
p
=
p
,
.
left
=
size
});
if
(
res
<
0
)
{
kfree
(
to_free
);
return
res
;
}
*
data
=
p
;
if
(
regset
->
get_size
)
{
// arm64-only kludge, will go away
unsigned
max_size
=
regset
->
get_size
(
target
,
regset
);
if
(
size
>
max_size
)
size
=
max_size
;
}
return
size
;
return
size
-
res
;
}
int
regset_get
(
struct
task_struct
*
target
,
...
...
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