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 _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 23 of file sfsyscall.h.

◆ _sfsyscall0

#define _sfsyscall0 (   type,
  name 
)
Value:
type name(void) { \
long __res; \
__asm__ volatile("###> " #name " <###\n\t" \
"svc 0" \
: "=a"(__res) \
: "0"(__NR_##name) \
: "memory", "cc"); \
__sfsyscall_return(type, __res); \
}
const char * name
Definition: op.c:541
Definition: z80asm.h:102

Definition at line 32 of file sfsyscall.h.

◆ _sfsyscall1

#define _sfsyscall1 (   type,
  name,
  type1,
  arg1 
)
Value:
type name(type1 arg1) { \
long __res; \
register type1 r1 asm("r0"); \
r1 = arg1; \
asm volatile("###> " #name "(%2) <###\n\t" \
"mov r7, %0\n\t" \
"svc 0" \
: "=g"(__res) \
: "0"(__NR_##name), "r"(r1)); \
__sfsyscall_return(type, __res); \
}

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; \
register type1 r1 asm("r1"); \
register type2 r2 asm("r2"); \
r1 = arg1; \
r2 = arg2; \
__asm__ volatile("###> " #name "(%2, %3) <###\n\t" \
"svc 0" \
: "=g"(__res) \
: "0"(__NR_##name), \
"r"(r1), \
"r"(r2)); \
__sfsyscall_return(type, __res); \
}
r2
Definition: arm-aliases.s.cs:2

Definition at line 56 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; \
register type1 r0 asm("r0"); \
register type2 r1 asm("r1"); \
register type3 r2 asm("r2"); \
r0 = arg1; \
r1 = arg2; \
r2 = arg3; \
__asm__ __volatile__("###> " #name "(%2, %3, %4) <###\n\t" \
"mov r7, %1\n\t" \
"svc 0" \
: "=g"(__res) \
: "0"(__NR_##name), \
"r"(r0), \
"r"(r1), \
"r"(r2) \
: "memory", "cc"); \
__sfsyscall_return(type, __res); \
}

Definition at line 72 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; \
register type1 r1 asm("r1"); \
; \
register type2 r2 asm("r2"); \
register type3 r3 asm("r3"); \
register type4 r4 asm("r4"); \
r1 = arg1; \
r2 = arg2; \
r3 = arg3; \
r4 = arg4; \
asm volatile("###> " #name "(%2, %3, %4, %5) <###\n\t" \
"svc 0" \
: "=g"(__res) \
: "0"(__NR_##name), \
"r"(r1), \
"r"(r2), \
"r"(r3), \
"r"(r4) \
: "memory", "cc"); \
__sfsyscall_return(type, __res); \
}
r3
Definition: arm-aliases.s.cs:3

Definition at line 93 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; \
register type1 r1 asm("r1"); \
register type2 r2 asm("r2"); \
register type3 r3 asm("r3"); \
register type4 r4 asm("r4"); \
register type5 r5 asm("r5"); \
r1 = arg1; \
r2 = arg2; \
r3 = arg3; \
r4 = arg4; \
r5 = arg5; \
asm volatile("###> " #name "(%2, %3, %4, %5, %6) <###\n\t" \
"svc 0" \
: "=g"(__res) \
: "0"(__NR_##name), \
"r"(r1), \
"r"(r2), \
"r"(r3), \
"r"(r4), \
"r"(r5) \
: "memory", "cc"); \
__sfsyscall_return(type, __res); \
}

Definition at line 117 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; \
register type1 r1 asm("r1"); \
register type2 r2 asm("r2"); \
register type3 r3 asm("r3"); \
register type4 r4 asm("r4"); \
register type5 r5 asm("r5"); \
register type6 r6 asm("r6"); \
r1 = arg1; \
r2 = arg2; \
r3 = arg3; \
r4 = arg4; \
r5 = arg5; \
r6 = arg6; \
asm volatile("###> " #name "(%2, %3, %4, %5, %6, %7) <###\n\t" \
"svc 0" \
: "=a"(__res) \
: "0"(__NR_##name), \
"r"(r1), \
"r"(r2), \
"r"(r3), \
"r"(r4), \
"r"(r5), \
"r"(r6) \
: "memory", "cc"); \
__sfsyscall_return(type, __res); \
}

Definition at line 144 of file sfsyscall.h.