Commit 4d2b3a0b authored by Russ Cox's avatar Russ Cox

runtime: fix arm build

Make mask uint32, and move down one line to match atomic_arm64.go.

Change-Id: I4867de494bc4076b7c2b3bf4fd74aa984e3ea0c8
Reviewed-on: https://go-review.googlesource.com/7854Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent b9602632
...@@ -159,8 +159,8 @@ func atomicand8(addr *uint8, v uint8) { ...@@ -159,8 +159,8 @@ func atomicand8(addr *uint8, v uint8) {
// Align down to 4 bytes and use 32-bit CAS. // Align down to 4 bytes and use 32-bit CAS.
uaddr := uintptr(unsafe.Pointer(addr)) uaddr := uintptr(unsafe.Pointer(addr))
addr32 := (*uint32)(unsafe.Pointer(uaddr &^ 3)) addr32 := (*uint32)(unsafe.Pointer(uaddr &^ 3))
mask := 0xFF << ((uaddr & 3) * 8) // little endian
word := uint32(v) << ((uaddr & 3) * 8) // little endian word := uint32(v) << ((uaddr & 3) * 8) // little endian
mask := uint32(0xFF) << ((uaddr & 3) * 8) // little endian
word |= ^mask word |= ^mask
for { for {
old := *addr32 old := *addr32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment