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
c706e8c6
Commit
c706e8c6
authored
Oct 24, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restorer: Add lea_args_off helper
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
57b45ea5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
restorer.c
restorer.c
+13
-13
No files found.
restorer.c
View file @
c706e8c6
...
@@ -15,6 +15,16 @@
...
@@ -15,6 +15,16 @@
#include "restorer.h"
#include "restorer.h"
#define lea_args_off(p) \
do { \
asm volatile( \
"leaq restore_args__(%%rip), %%rax \n\t" \
"movq %%rax, %0 \n\t" \
: "=m"(p) \
: \
: "memory"); \
} while (0)
long
restorer
(
long
cmd
)
long
restorer
(
long
cmd
)
{
{
long
ret
;
long
ret
;
...
@@ -34,26 +44,16 @@ long restorer(long cmd)
...
@@ -34,26 +44,16 @@ long restorer(long cmd)
char
*
str
=
NULL
;
char
*
str
=
NULL
;
int
size
=
0
;
int
size
=
0
;
asm
volatile
(
lea_args_off
(
str
);
"leaq restore_args__(%%rip), %%rax
\n\t
"
"movq %%rax, %0
\n\t
"
:
"=m"
(
str
)
:
:
"memory"
);
while
(
str
[
size
])
while
(
str
[
size
])
size
++
;
size
++
;
sys_write
(
1
,
str
,
size
);
sys_write
(
1
,
str
,
size
);
}
}
break
;
break
;
case
RESTORER_CMD__GET_ARG_OFFSET
:
case
RESTORER_CMD__GET_ARG_OFFSET
:
asm
volatile
(
lea_args_off
(
ret
);
"leaq restore_args__(%%rip), %%rax
\n\t
"
"movq %%rax, %0
\n\t
"
:
"=m"
(
ret
)
:
:
"memory"
);
break
;
break
;
/*
/*
...
...
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