diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-29 22:22:34 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-29 22:22:34 +0400 |
| commit | e84d9e1fb3a0d87abd60d31afb9cd0ddfb7d9bfa (patch) | |
| tree | 1a0213f1250994c0734456bdcd81bb1bf5e56ee4 /src/pkg/runtime/runtime.h | |
| parent | b8734748b6b151a7fd724fc41e2555e6cd34385f (diff) | |
| download | go-e84d9e1fb3a0d87abd60d31afb9cd0ddfb7d9bfa.tar.xz | |
runtime: do not split stacks in syscall status
Split stack checks (morestack) corrupt g->sched,
but g->sched must be preserved consistent for GC/traceback.
The change implements runtime.notetsleepg function,
which does entersyscall/exitsyscall and is carefully arranged
to not call any split functions in between.
R=rsc
CC=golang-dev
https://golang.org/cl/11575044
Diffstat (limited to 'src/pkg/runtime/runtime.h')
| -rw-r--r-- | src/pkg/runtime/runtime.h | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index a5a425b575..dfd88e001e 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -222,6 +222,29 @@ struct GCStats uint64 nosyield; uint64 nsleep; }; + +struct WinCall +{ + void (*fn)(void*); + uintptr n; // number of parameters + void* args; // parameters + uintptr r1; // return values + uintptr r2; + uintptr err; // error number +}; +struct SEH +{ + void* prev; + void* handler; +}; +// describes how to handle callback +struct WinCallbackContext +{ + void* gobody; // Go function to call + uintptr argsize; // callback arguments size (in bytes) + uintptr restorestack; // adjust stack on return by (in bytes) (386 only) +}; + struct G { // stackguard0 can be set to StackPreempt as opposed to stackguard @@ -327,6 +350,7 @@ struct M #ifdef GOOS_windows void* thread; // thread handle + WinCall wincall; #endif #ifdef GOOS_plan9 int8* notesig; @@ -432,28 +456,6 @@ struct Itab void (*fun[])(void); }; -struct WinCall -{ - void (*fn)(void*); - uintptr n; // number of parameters - void* args; // parameters - uintptr r1; // return values - uintptr r2; - uintptr err; // error number -}; -struct SEH -{ - void* prev; - void* handler; -}; -// describes how to handle callback -struct WinCallbackContext -{ - void* gobody; // Go function to call - uintptr argsize; // callback arguments size (in bytes) - uintptr restorestack; // adjust stack on return by (in bytes) (386 only) -}; - #ifdef GOOS_windows enum { Windows = 1 @@ -816,6 +818,7 @@ int32 runtime·gcount(void); void runtime·mcall(void(*)(G*)); uint32 runtime·fastrand1(void); void runtime·rewindmorestack(Gobuf*); +int32 runtime·timediv(int64, int32, int32*); void runtime·setmg(M*, G*); void runtime·newextram(void); |
