summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/os_plan9.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-04 13:51:12 -0400
committerRuss Cox <rsc@golang.org>2014-09-04 13:51:12 -0400
commit86e30a6ff105c1ef0b4d421927d3b75189a63078 (patch)
tree35fc11a65268f03fcbfdc3135c8a23d8369a9867 /src/pkg/runtime/os_plan9.h
parent787642e90ea031bed3dc466b10ca83748280b62d (diff)
downloadgo-86e30a6ff105c1ef0b4d421927d3b75189a63078.tar.gz
runtime: reconvert sigqueue.goc from C to Go
The original conversion in CL 132090043 cut up the function in an attempt to avoid converting most of the code to Go. This contorts the control flow. While debugging the onM signal stack bug, I reconverted sigqueue.goc in its entirety. This restores the original control flow, which is much easier to understand. The current conversion is correct, it's just complex and will be hard to maintain. The new one is as readable as the original code. I uploaded sigqueue.goc as the initial copy of sigqueue.go in the CL, so if you view the diffs of sigqueue.go comparing against patch set 2 [sic] it will show the actual starting point. For example: https://codereview.appspot.com/136160043/diff2/20001:60001/src/pkg/runtime/sigqueue.go LGTM=dvyukov, iant R=golang-codereviews, dvyukov, iant CC=golang-codereviews, khr, r https://codereview.appspot.com/136160043
Diffstat (limited to 'src/pkg/runtime/os_plan9.h')
-rw-r--r--src/pkg/runtime/os_plan9.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/pkg/runtime/os_plan9.h b/src/pkg/runtime/os_plan9.h
index ea853dde8..57a2cafa7 100644
--- a/src/pkg/runtime/os_plan9.h
+++ b/src/pkg/runtime/os_plan9.h
@@ -79,12 +79,14 @@ struct Tos {
/* top of stack is here */
};
-#define NSIG 14 /* number of signals in runtime·SigTab array */
-#define ERRMAX 128 /* max length of note string */
+enum {
+ NSIG = 14, /* number of signals in runtime·SigTab array */
+ ERRMAX = 128, /* max length of note string */
-/* Notes in runtime·sigtab that are handled by runtime·sigpanic. */
-#define SIGRFAULT 2
-#define SIGWFAULT 3
-#define SIGINTDIV 4
-#define SIGFLOAT 5
-#define SIGTRAP 6
+ /* Notes in runtime·sigtab that are handled by runtime·sigpanic. */
+ SIGRFAULT = 2,
+ SIGWFAULT = 3,
+ SIGINTDIV = 4,
+ SIGFLOAT = 5,
+ SIGTRAP = 6,
+};