Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
d08f0067
Commit
d08f0067
authored
Aug 11, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commentary about extern register
R=rsc DELTA=16 (12 added, 0 deleted, 4 changed) OCL=33030 CL=33035
parent
fed04352
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
runtime.h
src/pkg/runtime/runtime.h
+15
-3
No files found.
src/pkg/runtime/runtime.h
View file @
d08f0067
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment