signal.S 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2015, Cyril Bur, IBM Corp.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #include "../basic_asm.h"
  10. /* long signal_self(pid_t pid, int sig); */
  11. FUNC_START(signal_self)
  12. li r0,37 /* sys_kill */
  13. /* r3 already has our pid in it */
  14. /* r4 already has signal type in it */
  15. sc
  16. bc 4,3,1f
  17. subfze r3,r3
  18. 1: blr
  19. FUNC_END(signal_self)
  20. /* long tm_signal_self(pid_t pid, int sig, int *ret); */
  21. FUNC_START(tm_signal_self)
  22. PUSH_BASIC_STACK(8)
  23. std r5,STACK_FRAME_PARAM(0)(sp) /* ret */
  24. tbegin.
  25. beq 1f
  26. tsuspend.
  27. li r0,37 /* sys_kill */
  28. /* r3 already has our pid in it */
  29. /* r4 already has signal type in it */
  30. sc
  31. ld r5,STACK_FRAME_PARAM(0)(sp) /* ret */
  32. bc 4,3,2f
  33. subfze r3,r3
  34. 2: std r3,0(r5)
  35. tabort. 0
  36. tresume. /* Be nice to some cleanup, jumps back to tbegin then to 1: */
  37. /*
  38. * Transaction should be proper doomed and we should never get
  39. * here
  40. */
  41. li r3,1
  42. POP_BASIC_STACK(8)
  43. blr
  44. 1: li r3,0
  45. POP_BASIC_STACK(8)
  46. blr
  47. FUNC_END(tm_signal_self)