From 2da9783e2b79f0c9a05087ba014bb93d03e191ea Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Sat, 12 Jul 2008 11:30:53 -0700 Subject: preserve AX across stack jump so C routines return correct value when triggering morestack. SVN=126935 --- src/runtime/runtime.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/runtime/runtime.h') diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index f7d31a1dd8..3a2e3bde9e 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -82,6 +82,7 @@ struct M { G* g0; // g0 w interrupt stack - must not move uint64 morearg; // arg to morestack - must not move + uint64 cret; // return value from C - must not move G* curg; // current running goroutine Gobuf sched; Gobuf morestack; @@ -148,6 +149,8 @@ extern int32 debug; */ int32 gogo(Gobuf*); int32 gosave(Gobuf*); +int32 gogoret(Gobuf*, uint64); +void retfromnewstack(void); void setspgoto(byte*, void(*)(void), void(*)(void)); void FLUSH(void*); void* getu(void); -- cgit v1.3