asm_mips64x.s 693 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2016 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 mips64 mips64le
  5. // +build gc
  6. #include "textflag.h"
  7. #define SYNC WORD $0xf
  8. TEXT ·RewindAndSetgid(SB),NOSPLIT|NOFRAME,$0-0
  9. // Rewind stack pointer so anything that happens on the stack
  10. // will clobber the test pattern created by the caller
  11. ADDV $(1024*8), R29
  12. // Ask signaller to setgid
  13. MOVW $1, R1
  14. SYNC
  15. MOVW R1, ·Baton(SB)
  16. SYNC
  17. // Wait for setgid completion
  18. loop:
  19. SYNC
  20. MOVW ·Baton(SB), R1
  21. OR R2, R2, R2 // hint that we're in a spin loop
  22. BNE R1, loop
  23. SYNC
  24. // Restore stack
  25. ADDV $(-1024*8), R29
  26. RET