]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix initial gp->sched.pc in newextram
authorRuss Cox <rsc@golang.org>
Thu, 6 Nov 2014 14:37:04 +0000 (09:37 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 6 Nov 2014 14:37:04 +0000 (09:37 -0500)
CL 170720043 missed this one when adding +PCQuantum.

LGTM=iant
R=r, iant
CC=golang-codereviews
https://golang.org/cl/168090043

src/runtime/proc.c

index 4be51e1e1660919cd74bac530b0061425997e7c6..91e3fe16d69ce1fb1b7c2efb7d8c70a4b20be8da 100644 (file)
@@ -990,7 +990,7 @@ runtime·newextram(void)
        // the goroutine stack ends.
        mp = runtime·allocm(nil);
        gp = runtime·malg(4096);
-       gp->sched.pc = (uintptr)runtime·goexit;
+       gp->sched.pc = (uintptr)runtime·goexit + PCQuantum;
        gp->sched.sp = gp->stack.hi;
        gp->sched.sp -= 4*sizeof(uintreg); // extra space in case of reads slightly beyond frame
        gp->sched.lr = 0;
@@ -2424,9 +2424,10 @@ static struct ProfState {
        int32 hz;
 } prof;
 
-static void System(void) {}
-static void ExternalCode(void) {}
-static void GC(void) {}
+static void System(void) { System(); }
+static void ExternalCode(void) { ExternalCode(); }
+static void GC(void) { GC(); }
+
 extern void runtime·cpuproftick(uintptr*, int32);
 extern byte runtime·etext[];