sysdep.h 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Assembler macros for Meta.
  3. *
  4. * Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <common/sysdep.h>
  7. #include <features.h>
  8. #include <libc-internal.h>
  9. #ifdef __ASSEMBLER__
  10. #ifdef SHARED
  11. #define PLTJMP(_x) _x##@PLT
  12. #else
  13. #define PLTJMP(_x) _x
  14. #endif
  15. #undef PSEUDO_END
  16. #define PSEUDO_END(name) \
  17. SYSCALL_ERROR_HANDLER \
  18. END (name)
  19. #if defined NOT_IN_libc
  20. # define SYSCALL_ERROR __local_syscall_error
  21. # define SYSCALL_ERROR_HANDLER \
  22. __local_syscall_error: \
  23. MOV D1Re0, D1RtP; \
  24. SETL [A0StP++], D0Re0, D1Re0; \
  25. CALLR D1RtP, PLTJMP(___errno_location); \
  26. GETD D1Re0, [A0StP+#-8]; \
  27. NEG D1Re0, D1Re0; \
  28. SETD [D0Re0], D1Re0; \
  29. NEG D0Re0, #0x1; \
  30. GETD D1RtP, [A0StP+#-4]; \
  31. SUB A0StP, A0StP, #0x8; \
  32. MOV PC, D1RtP;
  33. #else
  34. # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
  35. # define SYSCALL_ERROR ___syscall_error
  36. #endif
  37. #endif /* __ASSEMBLER __*/