diff mbox

[libgo] : Move Iopl and Ioperm to 368/amd64 specific libcall_linux_*.go files.

Message ID mcrr4z3mazi.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 13, 2012, 11:36 p.m. UTC
David Daney <david.daney@cavium.com> writes:

> As discussed several months ago, libgo will not run on mips because it
> references the x86 specific system calls iopl() and ioperm().  These
> system calls do not exist in mips*-linux, so we move them to new
> 368/amd64 specific libcall_linux_*.go files.
>
> The attached patch was tested on x86_64-linux-gnu with no libgo
> failures.  There are still some other problems with mips*-linux, but
> this makes forward progress.
>
> It is unclear what kind of change log is required, so I do not supply one.
>
> Cavium, Inc. should now have a corporate contributor license agreement
> on file, so I think you can commit this upstream if acceptable.

Thanks for the patch, and sorry for the delay.  The copyright issues are
sorted.  The syntax has changed slightly (int -> error), and the calls
are also supported on Alpha.  Bootstrapped on x86_64-unknown-linux-gnu.
Committed to mainline as follows.

Ian
diff mbox

Patch

diff -r 69eedc90c707 libgo/go/syscall/libcall_linux.go
--- a/libgo/go/syscall/libcall_linux.go	Fri Jan 13 15:22:41 2012 -0800
+++ b/libgo/go/syscall/libcall_linux.go	Fri Jan 13 15:33:45 2012 -0800
@@ -207,12 +207,6 @@ 
 // //sysnb	Gettid() (tid int)
 // //gettid() Pid_t
 
-//sys	Ioperm(from int, num int, on int) (err error)
-//ioperm(from _C_long, num _C_long, on int) int
-
-//sys	Iopl(level int) (err error)
-//iopl(level int) int
-
 // FIXME: mksysinfo linux_dirent
 //    Or just abandon this function.
 // //sys	Getdents(fd int, buf []byte) (n int, err error)
@@ -278,19 +272,19 @@ 
 func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
 	var lroff _loff_t
 	var plroff *_loff_t
-	if (roff != nil) {
+	if roff != nil {
 		plroff = &lroff
 	}
 	var lwoff _loff_t
 	var plwoff *_loff_t
-	if (woff != nil) {
+	if woff != nil {
 		plwoff = &lwoff
 	}
 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
-	if (roff != nil) {
+	if roff != nil {
 		*roff = int64(lroff)
 	}
-	if (woff != nil) {
+	if woff != nil {
 		*woff = int64(lwoff)
 	}
 	return
diff -r 69eedc90c707 libgo/go/syscall/libcall_linux_386.go
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/go/syscall/libcall_linux_386.go	Fri Jan 13 15:33:45 2012 -0800
@@ -0,0 +1,13 @@ 
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// GNU/Linux library calls 386 specific.
+
+package syscall
+
+//sys	Ioperm(from int, num int, on int) (err error)
+//ioperm(from _C_long, num _C_long, on int) int
+
+//sys	Iopl(level int) (err error)
+//iopl(level int) int
diff -r 69eedc90c707 libgo/go/syscall/libcall_linux_alpha.go
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/go/syscall/libcall_linux_alpha.go	Fri Jan 13 15:33:45 2012 -0800
@@ -0,0 +1,13 @@ 
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// GNU/Linux library calls Alpha specific.
+
+package syscall
+
+//sys	Ioperm(from int, num int, on int) (err error)
+//ioperm(from _C_long, num _C_long, on int) int
+
+//sys	Iopl(level int) (err error)
+//iopl(level int) int
diff -r 69eedc90c707 libgo/go/syscall/libcall_linux_amd64.go
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/go/syscall/libcall_linux_amd64.go	Fri Jan 13 15:33:45 2012 -0800
@@ -0,0 +1,13 @@ 
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// GNU/Linux library calls amd64 specific.
+
+package syscall
+
+//sys	Ioperm(from int, num int, on int) (err error)
+//ioperm(from _C_long, num _C_long, on int) int
+
+//sys	Iopl(level int) (err error)
+//iopl(level int) int