]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/cgo/asm_s390x.s
runtime/cgo: store M for C-created thread in pthread key
[gostls13.git] / src / runtime / cgo / asm_s390x.s
index 8bf16e75e2c05542b963a2cc34cacd226f97783e..bb0dfc1e313d9a747a7c961a431a32fd4e8a3aae 100644 (file)
@@ -4,6 +4,14 @@
 
 #include "textflag.h"
 
+// Set the x_crosscall2_ptr C function pointer variable point to crosscall2.
+// It's such a pointer chain: _crosscall2_ptr -> x_crosscall2_ptr -> crosscall2
+TEXT ·set_crosscall2(SB),NOSPLIT,$0-0
+       MOVD    _crosscall2_ptr(SB), R1
+       MOVD    $crosscall2(SB), R2
+       MOVD    R2, (R1)
+       RET
+
 // Called by C code generated by cmd/cgo.
 // func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr)
 // Saves C callee-saved registers and calls cgocallback with three arguments.