asm_ppc64x.s 669 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build ppc64 ppc64le
  5. // +build gc
  6. #include "textflag.h"
  7. TEXT ·RewindAndSetgid(SB),NOSPLIT|NOFRAME,$0-0
  8. // Rewind stack pointer so anything that happens on the stack
  9. // will clobber the test pattern created by the caller
  10. ADD $(1024 * 8), R1
  11. // Ask signaller to setgid
  12. MOVW $1, R3
  13. SYNC
  14. MOVW R3, ·Baton(SB)
  15. // Wait for setgid completion
  16. loop:
  17. SYNC
  18. MOVW ·Baton(SB), R3
  19. CMP R3, $0
  20. // Hint that we're in a spin loop
  21. OR R1, R1, R1
  22. BNE loop
  23. ISYNC
  24. // Restore stack
  25. SUB $(1024 * 8), R1
  26. RET