runtime: rename _m_ to mp [generated]

_g_, _p_, and _m_ are primarily vestiges of the C version of the
runtime, while today we prefer Go-style variable names (generally gp,
pp, and mp).

This change replaces all remaining uses of _m_ with mp. There are very
few remaining and all replacements are trivial.

[git-generate]
cd src/runtime

rf 'mv canpanic._m_ canpanic.mp'
GOOS=solaris \
  rf 'mv semasleep._m_ semasleep.mp'
GOOS=aix GOARCH=ppc64 \
  rf 'mv semasleep._m_ semasleep.mp'

Change-Id: I83690f7b4d4dc57557963100e9a2560ff343f3e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/307813
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Michael Pratt 2021-04-01 17:01:51 -04:00
parent b54bdd281e
commit f8779b9e75
3 changed files with 28 additions and 28 deletions

View file

@ -329,20 +329,20 @@ func semacreate(mp *m) {
//go:nosplit
func semasleep(ns int64) int32 {
_m_ := getg().m
mp := getg().m
if ns >= 0 {
_m_.ts.tv_sec = ns / 1000000000
_m_.ts.tv_nsec = ns % 1000000000
mp.ts.tv_sec = ns / 1000000000
mp.ts.tv_nsec = ns % 1000000000
_m_.libcall.fn = uintptr(unsafe.Pointer(&libc_sem_reltimedwait_np))
_m_.libcall.n = 2
_m_.scratch = mscratch{}
_m_.scratch.v[0] = _m_.waitsema
_m_.scratch.v[1] = uintptr(unsafe.Pointer(&_m_.ts))
_m_.libcall.args = uintptr(unsafe.Pointer(&_m_.scratch))
asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&_m_.libcall))
if *_m_.perrno != 0 {
if *_m_.perrno == _ETIMEDOUT || *_m_.perrno == _EAGAIN || *_m_.perrno == _EINTR {
mp.libcall.fn = uintptr(unsafe.Pointer(&libc_sem_reltimedwait_np))
mp.libcall.n = 2
mp.scratch = mscratch{}
mp.scratch.v[0] = mp.waitsema
mp.scratch.v[1] = uintptr(unsafe.Pointer(&mp.ts))
mp.libcall.args = uintptr(unsafe.Pointer(&mp.scratch))
asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&mp.libcall))
if *mp.perrno != 0 {
if *mp.perrno == _ETIMEDOUT || *mp.perrno == _EAGAIN || *mp.perrno == _EINTR {
return -1
}
throw("sem_reltimedwait_np")
@ -350,16 +350,16 @@ func semasleep(ns int64) int32 {
return 0
}
for {
_m_.libcall.fn = uintptr(unsafe.Pointer(&libc_sem_wait))
_m_.libcall.n = 1
_m_.scratch = mscratch{}
_m_.scratch.v[0] = _m_.waitsema
_m_.libcall.args = uintptr(unsafe.Pointer(&_m_.scratch))
asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&_m_.libcall))
if _m_.libcall.r1 == 0 {
mp.libcall.fn = uintptr(unsafe.Pointer(&libc_sem_wait))
mp.libcall.n = 1
mp.scratch = mscratch{}
mp.scratch.v[0] = mp.waitsema
mp.libcall.args = uintptr(unsafe.Pointer(&mp.scratch))
asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&mp.libcall))
if mp.libcall.r1 == 0 {
break
}
if *_m_.perrno == _EINTR {
if *mp.perrno == _EINTR {
continue
}
throw("sem_wait")