Commit d08f0067 authored by Rob Pike's avatar Rob Pike

commentary about extern register

R=rsc
DELTA=16  (12 added, 0 deleted, 4 changed)
OCL=33030
CL=33035
parent fed04352
......@@ -64,10 +64,22 @@ typedef struct hash Hmap;
typedef struct Hchan Hchan;
/*
* per cpu declaration
* 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.
*
* amd64: allocated downwards from R15
* x86: allocated upwards from 0(FS)
* arm: allocated upwards from R9
*
* 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.
*/
extern register G* g; // R15
extern register M* m; // R14
extern register G* g;
extern register M* m;
/*
* defined constants
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment