Revert "liblink, cmd/ld, runtime: remove stackguard1"

This reverts commit ab0535ae3f.

I think it will remain useful to distinguish code that must
run on a system stack from code that can run on either stack,
even if that distinction is no
longer based on the implementation language.

That is, I expect to add a //go:systemstack comment that,
in terms of the old implementation, tells the compiler,
to pretend this function was written in C.

Change-Id: I33d2ebb2f99ae12496484c6ec8ed07233d693275
Reviewed-on: https://go-review.googlesource.com/2275
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Russ Cox 2015-01-05 16:29:21 +00:00
parent a1c9e10371
commit e6d3511264
27 changed files with 192 additions and 72 deletions

View file

@ -64,7 +64,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
}
mp.mallocing = 1
if mp.curg != nil {
mp.curg.stackguard = ^uintptr(0xfff) | 0xbad
mp.curg.stackguard0 = ^uintptr(0xfff) | 0xbad
}
}
@ -127,7 +127,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
}
mp.mallocing = 0
if mp.curg != nil {
mp.curg.stackguard = mp.curg.stack.lo + _StackGuard
mp.curg.stackguard0 = mp.curg.stack.lo + _StackGuard
}
// Note: one releasem for the acquirem just above.
// The other for the acquirem at start of malloc.
@ -319,7 +319,7 @@ marked:
}
mp.mallocing = 0
if mp.curg != nil {
mp.curg.stackguard = mp.curg.stack.lo + _StackGuard
mp.curg.stackguard0 = mp.curg.stack.lo + _StackGuard
}
// Note: one releasem for the acquirem just above.
// The other for the acquirem at start of malloc.