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
60b1a17b
Commit
60b1a17b
authored
Nov 18, 2009
by
Devon H. O'Dell
Committed by
Russ Cox
Nov 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More FreeBSD-touchups. Thundercats are GOOOOO!
R=rsc CC=golang-dev
https://golang.org/cl/157074
parent
eac41e7e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
26 deletions
+28
-26
misc/cgo/stdio/test.bash
misc/cgo/stdio/test.bash
+0
-2
src/cmd/6l/obj.c
src/cmd/6l/obj.c
+2
-3
src/cmd/8l/obj.c
src/cmd/8l/obj.c
+3
-7
src/libcgo/freebsd_386.c
src/libcgo/freebsd_386.c
+12
-6
src/libcgo/freebsd_amd64.c
src/libcgo/freebsd_amd64.c
+3
-0
src/pkg/runtime/freebsd/386/sys.s
src/pkg/runtime/freebsd/386/sys.s
+6
-8
src/pkg/runtime/proc.c
src/pkg/runtime/proc.c
+2
-0
No files found.
misc/cgo/stdio/test.bash
View file @
60b1a17b
...
...
@@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
if
[
"
$(
uname
)
"
=
"FreeBSD"
]
;
then
exit
0
;
fi
set
-e
gomake hello fib chain
echo
'*'
hello
>
run.out
...
...
src/cmd/6l/obj.c
View file @
60b1a17b
...
...
@@ -150,10 +150,9 @@ main(int argc, char *argv[])
if
(
strcmp
(
goos
,
"darwin"
)
==
0
)
HEADTYPE
=
6
;
else
if
(
strcmp
(
goos
,
"freebsd"
)
==
0
)
{
debug
[
'd'
]
=
1
;
/* no dynamic syms for now */
if
(
strcmp
(
goos
,
"freebsd"
)
==
0
)
HEADTYPE
=
9
;
}
else
else
print
(
"goos is not known: %s
\n
"
,
goos
);
}
...
...
src/cmd/8l/obj.c
View file @
60b1a17b
...
...
@@ -158,10 +158,9 @@ main(int argc, char *argv[])
if
(
strcmp
(
goos
,
"nacl"
)
==
0
)
HEADTYPE
=
8
;
else
if
(
strcmp
(
goos
,
"freebsd"
)
==
0
)
{
debug
[
'd'
]
=
1
;
/* no dynamic syms for now */
if
(
strcmp
(
goos
,
"freebsd"
)
==
0
)
HEADTYPE
=
9
;
}
else
else
print
(
"goos is not known: %sn"
,
goos
);
}
...
...
@@ -241,10 +240,7 @@ main(int argc, char *argv[])
* Also known to ../../pkg/runtime/linux/386/sys.s
* and ../../libcgo/linux_386.c.
*/
if
(
HEADTYPE
==
7
)
tlsoffset
=
-
8
;
else
tlsoffset
=
0
;
tlsoffset
=
-
8
;
elfinit
();
HEADR
=
ELFRESERVE
;
if
(
INITTEXT
==
-
1
)
...
...
src/libcgo/freebsd_386.c
View file @
60b1a17b
...
...
@@ -6,15 +6,13 @@
#include "libcgo.h"
static
void
*
threadentry
(
void
*
);
static
pthread_key_t
k1
,
k2
;
/* gccism: arrange for inittls to be called at dynamic load time */
static
void
inittls
(
void
)
__attribute__
((
constructor
))
;
char
*
environ
[]
=
{
0
};
char
*
__progname
;
static
void
inittls
(
void
)
{
/* unimplemented for now */
}
void
...
...
@@ -51,8 +49,16 @@ threadentry(void *v)
*/
ts
.
g
->
stackguard
=
(
uintptr
)
&
ts
-
ts
.
g
->
stackguard
+
4096
;
pthread_setspecific
(
k1
,
(
void
*
)
ts
.
g
);
pthread_setspecific
(
k2
,
(
void
*
)
ts
.
m
);
/*
* Set specific keys. On FreeBSD/ELF, the thread local storage
* is just before %gs:0. Our dynamic 8.out's reserve 8 bytes
* for the two words g and m at %gs:-8 and %gs:-4.
*/
asm
volatile
(
"movl %0, %%gs:-8
\n
"
// MOVL g, -8(GS)
"movl %1, %%gs:-4
\n
"
// MOVL m, -4(GS)
::
"r"
(
ts
.
g
),
"r"
(
ts
.
m
)
);
crosscall_386
(
ts
.
fn
);
return
nil
;
...
...
src/libcgo/freebsd_amd64.c
View file @
60b1a17b
...
...
@@ -7,6 +7,9 @@
static
void
*
threadentry
(
void
*
);
char
*
environ
[]
=
{
0
};
char
*
__progname
;
void
initcgo
(
void
)
{
...
...
src/pkg/runtime/freebsd/386/sys.s
View file @
60b1a17b
...
...
@@ -19,8 +19,8 @@ TEXT thr_new(SB),7,$-4
RET
TEXT
thr_start
(
SB
),7,$0
MOVL
mm
+
0
(
FP
),
AX
MOVL
m_g0
(
AX
),
BX
MOVL
mm
+
0
(
FP
),
AX
MOVL
m_g0
(
AX
),
BX
LEAL
m_tls
(
AX
),
BP
MOVL
0
(
BP
),
DI
ADDL
$
7
,
DI
...
...
@@ -132,7 +132,8 @@ int i386_set_ldt(int, const union ldt_entry *, int);
//
setldt
(
int
entry
,
int
address
,
int
limit
)
TEXT
setldt
(
SB
),7,$32
MOVL
address
+
4
(
FP
),
BX
//
aka
base
MOVL
limit
+
8
(
FP
),
CX
//
see
comment
in
linux
/
386
/
sys
.
s
; freebsd is similar
ADDL
$
0x8
,
BX
//
set
up
data_desc
LEAL
16
(
SP
),
AX
//
struct
data_desc
...
...
@@ -145,11 +146,8 @@ TEXT setldt(SB),7,$32
SHRL
$
8
,
BX
MOVB
BX
,
7
(
AX
)
MOVW
CX
,
0
(
AX
)
SHRL
$
16
,
CX
ANDL
$
0x0F
,
CX
ORL
$
0x40
,
CX
//
32
-
bit
operand
size
MOVB
CX
,
6
(
AX
)
MOVW
$
0xffff
,
0
(
AX
)
MOVB
$
0xCF
,
6
(
AX
)
//
32
-
bit
operand
,
4
k
limit
unit
,
4
more
bits
of
limit
MOVB
$
0xF2
,
5
(
AX
)
//
r
/
w
data
descriptor
,
dpl
=
3
,
present
...
...
src/pkg/runtime/proc.c
View file @
60b1a17b
...
...
@@ -385,6 +385,8 @@ starttheworld(void)
void
mstart
(
void
)
{
if
(
g
!=
m
->
g0
)
throw
(
"bad mstart"
);
if
(
m
->
mcache
==
nil
)
m
->
mcache
=
allocmcache
();
minit
();
...
...
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