@@ -396,12 +396,12 @@ racecallatomic_ignore:
396
396
// Addr is outside the good range.
397
397
// Call __tsan_go_ignore_sync_begin to ignore synchronization during the atomic op.
398
398
// An attempt to synchronize on the address would cause crash.
399
- MOVD R9, R20 // remember the original function
399
+ MOVD R9, R21 // remember the original function
400
400
MOVD $__tsan_go_ignore_sync_begin(SB), R9
401
401
load_g
402
402
MOVD g_racectx(g), R0 // goroutine context
403
403
BL racecall<>(SB)
404
- MOVD R20 , R9 // restore the original function
404
+ MOVD R21 , R9 // restore the original function
405
405
// Call the atomic function.
406
406
// racecall will call LLVM race code which might clobber R28 (g)
407
407
load_g
@@ -428,10 +428,12 @@ TEXT runtime·racecall(SB), NOSPLIT, $0-0
428
428
JMP racecall<>(SB)
429
429
430
430
// Switches SP to g0 stack and calls (R9). Arguments already set.
431
- TEXT racecall<>(SB), NOSPLIT, $0 -0
431
+ // Clobbers R19, R20.
432
+ TEXT racecall<>(SB), NOSPLIT|NOFRAME, $0 -0
432
433
MOVD g_m(g), R10
433
434
// Switch to g0 stack.
434
435
MOVD RSP, R19 // callee-saved, preserved across the CALL
436
+ MOVD R30, R20 // callee-saved, preserved across the CALL
435
437
MOVD m_g0(R10), R11
436
438
CMP R11, g
437
439
BEQ call // already on g0
@@ -440,7 +442,7 @@ TEXT racecall<>(SB), NOSPLIT, $0-0
440
442
call:
441
443
BL R9
442
444
MOVD R19, RSP
443
- RET
445
+ JMP (R20)
444
446
445
447
// C->Go callback thunk that allows to call runtime·racesymbolize from C code.
446
448
// Direct Go->C race call has only switched SP, finish g->g0 switch by setting correct g.
0 commit comments