asm_s390x.s 579 B

1234567891011121314151617181920212223242526
  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 gc
  5. #include "textflag.h"
  6. TEXT ·RewindAndSetgid(SB),NOSPLIT,$0-0
  7. // Rewind stack pointer so anything that happens on the stack
  8. // will clobber the test pattern created by the caller
  9. ADD $(1024 * 8), R15
  10. // Ask signaller to setgid
  11. MOVD $·Baton(SB), R5
  12. MOVW $1, 0(R5)
  13. // Wait for setgid completion
  14. loop:
  15. SYNC
  16. MOVW ·Baton(SB), R3
  17. CMPBNE R3, $0, loop
  18. // Restore stack
  19. SUB $(1024 * 8), R15
  20. RET