Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
fec7aa95
Commit
fec7aa95
authored
Jan 19, 2012
by
Shenghou Ma
Committed by
Russ Cox
Jan 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: update out-of-date comments about runtime/cgo
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5532100
parent
7b07310a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
20 deletions
+20
-20
src/cmd/6l/obj.c
src/cmd/6l/obj.c
+3
-3
src/cmd/8l/obj.c
src/cmd/8l/obj.c
+3
-3
src/make.bash
src/make.bash
+1
-1
src/pkg/runtime/cgo/gcc_darwin_386.c
src/pkg/runtime/cgo/gcc_darwin_386.c
+2
-2
src/pkg/runtime/cgo/gcc_darwin_amd64.c
src/pkg/runtime/cgo/gcc_darwin_amd64.c
+2
-2
src/pkg/runtime/mkasmh.sh
src/pkg/runtime/mkasmh.sh
+4
-4
src/pkg/runtime/runtime.h
src/pkg/runtime/runtime.h
+2
-2
src/pkg/runtime/sys_darwin_386.s
src/pkg/runtime/sys_darwin_386.s
+1
-1
src/pkg/runtime/sys_darwin_amd64.s
src/pkg/runtime/sys_darwin_amd64.s
+2
-2
No files found.
src/cmd/6l/obj.c
View file @
fec7aa95
...
@@ -190,7 +190,7 @@ main(int argc, char *argv[])
...
@@ -190,7 +190,7 @@ main(int argc, char *argv[])
case
Hdarwin
:
/* apple MACH */
case
Hdarwin
:
/* apple MACH */
/*
/*
* OS X system constant - offset from 0(GS) to our TLS.
* OS X system constant - offset from 0(GS) to our TLS.
* Explained in ../../
libcgo/
darwin_amd64.c.
* Explained in ../../
pkg/runtime/cgo/gcc_
darwin_amd64.c.
*/
*/
tlsoffset
=
0x8a0
;
tlsoffset
=
0x8a0
;
machoinit
();
machoinit
();
...
@@ -209,8 +209,8 @@ main(int argc, char *argv[])
...
@@ -209,8 +209,8 @@ main(int argc, char *argv[])
/*
/*
* ELF uses TLS offset negative from FS.
* ELF uses TLS offset negative from FS.
* Translate 0(FS) and 8(FS) into -16(FS) and -8(FS).
* Translate 0(FS) and 8(FS) into -16(FS) and -8(FS).
* Also known to ../../pkg/runtime/
linux/amd64/sys
.s
* Also known to ../../pkg/runtime/
sys_linux_amd64
.s
* and ../../
libcgo/linux_amd64.s
.
* and ../../
pkg/runtime/cgo/gcc_linux_amd64.c
.
*/
*/
tlsoffset
=
-
16
;
tlsoffset
=
-
16
;
elfinit
();
elfinit
();
...
...
src/cmd/8l/obj.c
View file @
fec7aa95
...
@@ -218,7 +218,7 @@ main(int argc, char *argv[])
...
@@ -218,7 +218,7 @@ main(int argc, char *argv[])
case
Hdarwin
:
/* apple MACH */
case
Hdarwin
:
/* apple MACH */
/*
/*
* OS X system constant - offset from %gs to our TLS.
* OS X system constant - offset from %gs to our TLS.
* Explained in ../../
libcgo/
darwin_386.c.
* Explained in ../../
pkg/runtime/cgo/gcc_
darwin_386.c.
*/
*/
tlsoffset
=
0x468
;
tlsoffset
=
0x468
;
machoinit
();
machoinit
();
...
@@ -237,8 +237,8 @@ main(int argc, char *argv[])
...
@@ -237,8 +237,8 @@ main(int argc, char *argv[])
/*
/*
* ELF uses TLS offsets negative from %gs.
* ELF uses TLS offsets negative from %gs.
* Translate 0(GS) and 4(GS) into -8(GS) and -4(GS).
* Translate 0(GS) and 4(GS) into -8(GS) and -4(GS).
* Also known to ../../pkg/runtime/
linux/386/sys
.s
* Also known to ../../pkg/runtime/
sys_linux_386
.s
* and ../../
libcgo/
linux_386.c.
* and ../../
pkg/runtime/cgo/gcc_
linux_386.c.
*/
*/
tlsoffset
=
-
8
;
tlsoffset
=
-
8
;
elfinit
();
elfinit
();
...
...
src/make.bash
View file @
fec7aa95
...
@@ -75,7 +75,7 @@ $USE_GO_TOOL ||
...
@@ -75,7 +75,7 @@ $USE_GO_TOOL ||
)
||
exit
1
)
||
exit
1
bash
"
$GOROOT
"
/src/clean.bash
bash
"
$GOROOT
"
/src/clean.bash
# pkg builds
lib
cgo and the Go programs in cmd.
# pkg builds
runtime/
cgo and the Go programs in cmd.
for
i
in
lib9 libbio libmach cmd
for
i
in
lib9 libbio libmach cmd
do
do
echo
;
echo
;
echo
%%%% making
$i
%%%%
;
echo
echo
;
echo
;
echo
%%%% making
$i
%%%%
;
echo
...
...
src/pkg/runtime/cgo/gcc_darwin_386.c
View file @
fec7aa95
...
@@ -39,8 +39,8 @@ inittls(void)
...
@@ -39,8 +39,8 @@ inittls(void)
*
*
* The linker and runtime hard-code these constant offsets
* The linker and runtime hard-code these constant offsets
* from %gs where we expect to find m and g.
* from %gs where we expect to find m and g.
* Known to ../cmd/8l/obj.c:/468
* Known to ../
../../
cmd/8l/obj.c:/468
* and to ../
pkg/runtime/darwin/386/sys
.s:/468
* and to ../
sys_darwin_386
.s:/468
*
*
* This is truly disgusting and a bit fragile, but taking care
* This is truly disgusting and a bit fragile, but taking care
* of it here protects the rest of the system from damage.
* of it here protects the rest of the system from damage.
...
...
src/pkg/runtime/cgo/gcc_darwin_amd64.c
View file @
fec7aa95
...
@@ -27,8 +27,8 @@ inittls(void)
...
@@ -27,8 +27,8 @@ inittls(void)
*
*
* The linker and runtime hard-code these constant offsets
* The linker and runtime hard-code these constant offsets
* from %gs where we expect to find m and g.
* from %gs where we expect to find m and g.
* Known to ../cmd/6l/obj.c:/8a0
* Known to ../
../../
cmd/6l/obj.c:/8a0
* and to ../
pkg/runtime/darwin/amd64/sys
.s:/8a0
* and to ../
sys_darwin_amd64
.s:/8a0
*
*
* As disgusting as on the 386; same justification.
* As disgusting as on the 386; same justification.
*/
*/
...
...
src/pkg/runtime/mkasmh.sh
View file @
fec7aa95
...
@@ -34,8 +34,8 @@ case "$GOARCH" in
...
@@ -34,8 +34,8 @@ case "$GOARCH" in
386
)
386
)
# The offsets 0 and 4 are also known to:
# The offsets 0 and 4 are also known to:
# ../../cmd/8l/pass.c:/D_GS
# ../../cmd/8l/pass.c:/D_GS
#
../../libcgo/
linux_386.c:/^threadentry
#
cgo/gcc_
linux_386.c:/^threadentry
#
../../libcgo/
darwin_386.c:/^threadentry
#
cgo/gcc_
darwin_386.c:/^threadentry
case
"
$GOOS
"
in
case
"
$GOOS
"
in
windows
)
windows
)
echo
'#define get_tls(r) MOVL 0x14(FS), r'
echo
'#define get_tls(r) MOVL 0x14(FS), r'
...
@@ -89,8 +89,8 @@ amd64)
...
@@ -89,8 +89,8 @@ amd64)
*
)
*
)
# The offsets 0 and 8 are known to:
# The offsets 0 and 8 are known to:
# ../../cmd/6l/pass.c:/D_GS
# ../../cmd/6l/pass.c:/D_GS
#
../../libcgo/
linux_amd64.c:/^threadentry
#
cgo/gcc_
linux_amd64.c:/^threadentry
#
../../libcgo/
darwin_amd64.c:/^threadentry
#
cgo/gcc_
darwin_amd64.c:/^threadentry
#
#
echo
'#define get_tls(r)'
echo
'#define get_tls(r)'
echo
'#define g(r) 0(GS)'
echo
'#define g(r) 0(GS)'
...
...
src/pkg/runtime/runtime.h
View file @
fec7aa95
...
@@ -168,8 +168,8 @@ struct Gobuf
...
@@ -168,8 +168,8 @@ struct Gobuf
};
};
struct
G
struct
G
{
{
byte
*
stackguard
;
// cannot move - also known to linker, libmach,
lib
cgo
byte
*
stackguard
;
// cannot move - also known to linker, libmach,
runtime/
cgo
byte
*
stackbase
;
// cannot move - also known to libmach,
lib
cgo
byte
*
stackbase
;
// cannot move - also known to libmach,
runtime/
cgo
Defer
*
defer
;
Defer
*
defer
;
Panic
*
panic
;
Panic
*
panic
;
Gobuf
sched
;
Gobuf
sched
;
...
...
src/pkg/runtime/sys_darwin_386.s
View file @
fec7aa95
...
@@ -338,7 +338,7 @@ TEXT runtime·setldt(SB),7,$32
...
@@ -338,7 +338,7 @@ TEXT runtime·setldt(SB),7,$32
*
To
accommodate
that
rewrite
,
we
translate
the
*
To
accommodate
that
rewrite
,
we
translate
the
*
address
and
limit
here
so
that
0x468
(
GS
)
maps
to
0
(
address
)
.
*
address
and
limit
here
so
that
0x468
(
GS
)
maps
to
0
(
address
)
.
*
*
*
See
..
/
..
/
..
/
..
/
libcgo
/
darwin_386
.
c
for
the
derivation
*
See
cgo
/
gcc_darwin_386
.
c
:
/
468
for
the
derivation
*
of
the
constant
.
*
of
the
constant
.
*/
*/
SUBL
$
0x468
,
BX
SUBL
$
0x468
,
BX
...
...
src/pkg/runtime/sys_darwin_amd64.s
View file @
fec7aa95
...
@@ -327,8 +327,8 @@ TEXT runtime·mach_semaphore_signal_all(SB),7,$0
...
@@ -327,8 +327,8 @@ TEXT runtime·mach_semaphore_signal_all(SB),7,$0
//
set
tls
base
to
DI
//
set
tls
base
to
DI
TEXT
runtime
·
settls
(
SB
),7,$32
TEXT
runtime
·
settls
(
SB
),7,$32
/
*
/
*
*
Same
as
in
..
/
386
/
sys
.
s
:
/
ugliness
,
different
constant
.
*
Same
as
in
sys_darwin_386
.
s
:
/
ugliness
,
different
constant
.
*
See
..
/
..
/
..
/
..
/
libcgo
/
darwin_amd64
.
c
for
the
derivation
*
See
cgo
/
gcc_
darwin_amd64
.
c
for
the
derivation
*
of
the
constant
.
*
of
the
constant
.
*/
*/
SUBQ
$
0x8a0
,
DI
SUBQ
$
0x8a0
,
DI
...
...
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