syscall_error.S 555 B

12345678910111213141516171819202122232425262728293031323334353637
  1. .align 4
  2. __syscall_error:
  3. /* Call errno_location, store '-r4' in errno and return -1 */
  4. mov.l r12, @-r15
  5. sts.l pr, @-r15
  6. #ifdef __PIC__
  7. mova .LG, r0
  8. mov.l .LG, r12
  9. add r0, r12
  10. mov.l 1f, r0
  11. mov.l @(r0,r12),r0
  12. jsr @r0
  13. neg r4, r12
  14. #else
  15. mov.l 1f, r0
  16. bsrf r0
  17. neg r4, r12
  18. .jmp_loc:
  19. #endif
  20. mov.l r12, @r0
  21. lds.l @r15+, pr
  22. mov.l @r15+,r12
  23. /* And just kick back a -1. */
  24. rts
  25. mov #-1, r0
  26. .align 4
  27. #ifdef __PIC__
  28. 1: .long __errno_location@GOT
  29. .LG: .long _GLOBAL_OFFSET_TABLE_
  30. #else
  31. 1: .long __errno_location - .jmp_loc
  32. #endif