]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix linux/arm build
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 29 Jul 2013 18:59:30 +0000 (22:59 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 29 Jul 2013 18:59:30 +0000 (22:59 +0400)
notetsleep: nosplit stack overflow
        128 assumed on entry to notetsleep
        80 after notetsleep uses 48
        44 after runtime.futexsleep uses 36
        -12 after runtime.timediv uses 56

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12049043

src/pkg/runtime/lock_futex.c

index 4fabc769446535bbe385c98f9720344c18ad68aa..3f8d632363e16f5e1b74eddaa3997386ec54048d 100644 (file)
@@ -138,9 +138,11 @@ runtime·notesleep(Note *n)
 
 #pragma textflag 7
 static bool
-notetsleep(Note *n, int64 ns)
+notetsleep(Note *n, int64 ns, int64 deadline, int64 now)
 {
-       int64 deadline, now;
+       // Conceptually, deadline and now are local variables.
+       // They are passed as arguments so that the space for them
+       // does not count against our nosplit stack sequence.
 
        if(ns < 0) {
                while(runtime·atomicload((uint32*)&n->key) == 0)
@@ -174,7 +176,7 @@ runtime·notetsleep(Note *n, int64 ns)
 
        if(m->profilehz > 0)
                runtime·setprof(false);
-       res = notetsleep(n, ns);
+       res = notetsleep(n, ns, 0, 0);
        if(m->profilehz > 0)
                runtime·setprof(true);
        return res;
@@ -192,7 +194,7 @@ runtime·notetsleepg(Note *n, int64 ns)
                runtime·throw("notetsleepg on g0");
 
        runtime·entersyscallblock();
-       res = notetsleep(n, ns);
+       res = notetsleep(n, ns, 0, 0);
        runtime·exitsyscall();
        return res;
 }