unified_syscall_i386.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #undef _syscall0
  2. #undef _syscall1
  3. #undef _syscall2
  4. #undef _syscall3
  5. #undef _syscall4
  6. #undef _syscall5
  7. #include "str_syscalls.h"
  8. #undef uClibc_syscall_exit
  9. #define uClibc_syscall_exit(type,name,type1,arg1) \
  10. __asm__ ( \
  11. ".text\n.align 4\n.global "###name"\n"#name":;\npushl %ebp;\n" \
  12. "movl %esp,%ebp;\nsubl $4,%esp;\npushl %ebx;\nmovl 8(%ebp),%ebx;\n" \
  13. "jmp _start_exit" \
  14. )
  15. #define unified_syscall_body(name) \
  16. __asm__ ( \
  17. ".text\n.align 4\n.global "###name"\n"#name":\nmovb $"__STR_NR_##name \
  18. ",%al;\n jmp __uClibc_syscall" \
  19. )
  20. #define _syscall0(type,name) \
  21. unified_syscall_body(name)
  22. #define _syscall1(type,name,type1,arg1) \
  23. unified_syscall_body(name)
  24. #define _syscall2(type,name,type1,arg1,type2,arg2) \
  25. unified_syscall_body(name)
  26. #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
  27. unified_syscall_body(name)
  28. #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
  29. unified_syscall_body(name)
  30. #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
  31. unified_syscall_body(name)