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
09afabb4
Commit
09afabb4
authored
Oct 29, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rst: Merge common thread param restoring for task and threads
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
f1228904
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
25 deletions
+19
-25
restorer.c
restorer.c
+19
-25
No files found.
restorer.c
View file @
09afabb4
...
@@ -190,6 +190,23 @@ static int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
...
@@ -190,6 +190,23 @@ static int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
return
0
;
return
0
;
}
}
static
int
restore_thread_common
(
struct
rt_sigframe
*
sigframe
,
struct
thread_restore_args
*
args
)
{
sys_set_tid_address
((
int
*
)
args
->
clear_tid_addr
);
if
(
args
->
has_futex
)
{
if
(
sys_set_robust_list
((
void
*
)
args
->
futex_rla
,
args
->
futex_rla_len
))
{
pr_err
(
"Robust list err
\n
"
);
return
-
1
;
}
}
restore_sched_info
(
&
args
->
sp
);
return
restore_gpregs
(
sigframe
,
&
args
->
gpregs
);
}
/*
/*
* Threads restoration via sigreturn. Note it's locked
* Threads restoration via sigreturn. Note it's locked
* routine and calls for unlock at the end.
* routine and calls for unlock at the end.
...
@@ -205,20 +222,9 @@ long __export_restore_thread(struct thread_restore_args *args)
...
@@ -205,20 +222,9 @@ long __export_restore_thread(struct thread_restore_args *args)
goto
core_restore_end
;
goto
core_restore_end
;
}
}
sys_set_tid_address
((
int
*
)
args
->
clear_tid_addr
);
if
(
args
->
has_futex
)
{
if
(
sys_set_robust_list
((
void
*
)
args
->
futex_rla
,
args
->
futex_rla_len
))
{
pr_err
(
"Robust list err %d
\n
"
,
my_pid
);
goto
core_restore_end
;
}
}
restore_sched_info
(
&
args
->
sp
);
rt_sigframe
=
(
void
*
)
args
->
mem_zone
.
rt_sigframe
+
8
;
rt_sigframe
=
(
void
*
)
args
->
mem_zone
.
rt_sigframe
+
8
;
if
(
restore_
gpregs
(
rt_sigframe
,
&
args
->
gpre
gs
))
if
(
restore_
thread_common
(
rt_sigframe
,
ar
gs
))
goto
core_restore_end
;
goto
core_restore_end
;
mutex_unlock
(
args
->
rst_lock
);
mutex_unlock
(
args
->
rst_lock
);
...
@@ -455,8 +461,6 @@ long __export_restore_task(struct task_restore_core_args *args)
...
@@ -455,8 +461,6 @@ long __export_restore_task(struct task_restore_core_args *args)
goto
core_restore_end
;
goto
core_restore_end
;
}
}
sys_set_tid_address
((
int
*
)
args
->
t
.
clear_tid_addr
);
/*
/*
* Tune up the task fields.
* Tune up the task fields.
*/
*/
...
@@ -488,15 +492,6 @@ long __export_restore_task(struct task_restore_core_args *args)
...
@@ -488,15 +492,6 @@ long __export_restore_task(struct task_restore_core_args *args)
if
(
ret
)
if
(
ret
)
goto
core_restore_end
;
goto
core_restore_end
;
if
(
args
->
t
.
has_futex
)
{
if
(
sys_set_robust_list
((
void
*
)
args
->
t
.
futex_rla
,
args
->
t
.
futex_rla_len
))
{
pr_err
(
"Robust list set fail %d
\n
"
,
my_pid
);
goto
core_restore_end
;
}
}
restore_sched_info
(
&
args
->
t
.
sp
);
/*
/*
* We need to prepare a valid sigframe here, so
* We need to prepare a valid sigframe here, so
* after sigreturn the kernel will pick up the
* after sigreturn the kernel will pick up the
...
@@ -505,10 +500,9 @@ long __export_restore_task(struct task_restore_core_args *args)
...
@@ -505,10 +500,9 @@ long __export_restore_task(struct task_restore_core_args *args)
*/
*/
rt_sigframe
=
(
void
*
)
args
->
t
.
mem_zone
.
rt_sigframe
+
8
;
rt_sigframe
=
(
void
*
)
args
->
t
.
mem_zone
.
rt_sigframe
+
8
;
if
(
restore_
gpregs
(
rt_sigframe
,
&
args
->
t
.
gpregs
))
if
(
restore_
thread_common
(
rt_sigframe
,
&
args
->
t
))
goto
core_restore_end
;
goto
core_restore_end
;
/*
/*
* Blocked signals.
* Blocked signals.
*/
*/
...
...
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