Rizin
unix-like reverse engineering framework and cli tools
sfsyscall.h File Reference

Go to the source code of this file.

Macros

#define __sfsyscall_return(type, res)
 
#define _sfsyscall0(type, name)
 
#define _sfsyscall1(type, name, type1, arg1)
 
#define _sfsyscall2(type, name, type1, arg1, type2, arg2)
 
#define _sfsyscall3ipi(type, name, type1, arg1, type2, arg2, type3, arg3)
 
#define _sfsyscall3(type, name, type1, arg1, type2, arg2, type3, arg3)
 
#define _sfsyscall4(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4)
 
#define _sfsyscall5(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5)
 
#define _sfsyscall6(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6)
 

Macro Definition Documentation

◆ __sfsyscall_return

#define __sfsyscall_return (   type,
  res 
)
Value:
do { \
return (type)(res); \
} while (0)
int type
Definition: mipsasm.c:17

Definition at line 26 of file sfsyscall.h.

◆ _sfsyscall0

#define _sfsyscall0 (   type,
  name 
)
Value:
type name(void) { \
long __res; \
__asm__ volatile("syscall" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name)); \
__sfsyscall_return(type, __res); \
}
const char * name
Definition: op.c:541
Definition: z80asm.h:102

Definition at line 34 of file sfsyscall.h.

◆ _sfsyscall1

#define _sfsyscall1 (   type,
  name,
  type1,
  arg1 
)
Value:
type name(type1 arg1) { \
long __res; \
__asm__ volatile("mov %2, %%rdi\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), "g"((long)(arg1))); \
__sfsyscall_return(type, __res); \
}
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags long
Definition: sflib.h:79

Definition at line 43 of file sfsyscall.h.

◆ _sfsyscall2

#define _sfsyscall2 (   type,
  name,
  type1,
  arg1,
  type2,
  arg2 
)
Value:
type name(type1 arg1, type2 arg2) { \
long __res; \
__asm__ volatile("mov %2, %%rdi\n\t" \
"mov %3, %%rsi\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), "g"((long)(arg1)), "g"((long)(arg2))); \
__sfsyscall_return(type, __res); \
}

Definition at line 53 of file sfsyscall.h.

◆ _sfsyscall3

#define _sfsyscall3 (   type,
  name,
  type1,
  arg1,
  type2,
  arg2,
  type3,
  arg3 
)
Value:
type name(type1 arg1, type2 arg2, type3 arg3) { \
long __res; \
__asm__ volatile("mov %2, %%rdi\n\t" \
"mov %3, %%rsi\n\t" \
"mov %4, %%rdx\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), "g"((long)(arg1)), "g"((long)(arg2)), \
"g"((long)(arg3))); \
__sfsyscall_return(type, __res); \
}

Definition at line 77 of file sfsyscall.h.

◆ _sfsyscall3ipi

#define _sfsyscall3ipi (   type,
  name,
  type1,
  arg1,
  type2,
  arg2,
  type3,
  arg3 
)
Value:
type name(type1 arg1, type2 arg2, type3 arg3) { \
long __res; \
__asm__ volatile("mov %4, %%rdx\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), \
"D"(arg1), \
"S"(arg2), \
"g"((long)(arg3))); \
__sfsyscall_return(type, __res); \
}

Definition at line 64 of file sfsyscall.h.

◆ _sfsyscall4

#define _sfsyscall4 (   type,
  name,
  type1,
  arg1,
  type2,
  arg2,
  type3,
  arg3,
  type4,
  arg4 
)
Value:
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
long __res; \
__asm__ volatile("mov %2, %%rdi\n\t" \
"mov %3, %%rsi\n\t" \
"mov %4, %%rdx\n\t" \
"mov %5, %%r10\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), "g"((long)(arg1)), "c"((long)(arg2)), \
"d"((long)(arg3)), "S"((long)(arg4))); \
__sfsyscall_return(type, __res); \
}

Definition at line 90 of file sfsyscall.h.

◆ _sfsyscall5

#define _sfsyscall5 (   type,
  name,
  type1,
  arg1,
  type2,
  arg2,
  type3,
  arg3,
  type4,
  arg4,
  type5,
  arg5 
)
Value:
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
long __res; \
__asm__ volatile("mov %2, %%rdi\n\t" \
"mov %3, %%rsi\n\t" \
"mov %4, %%rdx\n\t" \
"mov %5, %%r10\n\t" \
"mov %6, %%r8\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), "g"((long)(arg1)), "g"((long)(arg2)), \
"g"((long)(arg3)), "g"((long)(arg4)), "g"((long)(arg5))); \
__sfsyscall_return(type, __res); \
}

Definition at line 104 of file sfsyscall.h.

◆ _sfsyscall6

#define _sfsyscall6 (   type,
  name,
  type1,
  arg1,
  type2,
  arg2,
  type3,
  arg3,
  type4,
  arg4,
  type5,
  arg5,
  type6,
  arg6 
)
Value:
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
long __res; \
__asm__ volatile("mov %2, %%rdi\n\t" \
"mov %3, %%rsi\n\t" \
"mov %4, %%rdx\n\t" \
"mov %5, %%r10\n\t" \
"mov %6, %%r8\n\t" \
"mov %7, %%r9\n\t" \
"syscall\n\t" \
: "=a"(__res) \
: "0"(0x2000000 | __NR_##name), "g"((long)(arg1)), "g"((long)(arg2)), \
"g"((long)(arg3)), "g"((long)(arg4)), "g"((long)(arg5)), \
"g"((long)(arg6))); \
__sfsyscall_return(type, __res); \
}

Definition at line 120 of file sfsyscall.h.