sysdep.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 END(name) \
  15. cfi_endproc; \
  16. .size name, . - name
  17. #define LOC(name) .L##name
  18. /* If the offset to __syscall_error fits into a signed 22-bit
  19. * immediate branch offset, the linker will relax the call into
  20. * a normal branch.
  21. */
  22. #undef PSEUDO
  23. #undef PSEUDO_END
  24. #undef PSEUDO_NOERRNO
  25. #undef PSEUDO_ERRVAL
  26. #define PSEUDO(name, syscall_name, args) \
  27. .text; \
  28. .globl __syscall_error; \
  29. ENTRY(name); \
  30. LOADSYSCALL(syscall_name); \
  31. ta 0x10; \
  32. bcc 1f; \
  33. mov %o7, %g1; \
  34. call __syscall_error; \
  35. mov %g1, %o7; \
  36. 1:
  37. #define PSEUDO_NOERRNO(name, syscall_name, args)\
  38. .text; \
  39. ENTRY(name); \
  40. LOADSYSCALL(syscall_name); \
  41. ta 0x10;
  42. #define PSEUDO_ERRVAL(name, syscall_name, args) \
  43. .text; \
  44. ENTRY(name); \
  45. LOADSYSCALL(syscall_name); \
  46. ta 0x10;
  47. #define PSEUDO_END(name) \
  48. END(name)
  49. #endif /* __ASSEMBLER__ */
  50. /* Pointer mangling is not yet supported for SPARC. */
  51. #define PTR_MANGLE(var) (void) (var)
  52. #define PTR_DEMANGLE(var) (void) (var)
  53. #endif