syscall-template-ip22-irix-5.2.S
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:1k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. #include <sys.s>
  2. #include <sys/regdef.h>
  3. /* #include <sys/asm.h> */
  4. /*
  5.   Kernel syscall interface:
  6.     Input:
  7. v0 syscall number
  8.     Output:
  9.     This macro is similar to SYSCALL in sys/syscall.h, but not completely.
  10.     There's room for optimization, if we assume this will continue to
  11.     be assembled as one file.
  12. Compile with -DPIC for pic code.
  13. */
  14. #ifdef PIC
  15. #define PICOPT  .option pic2
  16. #else
  17. #define PICOPT
  18. #endif
  19. #define YSYSCALL(x) 
  20. PICOPT;
  21. .globl  machdep_sys_##x;
  22. .ent machdep_sys_##x, 0;
  23. machdep_sys_##x:;
  24. .frame  sp,0,ra;
  25. .set noreorder;
  26. li v0, SYS_##x;
  27. syscall;
  28. bne a3, zero, 1b;
  29. nop;
  30. j ra;
  31. nop;
  32. .end  machdep_sys_##x
  33. /* ==========================================================================
  34.  * error code for all syscalls. The error value is returned as the negative
  35.  * of the errno value.
  36.  */
  37. 1:
  38. subu v0,zero,v0;
  39. j ra;
  40. #define XSYSCALL(x) YSYSCALL(x)
  41. XSYSCALL(SYSCALL_NAME)