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
092b7cfb
Commit
092b7cfb
authored
Mar 22, 2013
by
Shenghou Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime/cgo, go/build: re-enable cgo for FreeBSD/ARM.
R=dave, rsc CC=golang-dev
https://golang.org/cl/7970043
parent
81d26e38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
build.go
src/pkg/go/build/build.go
+1
-0
gcc_freebsd_arm.c
src/pkg/runtime/cgo/gcc_freebsd_arm.c
+13
-1
No files found.
src/pkg/go/build/build.go
View file @
092b7cfb
...
...
@@ -262,6 +262,7 @@ var cgoEnabled = map[string]bool{
"darwin/amd64"
:
true
,
"freebsd/386"
:
true
,
"freebsd/amd64"
:
true
,
"freebsd/arm"
:
true
,
"linux/386"
:
true
,
"linux/amd64"
:
true
,
"linux/arm"
:
true
,
...
...
src/pkg/runtime/cgo/gcc_freebsd_arm.c
View file @
092b7cfb
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include <sys/types.h>
#include <machine/sysarch.h>
#include <pthread.h>
#include <string.h>
#include "libcgo.h"
...
...
@@ -22,10 +24,20 @@ void x_cgo_load_gm(void) __attribute__((naked));
void
__aeabi_read_tp
(
void
)
{
// read @ 0xffff1000
__asm__
__volatile__
(
#ifdef ARM_TP_ADDRESS
// ARM_TP_ADDRESS is (ARM_VECTORS_HIGH + 0x1000) or 0xffff1000
// GCC inline asm doesn't provide a way to provide a constant
// to "ldr r0, =??" pseudo instruction, so we hardcode the value
// and check it with cpp.
#if ARM_TP_ADDRESS != 0xffff1000
#error Wrong ARM_TP_ADDRESS!
#endif
"ldr r0, =0xffff1000
\n\t
"
"ldr r0, [r0]
\n\t
"
#else
"mrc p15, 0, r0, c13, c0, 3
\n\t
"
#endif
"mov pc, lr
\n\t
"
);
}
...
...
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