Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
55a04580
Commit
55a04580
authored
Oct 29, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restorer: Compact rst stack evaluation code
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
00dc2660
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
cr-restore.c
cr-restore.c
+1
-5
restorer.h
include/restorer.h
+8
-3
restorer.c
pie/restorer.c
+1
-4
No files found.
cr-restore.c
View file @
55a04580
...
...
@@ -2538,11 +2538,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
task_args
->
vdso_rt_parked_at
=
(
unsigned
long
)
mem
+
vdso_rt_delta
;
task_args
->
vdso_sym_rt
=
vdso_sym_rt
;
/*
* Adjust stack.
*/
new_sp
=
RESTORE_ALIGN_STACK
((
long
)
task_args
->
t
->
mem_zone
.
stack
,
sizeof
(
task_args
->
t
->
mem_zone
.
stack
));
new_sp
=
restorer_stack
(
task_args
->
t
);
/* No longer need it */
core_entry__free_unpacked
(
core
,
NULL
);
...
...
include/restorer.h
View file @
55a04580
...
...
@@ -43,9 +43,6 @@ typedef long (*thread_restore_fcall_t) (struct thread_restore_args *args);
#define RESTORE_STACK_SIGFRAME ALIGN(sizeof(struct rt_sigframe) + SIGFRAME_OFFSET, 64)
#define RESTORE_STACK_SIZE (KILO(32))
#define RESTORE_ALIGN_STACK(start, size) \
(ALIGN((start) + (size) - sizeof(long), sizeof(long)))
struct
restore_mem_zone
{
u8
redzone
[
RESTORE_STACK_REDZONE
];
u8
stack
[
RESTORE_STACK_SIZE
];
...
...
@@ -154,6 +151,14 @@ struct task_restore_core_args {
#define SHMEMS_SIZE 4096
#define RESTORE_ALIGN_STACK(start, size) \
(ALIGN((start) + (size) - sizeof(long), sizeof(long)))
static
inline
unsigned
long
restorer_stack
(
struct
thread_restore_args
*
a
)
{
return
RESTORE_ALIGN_STACK
((
long
)
a
->
mem_zone
.
stack
,
RESTORE_STACK_SIZE
);
}
/*
* pid is a pid of a creater
* start, end are used for open mapping
...
...
pie/restorer.c
View file @
55a04580
...
...
@@ -824,10 +824,7 @@ long __export_restore_task(struct task_restore_core_args *args)
if
(
thread_args
[
i
].
pid
==
args
->
t
->
pid
)
continue
;
new_sp
=
RESTORE_ALIGN_STACK
((
long
)
thread_args
[
i
].
mem_zone
.
stack
,
sizeof
(
thread_args
[
i
].
mem_zone
.
stack
));
new_sp
=
restorer_stack
(
thread_args
+
i
);
last_pid_len
=
vprint_num
(
last_pid_buf
,
sizeof
(
last_pid_buf
),
thread_args
[
i
].
pid
-
1
,
&
s
);
ret
=
sys_write
(
fd
,
s
,
last_pid_len
);
if
(
ret
<
0
)
{
...
...
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