sysdep.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef _LINUX_SPARC_SYSDEP_H
  2. #define _LINUX_SPARC_SYSDEP_H 1
  3. #include <common/sysdep.h>
  4. #undef ENTRY
  5. #undef END
  6. #ifdef __ASSEMBLER__
  7. #define LOADSYSCALL(x) mov __NR_##x, %g1
  8. #define ENTRY(name) \
  9. .align 4; \
  10. .global C_SYMBOL_NAME(name); \
  11. .type name, @function; \
  12. C_LABEL(name) \
  13. cfi_startproc;
  14. #define ENTRY_NOCFI(name) \
  15. .align 4; \
  16. .global C_SYMBOL_NAME(name); \
  17. .type name, @function; \
  18. C_LABEL(name)
  19. #define END_NOCFI(name) \
  20. .size name, . - name
  21. #define END(name) \
  22. cfi_endproc; \
  23. .size name, . - name
  24. #define LOC(name) .L##name
  25. /* If the offset to __syscall_error fits into a signed 22-bit
  26. * immediate branch offset, the linker will relax the call into
  27. * a normal branch.
  28. */
  29. #undef PSEUDO
  30. #undef PSEUDO_END
  31. #undef PSEUDO_NOERRNO
  32. #undef PSEUDO_ERRVAL
  33. #define PSEUDO(name, syscall_name, args) \
  34. .text; \
  35. .globl __syscall_error; \
  36. ENTRY(name); \
  37. LOADSYSCALL(syscall_name); \
  38. ta 0x10; \
  39. bcc 1f; \
  40. mov %o7, %g1; \
  41. call __syscall_error; \
  42. mov %g1, %o7; \
  43. 1:
  44. #define PSEUDO_NOERRNO(name, syscall_name, args)\
  45. .text; \
  46. ENTRY(name); \
  47. LOADSYSCALL(syscall_name); \
  48. ta 0x10;
  49. #define PSEUDO_ERRVAL(name, syscall_name, args) \
  50. .text; \
  51. ENTRY(name); \
  52. LOADSYSCALL(syscall_name); \
  53. ta 0x10;
  54. #define PSEUDO_END(name) \
  55. END(name)
  56. #endif /* __ASSEMBLER__ */
  57. #endif