Summary:
Some syscalls like SYS_clone do not tolerate a return instruction after
the syscall instruction. Marking the syscall functions with the
`always_inline` attribute accommodates such syscalls as inlining
eliminates the return instruction.
Reviewers: abrachet, phosek
Subscribers: MaskRay, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D72102
-//===------------ inline implementation of x86_64 syscalls --------------*-===//
+//===------------ inline implementation of x86_64 syscalls ----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
-inline long syscall(long __number) {
+__attribute__((always_inline)) inline long syscall(long __number) {
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
-inline long syscall(long __number, long __arg1) {
+__attribute__((always_inline)) inline long syscall(long __number, long __arg1) {
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
-inline long syscall(long __number, long __arg1, long __arg2) {
+__attribute__((always_inline)) inline long syscall(
+ long __number, long __arg1, long __arg2) {
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
-inline long syscall(long __number, long __arg1, long __arg2, long __arg3) {
+__attribute__((always_inline)) inline long syscall(
+ long __number, long __arg1, long __arg2, long __arg3) {
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
long retcode;
LIBC_INLINE_ASM("syscall" :
"=a"(retcode) :
+__attribute__((always_inline)) inline long syscall(
long __number, long __arg1, long __arg2, long __arg3, long __arg4) {
long retcode;
register long r10 __asm__("r10") = __arg4;
long __number, long __arg1, long __arg2, long __arg3, long __arg4) {
long retcode;
register long r10 __asm__("r10") = __arg4;
-inline long syscall(long __number, long __arg1, long __arg2, long __arg3,
- long __arg4, long __arg5) {
+__attribute__((always_inline)) inline long syscall(
+ long __number, long __arg1, long __arg2, long __arg3, long __arg4,
+ long __arg5) {
long retcode;
register long r10 __asm__("r10") = __arg4;
register long r8 __asm__("r8") = __arg5;
long retcode;
register long r10 __asm__("r10") = __arg4;
register long r8 __asm__("r8") = __arg5;
-inline long syscall(long __number, long __arg1, long __arg2, long __arg3,
- long __arg4, long __arg5, long __arg6) {
+__attribute__((always_inline)) inline long syscall(
+ long __number, long __arg1, long __arg2, long __arg3, long __arg4,
+ long __arg5, long __arg6) {
long retcode;
register long r10 __asm__("r10") = __arg4;
register long r8 __asm__("r8") = __arg5;
long retcode;
register long r10 __asm__("r10") = __arg4;
register long r8 __asm__("r8") = __arg5;