mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
a1c9e10371
commit
e6d3511264
27 changed files with 192 additions and 72 deletions
|
|
@ -154,10 +154,14 @@ type stack struct {
|
|||
type g struct {
|
||||
// Stack parameters.
|
||||
// stack describes the actual stack memory: [stack.lo, stack.hi).
|
||||
// stackguard is the stack pointer compared in the Go stack growth prologue.
|
||||
// stackguard0 is the stack pointer compared in the Go stack growth prologue.
|
||||
// It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption.
|
||||
stack stack // offset known to runtime/cgo
|
||||
stackguard uintptr // offset known to liblink
|
||||
// stackguard1 is the stack pointer compared in the C stack growth prologue.
|
||||
// It is stack.lo+StackGuard on g0 and gsignal stacks.
|
||||
// It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
|
||||
stack stack // offset known to runtime/cgo
|
||||
stackguard0 uintptr // offset known to liblink
|
||||
stackguard1 uintptr // offset known to liblink
|
||||
|
||||
_panic *_panic // innermost panic - offset known to liblink
|
||||
_defer *_defer // innermost defer
|
||||
|
|
@ -171,7 +175,7 @@ type g struct {
|
|||
waitreason string // if status==gwaiting
|
||||
schedlink *g
|
||||
issystem bool // do not output in stack dump, ignore in deadlock detector
|
||||
preempt bool // preemption signal, duplicates stackguard = stackpreempt
|
||||
preempt bool // preemption signal, duplicates stackguard0 = stackpreempt
|
||||
paniconfault bool // panic (instead of crash) on unexpected fault address
|
||||
preemptscan bool // preempted g does scan for gc
|
||||
gcworkdone bool // debug: cleared at begining of gc work phase cycle, set by gcphasework, tested at end of cycle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue