runtime: add stackguard0 to G

This is part of preemptive scheduler.
stackguard0 is checked in split stack checks and can be set to StackPreempt.
stackguard is not set to StackPreempt (holds the original value).

R=golang-dev, daniel.morsing, iant
CC=golang-dev
https://golang.org/cl/9875043
This commit is contained in:
Dmitriy Vyukov 2013-06-03 12:28:24 +04:00
parent ae43ea432d
commit f5becf4233
7 changed files with 24 additions and 1 deletions

View file

@ -157,6 +157,7 @@ runtime·oldstack(void)
label = top->gobuf;
gp->stackbase = (uintptr)top->stackbase;
gp->stackguard = (uintptr)top->stackguard;
gp->stackguard0 = gp->stackguard;
if(top->free != 0)
runtime·stackfree(old, top->free);
@ -249,6 +250,7 @@ runtime·newstack(void)
gp->stackbase = (uintptr)top;
gp->stackguard = (uintptr)stk + StackGuard;
gp->stackguard0 = gp->stackguard;
sp = (byte*)top;
if(argsize > 0) {