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
79c67231
Commit
79c67231
authored
Oct 24, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: The should be always inlined
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
5fd13e04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
syscall.h
include/syscall.h
+26
-26
No files found.
include/syscall.h
View file @
79c67231
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#ifdef CONFIG_X86_64
#ifdef CONFIG_X86_64
static
long
syscall0
(
int
nr
)
static
__always_inline
long
syscall0
(
int
nr
)
{
{
long
ret
;
long
ret
;
asm
volatile
(
"syscall"
asm
volatile
(
"syscall"
...
@@ -18,7 +18,7 @@ static long syscall0(int nr)
...
@@ -18,7 +18,7 @@ static long syscall0(int nr)
return
ret
;
return
ret
;
}
}
static
long
syscall1
(
int
nr
,
unsigned
long
arg0
)
static
__always_inline
long
syscall1
(
int
nr
,
unsigned
long
arg0
)
{
{
long
ret
;
long
ret
;
asm
volatile
(
"syscall"
asm
volatile
(
"syscall"
...
@@ -28,7 +28,7 @@ static long syscall1(int nr, unsigned long arg0)
...
@@ -28,7 +28,7 @@ static long syscall1(int nr, unsigned long arg0)
return
ret
;
return
ret
;
}
}
static
long
syscall2
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
)
static
__always_inline
long
syscall2
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
)
{
{
long
ret
;
long
ret
;
asm
volatile
(
"syscall"
asm
volatile
(
"syscall"
...
@@ -38,8 +38,8 @@ static long syscall2(int nr, unsigned long arg0, unsigned long arg1)
...
@@ -38,8 +38,8 @@ static long syscall2(int nr, unsigned long arg0, unsigned long arg1)
return
ret
;
return
ret
;
}
}
static
long
syscall3
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
static
__always_inline
long
syscall3
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
unsigned
long
arg2
)
unsigned
long
arg2
)
{
{
long
ret
;
long
ret
;
asm
volatile
(
"syscall"
asm
volatile
(
"syscall"
...
@@ -49,8 +49,8 @@ static long syscall3(int nr, unsigned long arg0, unsigned long arg1,
...
@@ -49,8 +49,8 @@ static long syscall3(int nr, unsigned long arg0, unsigned long arg1,
return
ret
;
return
ret
;
}
}
static
long
syscall4
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
static
__always_inline
long
syscall4
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
)
unsigned
long
arg2
,
unsigned
long
arg3
)
{
{
register
unsigned
long
r10
asm
(
"r10"
)
=
r10
;
register
unsigned
long
r10
asm
(
"r10"
)
=
r10
;
long
ret
;
long
ret
;
...
@@ -63,9 +63,9 @@ static long syscall4(int nr, unsigned long arg0, unsigned long arg1,
...
@@ -63,9 +63,9 @@ static long syscall4(int nr, unsigned long arg0, unsigned long arg1,
return
ret
;
return
ret
;
}
}
static
long
syscall5
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
static
long
__always_inline
syscall5
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
)
unsigned
long
arg4
)
{
{
register
unsigned
long
r10
asm
(
"r10"
)
=
r10
;
register
unsigned
long
r10
asm
(
"r10"
)
=
r10
;
register
unsigned
long
r8
asm
(
"r8"
)
=
r8
;
register
unsigned
long
r8
asm
(
"r8"
)
=
r8
;
...
@@ -80,9 +80,9 @@ static long syscall5(int nr, unsigned long arg0, unsigned long arg1,
...
@@ -80,9 +80,9 @@ static long syscall5(int nr, unsigned long arg0, unsigned long arg1,
return
ret
;
return
ret
;
}
}
static
long
syscall6
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
static
long
__always_inline
syscall6
(
int
nr
,
unsigned
long
arg0
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
,
unsigned
long
arg5
)
unsigned
long
arg4
,
unsigned
long
arg5
)
{
{
register
unsigned
long
r10
asm
(
"r10"
)
=
r10
;
register
unsigned
long
r10
asm
(
"r10"
)
=
r10
;
register
unsigned
long
r8
asm
(
"r8"
)
=
r8
;
register
unsigned
long
r8
asm
(
"r8"
)
=
r8
;
...
@@ -99,59 +99,59 @@ static long syscall6(int nr, unsigned long arg0, unsigned long arg1,
...
@@ -99,59 +99,59 @@ static long syscall6(int nr, unsigned long arg0, unsigned long arg1,
return
ret
;
return
ret
;
}
}
static
unsigned
long
sys_pause
(
void
)
static
__always_inline
unsigned
long
sys_pause
(
void
)
{
{
return
syscall0
(
__NR_pause
);
return
syscall0
(
__NR_pause
);
}
}
static
unsigned
long
sys_mmap
(
void
*
addr
,
unsigned
long
len
,
unsigned
long
prot
,
static
__always_inline
unsigned
long
sys_mmap
(
void
*
addr
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
flags
,
unsigned
long
fd
,
unsigned
long
offset
)
unsigned
long
flags
,
unsigned
long
fd
,
unsigned
long
offset
)
{
{
return
syscall6
(
__NR_mmap
,
(
unsigned
long
)
addr
,
return
syscall6
(
__NR_mmap
,
(
unsigned
long
)
addr
,
len
,
prot
,
flags
,
fd
,
offset
);
len
,
prot
,
flags
,
fd
,
offset
);
}
}
static
unsigned
long
sys_munmap
(
void
*
addr
,
unsigned
long
len
)
static
__always_inline
unsigned
long
sys_munmap
(
void
*
addr
,
unsigned
long
len
)
{
{
return
syscall2
(
__NR_munmap
,
(
unsigned
long
)
addr
,
len
);
return
syscall2
(
__NR_munmap
,
(
unsigned
long
)
addr
,
len
);
}
}
static
long
sys_open
(
const
char
*
filename
,
unsigned
long
flags
,
unsigned
long
mode
)
static
__always_inline
long
sys_open
(
const
char
*
filename
,
unsigned
long
flags
,
unsigned
long
mode
)
{
{
return
syscall3
(
__NR_open
,
(
unsigned
long
)
filename
,
flags
,
mode
);
return
syscall3
(
__NR_open
,
(
unsigned
long
)
filename
,
flags
,
mode
);
}
}
static
long
sys_close
(
int
fd
)
static
__always_inline
long
sys_close
(
int
fd
)
{
{
return
syscall1
(
__NR_close
,
fd
);
return
syscall1
(
__NR_close
,
fd
);
}
}
static
long
sys_write
(
unsigned
long
fd
,
const
void
*
buf
,
unsigned
long
count
)
static
__always_inline
long
sys_write
(
unsigned
long
fd
,
const
void
*
buf
,
unsigned
long
count
)
{
{
return
syscall3
(
__NR_write
,
fd
,
(
unsigned
long
)
buf
,
count
);
return
syscall3
(
__NR_write
,
fd
,
(
unsigned
long
)
buf
,
count
);
}
}
static
long
sys_mincore
(
unsigned
long
addr
,
unsigned
long
size
,
void
*
vec
)
static
__always_inline
long
sys_mincore
(
unsigned
long
addr
,
unsigned
long
size
,
void
*
vec
)
{
{
return
syscall3
(
__NR_mincore
,
addr
,
size
,
(
unsigned
long
)
vec
);
return
syscall3
(
__NR_mincore
,
addr
,
size
,
(
unsigned
long
)
vec
);
}
}
static
long
sys_lseek
(
unsigned
long
fd
,
unsigned
long
offset
,
unsigned
long
origin
)
static
__always_inline
long
sys_lseek
(
unsigned
long
fd
,
unsigned
long
offset
,
unsigned
long
origin
)
{
{
return
syscall3
(
__NR_lseek
,
fd
,
offset
,
origin
);
return
syscall3
(
__NR_lseek
,
fd
,
offset
,
origin
);
}
}
static
long
sys_mprotect
(
unsigned
long
start
,
unsigned
long
len
,
unsigned
long
prot
)
static
__always_inline
long
sys_mprotect
(
unsigned
long
start
,
unsigned
long
len
,
unsigned
long
prot
)
{
{
return
syscall3
(
__NR_mprotect
,
start
,
len
,
prot
);
return
syscall3
(
__NR_mprotect
,
start
,
len
,
prot
);
}
}
static
long
sys_nanosleep
(
struct
timespec
*
req
,
struct
timespec
*
rem
)
static
__always_inline
long
sys_nanosleep
(
struct
timespec
*
req
,
struct
timespec
*
rem
)
{
{
return
syscall2
(
__NR_nanosleep
,
(
unsigned
long
)
req
,
(
unsigned
long
)
rem
);
return
syscall2
(
__NR_nanosleep
,
(
unsigned
long
)
req
,
(
unsigned
long
)
rem
);
}
}
static
long
sys_read
(
unsigned
long
fd
,
void
*
buf
,
unsigned
long
count
)
static
__always_inline
long
sys_read
(
unsigned
long
fd
,
void
*
buf
,
unsigned
long
count
)
{
{
return
syscall3
(
__NR_read
,
fd
,
(
unsigned
long
)
buf
,
count
);
return
syscall3
(
__NR_read
,
fd
,
(
unsigned
long
)
buf
,
count
);
}
}
...
@@ -160,7 +160,7 @@ static long sys_read(unsigned long fd, void *buf, unsigned long count)
...
@@ -160,7 +160,7 @@ static long sys_read(unsigned long fd, void *buf, unsigned long count)
* Note this call expects a signal frame on stack
* Note this call expects a signal frame on stack
* (regs->sp) so be very carefull here!
* (regs->sp) so be very carefull here!
*/
*/
static
long
sys_rt_sigreturn
(
void
)
static
__always_inline
long
sys_rt_sigreturn
(
void
)
{
{
return
syscall0
(
__NR_rt_sigreturn
);
return
syscall0
(
__NR_rt_sigreturn
);
}
}
...
...
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