dl-syscalls.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* We can't use the real errno in ldso, since it has not yet
  2. * been dynamicly linked in yet. */
  3. #include "sys/syscall.h"
  4. extern int _dl_errno;
  5. #undef __set_errno
  6. #define __set_errno(X) {(_dl_errno) = (X);}
  7. /* _call_via_rX calls are used in thumb ldso because of calls via
  8. * function pointers, but ldso is not linked with anything which
  9. * provides them, so define them here (only required for thumb).
  10. */
  11. #if defined(__thumb__)
  12. __asm__(
  13. ".macro call_via register\n"
  14. " .global _call_via_\\register\n"
  15. " .hidden _call_via_\\register\n"
  16. " .type _call_via_\\register, %function\n"
  17. " .thumb_func\n"
  18. "_call_via_\\register:\n"
  19. " bx \\register\n"
  20. " .size _call_via_\\register, . - _call_via_\\register\n"
  21. ".endm\n"
  22. ".text\n"
  23. ".thumb\n"
  24. ".align 1\n"
  25. " call_via r0\n"
  26. " call_via r1\n"
  27. " call_via r2\n"
  28. " call_via r3\n"
  29. " call_via r4\n"
  30. " call_via r5\n"
  31. " call_via r6\n"
  32. " call_via r7\n"
  33. " call_via r8\n"
  34. " call_via r9\n"
  35. " call_via r10\n"
  36. " call_via r11\n"
  37. " call_via r12\n"
  38. " call_via r13\n"
  39. " call_via r14\n"
  40. );
  41. #endif