Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
2a5c677c
Unverified
Commit
2a5c677c
authored
Apr 17, 2019
by
Stéphane Graber
Committed by
GitHub
Apr 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2940 from brauner/master
raw_syscalls: lxc_raw_clone() account for different trap number on 32bit SPARC
parents
b0b84070
6dfb1463
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
raw_syscalls.c
src/lxc/raw_syscalls.c
+26
-16
No files found.
src/lxc/raw_syscalls.c
View file @
2a5c677c
...
@@ -47,7 +47,7 @@ pid_t lxc_raw_clone(unsigned long flags)
...
@@ -47,7 +47,7 @@ pid_t lxc_raw_clone(unsigned long flags)
/* On s390/s390x and cris the order of the first and second arguments
/* On s390/s390x and cris the order of the first and second arguments
* of the system call is reversed.
* of the system call is reversed.
*/
*/
return
(
int
)
syscall
(
__NR_clone
,
NULL
,
flags
|
SIGCHLD
);
return
syscall
(
__NR_clone
,
NULL
,
flags
|
SIGCHLD
);
#elif defined(__sparc__) && defined(__arch64__)
#elif defined(__sparc__) && defined(__arch64__)
{
{
/*
/*
...
@@ -55,28 +55,38 @@ pid_t lxc_raw_clone(unsigned long flags)
...
@@ -55,28 +55,38 @@ pid_t lxc_raw_clone(unsigned long flags)
* boolean flag whether this is the child or the parent in %o1.
* boolean flag whether this is the child or the parent in %o1.
* Inline assembly is needed to get the flag returned in %o1.
* Inline assembly is needed to get the flag returned in %o1.
*/
*/
int
in_child
;
int
child_pid
,
in_child
,
ret
;
int
child_pid
;
asm
volatile
(
"mov %2, %%g1
\n\t
"
asm
volatile
(
"mov %3, %%g1
\n\t
"
"mov %3, %%o0
\n\t
"
"mov %4, %%o0
\n\t
"
"mov 0 , %%o1
\n\t
"
"mov 0 , %%o1
\n\t
"
"t 0x6d
\n\t
"
#if defined(__arch64__)
"mov %%o1, %0
\n\t
"
"t 0x6d
\n\t
"
"mov %%o0, %1"
#else
:
"=r"
(
in_child
),
"=r"
(
child_pid
)
"t 0x10
\n\t
"
:
"i"
(
__NR_clone
),
"r"
(
flags
|
SIGCHLD
)
#endif
:
"%o1"
,
"%o0"
,
"%g1"
);
"addx %%g0, 0, %2
\n\t
"
"mov %%o1, %0
\n\t
"
"mov %%o0, %1"
:
"=r"
(
in_child
),
"=r"
(
child_pid
),
"=r"
(
ret
)
:
"i"
(
__NR_clone
),
"r"
(
flags
|
SIGCHLD
)
:
"%o1"
,
"%o0"
,
"%g1"
,
"cc"
);
if
(
ret
)
{
errno
=
child_pid
;
return
-
1
;
}
if
(
in_child
)
if
(
in_child
)
return
0
;
return
0
;
else
return
child_pid
;
return
child_pid
;
}
}
#elif defined(__ia64__)
#elif defined(__ia64__)
/* On ia64 the stack and stack size are passed as separate arguments. */
/* On ia64 the stack and stack size are passed as separate arguments. */
return
(
int
)
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
,
prctl_arg
(
0
));
return
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
,
prctl_arg
(
0
));
#else
#else
return
(
int
)
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
);
return
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
);
#endif
#endif
}
}
...
...
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