aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.h
diff options
context:
space:
mode:
authorNigel Tao <nigeltao@golang.org>2012-10-19 11:02:32 +1100
committerNigel Tao <nigeltao@golang.org>2012-10-19 11:02:32 +1100
commit90ad6a2d111d10b60fd5b7f5d46fd224635d5024 (patch)
tree32d9b38d682cf20613a7a9561d8487edb328657f /src/pkg/runtime/runtime.h
parent5abf4bdc2775e4514f9cf8e2bf842f685eba2fd8 (diff)
downloadgo-90ad6a2d111d10b60fd5b7f5d46fd224635d5024.tar.xz
runtime: update comment for the "extern register" variables g and m.
R=rsc, minux.ma, ality CC=dave, golang-dev https://golang.org/cl/6620050
Diffstat (limited to 'src/pkg/runtime/runtime.h')
-rw-r--r--src/pkg/runtime/runtime.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 0b0931fe93..4394f38057 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -82,19 +82,18 @@ typedef struct ParFor ParFor;
typedef struct ParForThread ParForThread;
/*
- * per-cpu declaration.
- * "extern register" is a special storage class implemented by 6c, 8c, etc.
- * on machines with lots of registers, it allocates a register that will not be
- * used in generated code. on the x86, it allocates a slot indexed by a
- * segment register.
+ * Per-CPU declaration.
*
- * amd64: allocated downwards from R15
- * x86: allocated upwards from 0(GS)
- * arm: allocated downwards from R10
+ * "extern register" is a special storage class implemented by 6c, 8c, etc.
+ * On the ARM, it is an actual register; elsewhere it is a slot in thread-
+ * local storage indexed by a segment register. See zasmhdr in
+ * src/cmd/dist/buildruntime.c for details, and be aware that the linker may
+ * make further OS-specific changes to the compiler's output. For example,
+ * 6l/linux rewrites 0(GS) as -16(FS).
*
- * every C file linked into a Go program must include runtime.h
- * so that the C compiler knows to avoid other uses of these registers.
- * the Go compilers know to avoid them.
+ * Every C file linked into a Go program must include runtime.h so that the
+ * C compiler (6c, 8c, etc.) knows to avoid other uses of these dedicated
+ * registers. The Go compiler (6g, 8g, etc.) knows to avoid them.
*/
extern register G* g;
extern register M* m;