aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2012-02-07 19:26:30 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-02-07 19:26:30 +0000
commitb806269c9bfe8527dae3f634f5696ec95c5c38e4 (patch)
tree7a4a7ef3281dc5d38c6298df6b666d0b18f5eb8f /libgo/go/syscall
parent85dcef0d4194393a9de3cec41fc41331b62a909f (diff)
downloadgcc-b806269c9bfe8527dae3f634f5696ec95c5c38e4.zip
gcc-b806269c9bfe8527dae3f634f5696ec95c5c38e4.tar.gz
gcc-b806269c9bfe8527dae3f634f5696ec95c5c38e4.tar.bz2
compiler, libgo: Use //extern comments rather than __asm__.
From-SVN: r183981
Diffstat (limited to 'libgo/go/syscall')
-rw-r--r--libgo/go/syscall/mksyscall.awk4
-rw-r--r--libgo/go/syscall/syscall_unix.go11
2 files changed, 9 insertions, 6 deletions
diff --git a/libgo/go/syscall/mksyscall.awk b/libgo/go/syscall/mksyscall.awk
index b02989c..8da0234 100644
--- a/libgo/go/syscall/mksyscall.awk
+++ b/libgo/go/syscall/mksyscall.awk
@@ -96,8 +96,8 @@ BEGIN {
cfnresult = line
printf("// Automatically generated wrapper for %s/%s\n", gofnname, cfnname)
- printf("func c_%s(%s) %s%s__asm__(\"%s\")\n",
- cfnname, cfnparams, cfnresult, cfnresult == "" ? "" : " ", cfnname)
+ printf("//extern %s\n", cfnname)
+ printf("func c_%s(%s) %s\n", cfnname, cfnparams, cfnresult)
printf("func %s(%s) %s%s%s%s{\n",
gofnname, gofnparams, gofnresults == "" ? "" : "(", gofnresults,
gofnresults == "" ? "" : ")", gofnresults == "" ? "" : " ")
diff --git a/libgo/go/syscall/syscall_unix.go b/libgo/go/syscall/syscall_unix.go
index fb8986c..98e7d68 100644
--- a/libgo/go/syscall/syscall_unix.go
+++ b/libgo/go/syscall/syscall_unix.go
@@ -18,8 +18,11 @@ var (
Stderr = 2
)
-func c_syscall32(trap int32, a1, a2, a3, a4, a5, a6 int32) int32 __asm__ ("syscall");
-func c_syscall64(trap int64, a1, a2, a3, a4, a5, a6 int64) int64 __asm__ ("syscall");
+//extern syscall
+func c_syscall32(trap int32, a1, a2, a3, a4, a5, a6 int32) int32
+
+//extern syscall
+func c_syscall64(trap int64, a1, a2, a3, a4, a5, a6 int64) int64
const darwinAMD64 = runtime.GOOS == "darwin" && runtime.GOARCH == "amd64"
@@ -46,7 +49,7 @@ func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
var r uintptr
if unsafe.Sizeof(r) == 4 {
r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3),
- int32(a4), int32(a5), int32(a6))
+ int32(a4), int32(a5), int32(a6))
r = uintptr(r1)
} else {
r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3),
@@ -75,7 +78,7 @@ func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errn
var r uintptr
if unsafe.Sizeof(r) == 4 {
r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3),
- int32(a4), int32(a5), int32(a6))
+ int32(a4), int32(a5), int32(a6))
r = uintptr(r1)
} else {
r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3),