From b9a49f2065732fb4ae27d24ec05e59c4ae09adb4 Mon Sep 17 00:00:00 2001 From: Howard Zhang Date: Thu, 30 Jul 2020 18:43:01 +0800 Subject: AARCH64:fix variable name collision with register name The variable name is g which is collision with the reserved name for R28. This leads to bazel build failure on ARM with following information: (register+register) not supported on this architecture rename it from g to ptr (referenced from golang source code) Signed-off-by: Howard Zhang --- pkg/syncevent/waiter_amd64.s | 4 ++-- pkg/syncevent/waiter_arm64.s | 4 ++-- pkg/syncevent/waiter_asm_unsafe.go | 2 +- pkg/syncevent/waiter_noasm_unsafe.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'pkg') diff --git a/pkg/syncevent/waiter_amd64.s b/pkg/syncevent/waiter_amd64.s index 985b56ae5..5e216b045 100644 --- a/pkg/syncevent/waiter_amd64.s +++ b/pkg/syncevent/waiter_amd64.s @@ -16,9 +16,9 @@ // See waiter_noasm_unsafe.go for a description of waiterUnlock. // -// func waiterUnlock(g unsafe.Pointer, wg *unsafe.Pointer) bool +// func waiterUnlock(ptr unsafe.Pointer, wg *unsafe.Pointer) bool TEXT ·waiterUnlock(SB),NOSPLIT,$0-24 - MOVQ g+0(FP), DI + MOVQ ptr+0(FP), DI MOVQ wg+8(FP), SI MOVQ $·preparingG(SB), AX diff --git a/pkg/syncevent/waiter_arm64.s b/pkg/syncevent/waiter_arm64.s index 20d7ac23b..f4c06f194 100644 --- a/pkg/syncevent/waiter_arm64.s +++ b/pkg/syncevent/waiter_arm64.s @@ -16,11 +16,11 @@ // See waiter_noasm_unsafe.go for a description of waiterUnlock. // -// func waiterUnlock(g unsafe.Pointer, wg *unsafe.Pointer) bool +// func waiterUnlock(ptr unsafe.Pointer, wg *unsafe.Pointer) bool TEXT ·waiterUnlock(SB),NOSPLIT,$0-24 MOVD wg+8(FP), R0 MOVD $·preparingG(SB), R1 - MOVD g+0(FP), R2 + MOVD ptr+0(FP), R2 again: LDAXR (R0), R3 CMP R1, R3 diff --git a/pkg/syncevent/waiter_asm_unsafe.go b/pkg/syncevent/waiter_asm_unsafe.go index 0995e9053..19d6b0b15 100644 --- a/pkg/syncevent/waiter_asm_unsafe.go +++ b/pkg/syncevent/waiter_asm_unsafe.go @@ -21,4 +21,4 @@ import ( ) // See waiter_noasm_unsafe.go for a description of waiterUnlock. -func waiterUnlock(g unsafe.Pointer, wg *unsafe.Pointer) bool +func waiterUnlock(ptr unsafe.Pointer, wg *unsafe.Pointer) bool diff --git a/pkg/syncevent/waiter_noasm_unsafe.go b/pkg/syncevent/waiter_noasm_unsafe.go index 1c4b0e39a..0f74a689c 100644 --- a/pkg/syncevent/waiter_noasm_unsafe.go +++ b/pkg/syncevent/waiter_noasm_unsafe.go @@ -32,8 +32,8 @@ import ( // should be aborted. // //go:nosplit -func waiterUnlock(g unsafe.Pointer, wg *unsafe.Pointer) bool { +func waiterUnlock(ptr unsafe.Pointer, wg *unsafe.Pointer) bool { // The only way this CAS can fail is if a call to Waiter.NotifyPending() // has replaced *wg with nil, in which case we should not sleep. - return atomic.CompareAndSwapPointer(wg, (unsafe.Pointer)(&preparingG), g) + return atomic.CompareAndSwapPointer(wg, (unsafe.Pointer)(&preparingG), ptr) } -- cgit v1.2.3