17 lines
340 B
C
17 lines
340 B
C
#ifndef LIBC_ROCK_H
|
|
#define LIBC_ROCK_H
|
|
|
|
#include <stdint.h>
|
|
|
|
static inline int32_t syscall(int num, uint32_t arg1, uint32_t arg2, uint32_t arg3) {
|
|
int32_t ret;
|
|
__asm__ __volatile__ (
|
|
"int $0x80"
|
|
: "=a" (ret)
|
|
: "0" (num), "b" (arg1), "c" (arg2), "d" (arg3)
|
|
: "memory"
|
|
);
|
|
return ret;
|
|
}
|
|
|
|
#endif |