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
4d617aaa
Commit
4d617aaa
authored
Feb 22, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc: switch to ->regset_get()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b69c6320
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
369 deletions
+110
-369
arch/sparc/kernel/ptrace_32.c
arch/sparc/kernel/ptrace_32.c
+30
-97
arch/sparc/kernel/ptrace_64.c
arch/sparc/kernel/ptrace_64.c
+80
-272
No files found.
arch/sparc/kernel/ptrace_32.c
View file @
4d617aaa
...
...
@@ -83,39 +83,25 @@ static int regwindow32_set(struct task_struct *target,
static
int
genregs32_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
const
struct
pt_regs
*
regs
=
target
->
thread
.
kregs
;
u32
uregs
[
16
];
int
ret
;
if
(
target
==
current
)
flush_user_windows
();
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
regs
->
u_regs
,
0
,
16
*
sizeof
(
u32
));
if
(
ret
||
!
count
)
return
ret
;
membuf_write
(
&
to
,
regs
->
u_regs
,
16
*
sizeof
(
u32
));
if
(
!
to
.
left
)
return
0
;
if
(
regwindow32_get
(
target
,
regs
,
uregs
))
return
-
EFAULT
;
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
uregs
,
16
*
sizeof
(
u32
),
32
*
sizeof
(
u32
));
if
(
ret
)
return
ret
;
uregs
[
0
]
=
regs
->
psr
;
uregs
[
1
]
=
regs
->
pc
;
uregs
[
2
]
=
regs
->
npc
;
uregs
[
3
]
=
regs
->
y
;
uregs
[
4
]
=
0
;
/* WIM */
uregs
[
5
]
=
0
;
/* TBR */
return
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
uregs
,
32
*
sizeof
(
u32
),
38
*
sizeof
(
u32
));
membuf_write
(
&
to
,
uregs
,
16
*
sizeof
(
u32
));
membuf_store
(
&
to
,
regs
->
psr
);
membuf_store
(
&
to
,
regs
->
pc
);
membuf_store
(
&
to
,
regs
->
npc
);
membuf_store
(
&
to
,
regs
->
y
);
return
membuf_zero
(
&
to
,
2
*
sizeof
(
u32
));
}
static
int
genregs32_set
(
struct
task_struct
*
target
,
...
...
@@ -179,46 +165,18 @@ static int genregs32_set(struct task_struct *target,
static
int
fpregs32_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
const
unsigned
long
*
fpregs
=
target
->
thread
.
float_regs
;
int
ret
=
0
;
#if 0
if (target == current)
save_and_clear_fpu();
#endif
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
fpregs
,
0
,
32
*
sizeof
(
u32
));
if
(
!
ret
)
ret
=
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
32
*
sizeof
(
u32
),
33
*
sizeof
(
u32
));
if
(
!
ret
)
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
&
target
->
thread
.
fsr
,
33
*
sizeof
(
u32
),
34
*
sizeof
(
u32
));
if
(
!
ret
)
{
unsigned
long
val
;
val
=
(
1
<<
8
)
|
(
8
<<
16
);
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
&
val
,
34
*
sizeof
(
u32
),
35
*
sizeof
(
u32
));
}
if
(
!
ret
)
ret
=
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
35
*
sizeof
(
u32
),
-
1
);
return
ret
;
membuf_write
(
&
to
,
target
->
thread
.
float_regs
,
32
*
sizeof
(
u32
));
membuf_zero
(
&
to
,
sizeof
(
u32
));
membuf_write
(
&
to
,
&
target
->
thread
.
fsr
,
sizeof
(
u32
));
membuf_store
(
&
to
,
(
u32
)((
1
<<
8
)
|
(
8
<<
16
)));
return
membuf_zero
(
&
to
,
64
*
sizeof
(
u32
));
}
static
int
fpregs32_set
(
struct
task_struct
*
target
,
...
...
@@ -263,7 +221,7 @@ static const struct user_regset sparc32_regsets[] = {
.
core_note_type
=
NT_PRSTATUS
,
.
n
=
38
,
.
size
=
sizeof
(
u32
),
.
align
=
sizeof
(
u32
),
.
get
=
genregs32_get
,
.
set
=
genregs32_set
.
regset_
get
=
genregs32_get
,
.
set
=
genregs32_set
},
/* Format is:
* F0 --> F31
...
...
@@ -279,35 +237,24 @@ static const struct user_regset sparc32_regsets[] = {
.
core_note_type
=
NT_PRFPREG
,
.
n
=
99
,
.
size
=
sizeof
(
u32
),
.
align
=
sizeof
(
u32
),
.
get
=
fpregs32_get
,
.
set
=
fpregs32_set
.
regset_
get
=
fpregs32_get
,
.
set
=
fpregs32_set
},
};
static
int
getregs_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
const
struct
pt_regs
*
regs
=
target
->
thread
.
kregs
;
u32
v
[
4
];
int
ret
;
if
(
target
==
current
)
flush_user_windows
();
v
[
0
]
=
regs
->
psr
;
v
[
1
]
=
regs
->
pc
;
v
[
2
]
=
regs
->
npc
;
v
[
3
]
=
regs
->
y
;
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
v
,
0
*
sizeof
(
u32
),
4
*
sizeof
(
u32
));
if
(
ret
)
return
ret
;
return
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
regs
->
u_regs
+
1
,
4
*
sizeof
(
u32
),
19
*
sizeof
(
u32
));
membuf_store
(
&
to
,
regs
->
psr
);
membuf_store
(
&
to
,
regs
->
pc
);
membuf_store
(
&
to
,
regs
->
npc
);
membuf_store
(
&
to
,
regs
->
y
);
return
membuf_write
(
&
to
,
regs
->
u_regs
+
1
,
15
*
sizeof
(
u32
));
}
static
int
setregs_set
(
struct
task_struct
*
target
,
...
...
@@ -339,29 +286,15 @@ static int setregs_set(struct task_struct *target,
static
int
getfpregs_get
(
struct
task_struct
*
target
,
const
struct
user_regset
*
regset
,
unsigned
int
pos
,
unsigned
int
count
,
void
*
kbuf
,
void
__user
*
ubuf
)
struct
membuf
to
)
{
const
unsigned
long
*
fpregs
=
target
->
thread
.
float_regs
;
int
ret
=
0
;
#if 0
if (target == current)
save_and_clear_fpu();
#endif
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
fpregs
,
0
,
32
*
sizeof
(
u32
));
if
(
ret
)
return
ret
;
ret
=
user_regset_copyout
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
&
target
->
thread
.
fsr
,
32
*
sizeof
(
u32
),
33
*
sizeof
(
u32
));
if
(
ret
)
return
ret
;
return
user_regset_copyout_zero
(
&
pos
,
&
count
,
&
kbuf
,
&
ubuf
,
33
*
sizeof
(
u32
),
68
*
sizeof
(
u32
));
membuf_write
(
&
to
,
&
target
->
thread
.
float_regs
,
32
*
sizeof
(
u32
));
membuf_write
(
&
to
,
&
target
->
thread
.
fsr
,
sizeof
(
u32
));
return
membuf_zero
(
&
to
,
35
*
sizeof
(
u32
));
}
static
int
setfpregs_set
(
struct
task_struct
*
target
,
...
...
@@ -390,11 +323,11 @@ static int setfpregs_set(struct task_struct *target,
static
const
struct
user_regset
ptrace32_regsets
[]
=
{
[
REGSET_GENERAL
]
=
{
.
n
=
19
,
.
size
=
sizeof
(
u32
),
.
get
=
getregs_get
,
.
set
=
setregs_set
,
.
regset_
get
=
getregs_get
,
.
set
=
setregs_set
,
},
[
REGSET_FP
]
=
{
.
n
=
68
,
.
size
=
sizeof
(
u32
),
.
get
=
getfpregs_get
,
.
set
=
setfpregs_set
,
.
regset_
get
=
getfpregs_get
,
.
set
=
setfpregs_set
,
},
};
...
...
arch/sparc/kernel/ptrace_64.c
View file @
4d617aaa
This diff is collapsed.
Click to expand it.
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