aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-03-24 21:22:16 -0400
committerRuss Cox <rsc@golang.org>2014-03-24 21:22:16 -0400
commit3750904a7efc36aa4f604497b53a9dc1ea67492b (patch)
tree35ee5656b00d9f5a5d0ee04e8b4ea9e65be402d1 /src/pkg/runtime/runtime.h
parent3b27343c14fdfeaa19b20b26ce660aafa814d01d (diff)
downloadgo-3750904a7efc36aa4f604497b53a9dc1ea67492b.tar.xz
runtime: use VEH, not SEH, for windows/386 exception handling
Structured Exception Handling (SEH) was the first way to handle exceptions (memory faults, divides by zero) on Windows. The S might as well stand for "stack-based": the implementation interprets stack addresses in a few different ways, and it gets subtly confused by Go's management of stacks. It's also something that requires active maintenance during cgo switches, and we've had bugs in that maintenance in the past. We have recently come to believe that SEH cannot work with Go's stack usage. See http://golang.org/issue/7325 for details. Vectored Exception Handling (VEH) is more like a Unix signal handler: you set it once for the whole process and forget about it. This CL drops all the SEH code and replaces it with VEH code. Many special cases and 7 #ifdefs disappear. VEH was introduced in Windows XP, so Go on windows/386 will now require Windows XP or later. The previous requirement was Windows 2000 or later. Windows 2000 immediately preceded Windows XP, so Windows 2000 is the only affected version. Microsoft stopped supporting Windows 2000 in 2010. See http://golang.org/s/win2000-golang-nuts for details. Fixes #7325. LGTM=alex.brainman, r R=golang-codereviews, alex.brainman, stephen.gutekanst, dave CC=golang-codereviews, iant, r https://golang.org/cl/74790043
Diffstat (limited to 'src/pkg/runtime/runtime.h')
-rw-r--r--src/pkg/runtime/runtime.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index baa751cd72..9cb6960c62 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -83,8 +83,6 @@ typedef struct Hchan Hchan;
typedef struct Complex64 Complex64;
typedef struct Complex128 Complex128;
typedef struct LibCall LibCall;
-typedef struct SEH SEH;
-typedef struct SEHUnwind SEHUnwind;
typedef struct WinCallbackContext WinCallbackContext;
typedef struct Timers Timers;
typedef struct Timer Timer;
@@ -241,18 +239,6 @@ struct LibCall
uintptr err; // error number
};
-struct SEH
-{
- void* prev;
- void* handler;
-};
-
-struct SEHUnwind
-{
- SEHUnwind* link;
- SEH* seh;
-};
-
// describes how to handle callback
struct WinCallbackContext
{
@@ -303,15 +289,6 @@ struct G
uintptr end[];
};
-// Define a symbol for windows/386 because that is the only
-// system with SEH handling, and we end up checking that
-// repeatedly.
-#ifdef GOOS_windows
-#ifdef GOARCH_386
-#define GOOSARCH_windows_386
-#endif
-#endif
-
struct M
{
G* g0; // goroutine with scheduling stack
@@ -394,8 +371,6 @@ struct M
int8* notesig;
byte* errstr;
#endif
- SEH* seh;
- SEHUnwind* sehunwind;
uintptr end[];
};
@@ -975,16 +950,6 @@ void* runtime·funcdata(Func*, int32);
int32 runtime·setmaxthreads(int32);
G* runtime·timejump(void);
-// On Windows 386, we have functions for saving and restoring
-// the SEH values; elsewhere #define them away.
-#ifdef GOOSARCH_windows_386
-SEH* runtime·getseh(void);
-void runtime·setseh(SEH*);
-#else
-#define runtime·getseh() nil
-#define runtime·setseh(x) do{}while(0)
-#endif
-
#pragma varargck argpos runtime·printf 1
#pragma varargck type "c" int32
#pragma varargck type "d" int32