/uspace/trunk/libc/include/libc.h |
---|
33,15 → 33,17 |
#include <kernel/syscall/syscall.h> |
#define __SYSCALL0(id) __syscall(0, 0, 0, id) |
#define __SYSCALL1(id, p1) __syscall(p1, 0, 0, id) |
#define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, id) |
#define __SYSCALL3(id, p1, p2, p3) __syscall(p1,p2,p3,id) |
#define __SYSCALL0(id) __syscall(0, 0, 0, 0, id) |
#define __SYSCALL1(id, p1) __syscall(p1, 0, 0, 0, id) |
#define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, 0, id) |
#define __SYSCALL3(id, p1, p2, p3) __syscall(p1,p2,p3, 0, id) |
#define __SYSCALL4(id, p1, p2, p3, p4) __syscall(p1,p2,p3,p4,id) |
extern void __main(void); |
extern void __exit(void); |
extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, |
const sysarg_t p3, const syscall_t id); |
const sysarg_t p3, const sysarg_t p4, |
const syscall_t id); |
#endif |
/uspace/trunk/libc/arch/mips32/src/syscall.c |
---|
29,12 → 29,14 |
#include <libc.h> |
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, |
const sysarg_t p3, const syscall_t id) |
const sysarg_t p3, const sysarg_t p4, |
const syscall_t id) |
{ |
register sysarg_t __mips_reg_a0 asm("$4") = p1; |
register sysarg_t __mips_reg_a1 asm("$5") = p2; |
register sysarg_t __mips_reg_a2 asm("$6") = p3; |
register sysarg_t __mips_reg_a3 asm("$7") = id; |
register sysarg_t __mips_reg_a3 asm("$7") = p4; |
register sysarg_t __mips_reg_t0 asm("$8") = id; |
register sysarg_t __mips_reg_v0 asm("$2"); |
asm volatile ( |
43,7 → 45,8 |
: "r" (__mips_reg_a0), |
"r" (__mips_reg_a1), |
"r" (__mips_reg_a2), |
"r" (__mips_reg_a3) |
"r" (__mips_reg_a3), |
"r" (__mips_reg_t0) |
); |
return __mips_reg_v0; |
/uspace/trunk/libc/arch/ia32/src/syscall.c |
---|
28,7 → 28,8 |
#include <libc.h> |
sysarg_t __syscall(const syscall_t id, const sysarg_t p1, const sysarg_t p2, const sysarg_t p3) |
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, |
const sysarg_t p4, const syscall_t id) |
{ |
sysarg_t ret; |
35,10 → 36,11 |
asm volatile ( |
"int $0x30\n" |
: "=a" (ret) |
: "a" (id), |
"b" (p1), |
"c" (p2), |
"d" (p3) |
: "a" (p1), |
"b" (p2), |
"c" (p3), |
"d" (p4), |
"S" (id) |
); |
return ret; |