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
7b1f4020
Commit
7b1f4020
authored
Oct 08, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spufs: get rid of dump_emit() wrappers
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
9b56d543
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
49 deletions
+20
-49
arch/powerpc/platforms/cell/spufs/coredump.c
arch/powerpc/platforms/cell/spufs/coredump.c
+20
-49
No files found.
arch/powerpc/platforms/cell/spufs/coredump.c
View file @
7b1f4020
...
@@ -50,33 +50,6 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
...
@@ -50,33 +50,6 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
return
++
ret
;
/* count trailing NULL */
return
++
ret
;
/* count trailing NULL */
}
}
/*
* These are the only things you should do on a core-file: use only these
* functions to write out all the necessary info.
*/
static
int
spufs_dump_write
(
struct
coredump_params
*
cprm
,
const
void
*
addr
,
int
nr
)
{
if
(
!
dump_emit
(
cprm
,
addr
,
nr
))
return
-
EIO
;
return
0
;
}
static
int
spufs_dump_align
(
struct
coredump_params
*
cprm
,
char
*
buf
,
loff_t
new_off
)
{
int
rc
,
size
;
size
=
min
((
loff_t
)
PAGE_SIZE
,
new_off
-
cprm
->
written
);
memset
(
buf
,
0
,
size
);
rc
=
0
;
while
(
rc
==
0
&&
new_off
>
cprm
->
written
)
{
size
=
min
((
loff_t
)
PAGE_SIZE
,
new_off
-
cprm
->
written
);
rc
=
spufs_dump_write
(
cprm
,
buf
,
size
);
}
return
rc
;
}
static
int
spufs_ctx_note_size
(
struct
spu_context
*
ctx
,
int
dfd
)
static
int
spufs_ctx_note_size
(
struct
spu_context
*
ctx
,
int
dfd
)
{
{
int
i
,
sz
,
total
=
0
;
int
i
,
sz
,
total
=
0
;
...
@@ -159,7 +132,7 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
...
@@ -159,7 +132,7 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
struct
coredump_params
*
cprm
,
int
dfd
)
struct
coredump_params
*
cprm
,
int
dfd
)
{
{
loff_t
pos
=
0
;
loff_t
pos
=
0
;
int
sz
,
rc
,
nread
,
total
=
0
;
int
sz
,
rc
,
total
=
0
;
const
int
bufsz
=
PAGE_SIZE
;
const
int
bufsz
=
PAGE_SIZE
;
char
*
name
;
char
*
name
;
char
fullname
[
80
],
*
buf
;
char
fullname
[
80
],
*
buf
;
...
@@ -177,38 +150,36 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
...
@@ -177,38 +150,36 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
en
.
n_descsz
=
sz
;
en
.
n_descsz
=
sz
;
en
.
n_type
=
NT_SPU
;
en
.
n_type
=
NT_SPU
;
rc
=
spufs_dump_write
(
cprm
,
&
en
,
sizeof
(
en
));
if
(
!
dump_emit
(
cprm
,
&
en
,
sizeof
(
en
)))
if
(
rc
)
goto
Eio
;
goto
out
;
rc
=
spufs_dump_write
(
cprm
,
fullname
,
en
.
n_namesz
);
if
(
!
dump_emit
(
cprm
,
fullname
,
en
.
n_namesz
))
if
(
rc
)
goto
Eio
;
goto
out
;
rc
=
spufs_dump_align
(
cprm
,
buf
,
roundup
(
cprm
->
written
,
4
));
if
(
!
dump_skip
(
cprm
,
roundup
(
cprm
->
written
,
4
)
-
cprm
->
written
))
if
(
rc
)
goto
Eio
;
goto
out
;
do
{
do
{
nread
=
do_coredump_read
(
i
,
ctx
,
buf
,
bufsz
,
&
pos
);
rc
=
do_coredump_read
(
i
,
ctx
,
buf
,
bufsz
,
&
pos
);
if
(
nread
>
0
)
{
if
(
rc
>
0
)
{
rc
=
spufs_dump_write
(
cprm
,
buf
,
nread
);
if
(
!
dump_emit
(
cprm
,
buf
,
rc
))
if
(
rc
)
goto
Eio
;
goto
out
;
total
+=
rc
;
total
+=
nread
;
}
}
}
while
(
nread
==
bufsz
&&
total
<
sz
);
}
while
(
rc
==
bufsz
&&
total
<
sz
);
if
(
nread
<
0
)
{
if
(
rc
<
0
)
rc
=
nread
;
goto
out
;
goto
out
;
}
rc
=
spufs_dump_align
(
cprm
,
buf
,
roundup
(
cprm
->
written
-
total
+
sz
,
4
));
if
(
!
dump_skip
(
cprm
,
roundup
(
cprm
->
written
-
total
+
sz
,
4
)
-
cprm
->
written
))
goto
Eio
;
out:
out:
free_page
((
unsigned
long
)
buf
);
free_page
((
unsigned
long
)
buf
);
return
rc
;
return
rc
;
Eio:
free_page
((
unsigned
long
)
buf
);
return
-
EIO
;
}
}
int
spufs_coredump_extra_notes_write
(
struct
coredump_params
*
cprm
)
int
spufs_coredump_extra_notes_write
(
struct
coredump_params
*
cprm
)
...
...
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