You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/07/28 16:52:54 UTC
[6/7] incubator-mynewt-newt git commit: Re-vendor newt tool for
0.10.0 release.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/asm_dragonfly_386.s
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/asm_dragonfly_386.s b/newt/vendor/golang.org/x/sys/unix/asm_dragonfly_386.s
deleted file mode 100644
index 7e55e0d..0000000
--- a/newt/vendor/golang.org/x/sys/unix/asm_dragonfly_386.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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.
-
-// +build !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for 386, FreeBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT �Syscall(SB),NOSPLIT,$0-32
- JMP syscall�Syscall(SB)
-
-TEXT �Syscall6(SB),NOSPLIT,$0-44
- JMP syscall�Syscall6(SB)
-
-TEXT �Syscall9(SB),NOSPLIT,$0-56
- JMP syscall�Syscall9(SB)
-
-TEXT �RawSyscall(SB),NOSPLIT,$0-32
- JMP syscall�RawSyscall(SB)
-
-TEXT �RawSyscall6(SB),NOSPLIT,$0-44
- JMP syscall�RawSyscall6(SB)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/newt/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
new file mode 100644
index 0000000..1188985
--- /dev/null
+++ b/newt/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
@@ -0,0 +1,28 @@
+// Copyright 2016 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.
+
+// +build s390x
+// +build linux
+// +build !gccgo
+
+#include "textflag.h"
+
+//
+// System calls for s390x, Linux
+//
+
+// Just jump to package syscall's implementation for all these functions.
+// The runtime may know about them.
+
+TEXT �Syscall(SB),NOSPLIT,$0-56
+ BR syscall�Syscall(SB)
+
+TEXT �Syscall6(SB),NOSPLIT,$0-80
+ BR syscall�Syscall6(SB)
+
+TEXT �RawSyscall(SB),NOSPLIT,$0-56
+ BR syscall�RawSyscall(SB)
+
+TEXT �RawSyscall6(SB),NOSPLIT,$0-80
+ BR syscall�RawSyscall6(SB)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/mkall.sh
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/mkall.sh b/newt/vendor/golang.org/x/sys/unix/mkall.sh
index de95a4b..3e224c5 100644
--- a/newt/vendor/golang.org/x/sys/unix/mkall.sh
+++ b/newt/vendor/golang.org/x/sys/unix/mkall.sh
@@ -161,7 +161,7 @@ freebsd_arm)
mkerrors="$mkerrors"
mksyscall="./mksyscall.pl -l32 -arm"
mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
- # Let the type of C char be singed for making the bare syscall
+ # Let the type of C char be signed for making the bare syscall
# API consistent across over platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
@@ -194,7 +194,7 @@ linux_arm64)
exit 1
fi
mksysnum="./mksysnum_linux.pl $unistd_h"
- # Let the type of C char be singed for making the bare syscall
+ # Let the type of C char be signed for making the bare syscall
# API consistent across over platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
@@ -212,6 +212,17 @@ linux_ppc64le)
mksysnum="./mksysnum_linux.pl $unistd_h"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
+linux_s390x)
+ GOOSARCH_in=syscall_linux_s390x.go
+ unistd_h=/usr/include/asm/unistd.h
+ mkerrors="$mkerrors -m64"
+ mksysnum="./mksysnum_linux.pl $unistd_h"
+ # Let the type of C char be signed to make the bare sys
+ # API more consistent between platforms.
+ # This is a deliberate departure from the way the syscall
+ # package generates its version of the types file.
+ mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
+ ;;
netbsd_386)
mkerrors="$mkerrors -m32"
mksyscall="./mksyscall.pl -l32 -netbsd"
@@ -269,6 +280,6 @@ esac
if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
if [ -n "$mktypes" ]; then
echo "echo // +build $GOARCH,$GOOS > ztypes_$GOOSARCH.go";
- echo "$mktypes types_$GOOS.go | gofmt >>ztypes_$GOOSARCH.go";
+ echo "$mktypes types_$GOOS.go | go run mkpost.go >>ztypes_$GOOSARCH.go";
fi
) | $run
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/mkpost.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/mkpost.go b/newt/vendor/golang.org/x/sys/unix/mkpost.go
new file mode 100644
index 0000000..ed50d90
--- /dev/null
+++ b/newt/vendor/golang.org/x/sys/unix/mkpost.go
@@ -0,0 +1,62 @@
+// Copyright 2016 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.
+
+// +build ignore
+
+// mkpost processes the output of cgo -godefs to
+// modify the generated types. It is used to clean up
+// the sys API in an architecture specific manner.
+//
+// mkpost is run after cgo -godefs by mkall.sh.
+package main
+
+import (
+ "fmt"
+ "go/format"
+ "io/ioutil"
+ "log"
+ "os"
+ "regexp"
+)
+
+func main() {
+ b, err := ioutil.ReadAll(os.Stdin)
+ if err != nil {
+ log.Fatal(err)
+ }
+ s := string(b)
+
+ goarch := os.Getenv("GOARCH")
+ goos := os.Getenv("GOOS")
+ if goarch == "s390x" && goos == "linux" {
+ // Export the types of PtraceRegs fields.
+ re := regexp.MustCompile("ptrace(Psw|Fpregs|Per)")
+ s = re.ReplaceAllString(s, "Ptrace$1")
+
+ // Replace padding fields inserted by cgo with blank identifiers.
+ re = regexp.MustCompile("Pad_cgo[A-Za-z0-9_]*")
+ s = re.ReplaceAllString(s, "_")
+
+ // Replace other unwanted fields with blank identifiers.
+ re = regexp.MustCompile("X_[A-Za-z0-9_]*")
+ s = re.ReplaceAllString(s, "_")
+
+ // Replace the control_regs union with a blank identifier for now.
+ re = regexp.MustCompile("(Control_regs)\\s+\\[0\\]uint64")
+ s = re.ReplaceAllString(s, "_ [0]uint64")
+ }
+
+ // gofmt
+ b, err = format.Source([]byte(s))
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Append this command to the header to show where the new file
+ // came from.
+ re := regexp.MustCompile("(cgo -godefs [a-zA-Z0-9_]+\\.go.*)")
+ b = re.ReplaceAll(b, []byte("$1 | go run mkpost.go"))
+
+ fmt.Printf("%s", b)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_darwin.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_darwin.go b/newt/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 0d1771c..3d534d2 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -144,6 +144,7 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
uintptr(options),
0,
)
+ use(unsafe.Pointer(_p0))
if e1 != 0 {
return nil, e1
}
@@ -196,6 +197,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))
+ use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
index fbbe0dc..ec408ee 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
@@ -109,6 +109,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
+ use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly_386.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly_386.go b/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly_386.go
deleted file mode 100644
index 60fec8c..0000000
--- a/newt/vendor/golang.org/x/sys/unix/syscall_dragonfly_386.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2009 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.
-
-// +build 386,dragonfly
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func Getpagesize() int { return 4096 }
-
-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
-
-func NsecToTimespec(nsec int64) (ts Timespec) {
- ts.Sec = int32(nsec / 1e9)
- ts.Nsec = int32(nsec % 1e9)
- return
-}
-
-func NsecToTimeval(nsec int64) (tv Timeval) {
- nsec += 999 // round up to microsecond
- tv.Usec = int32(nsec % 1e9 / 1e3)
- tv.Sec = int32(nsec / 1e9)
- return
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- var writtenOut uint64 = 0
- _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)
-
- written = int(writtenOut)
-
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_freebsd.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/newt/vendor/golang.org/x/sys/unix/syscall_freebsd.go
index ec56ed6..520ccbe 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_freebsd.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_freebsd.go
@@ -129,6 +129,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
+ use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux.go
index 9ca104c..6d10c9c 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -60,6 +60,15 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
return openat(dirfd, path, flags|O_LARGEFILE, mode)
}
+//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
+
+func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
+ if len(fds) == 0 {
+ return ppoll(nil, 0, timeout, sigmask)
+ }
+ return ppoll(&fds[0], len(fds), timeout, sigmask)
+}
+
//sys readlinkat(dirfd int, path string, buf []byte) (n int, err error)
func Readlink(path string, buf []byte) (n int, err error) {
@@ -1043,8 +1052,6 @@ func Munmap(b []byte) (err error) {
// Newfstatat
// Nfsservctl
// Personality
-// Poll
-// Ppoll
// Pselect6
// Ptrace
// Putpmsg
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_386.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_386.go
index bea01cb..2b881b9 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux_386.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_386.go
@@ -388,3 +388,12 @@ func (msghdr *Msghdr) SetControllen(length int) {
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
+
+//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ if len(fds) == 0 {
+ return poll(nil, 0, timeout)
+ }
+ return poll(&fds[0], len(fds), timeout)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
index 721f24b..18911c2 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
@@ -146,3 +146,12 @@ func (msghdr *Msghdr) SetControllen(length int) {
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
+
+//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ if len(fds) == 0 {
+ return poll(nil, 0, timeout)
+ }
+ return poll(&fds[0], len(fds), timeout)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
index 122df64..71d8702 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
@@ -252,3 +252,12 @@ func (msghdr *Msghdr) SetControllen(length int) {
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
+
+//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ if len(fds) == 0 {
+ return poll(nil, 0, timeout)
+ }
+ return poll(&fds[0], len(fds), timeout)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
index d105186..4b6ff2a 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
@@ -178,3 +178,15 @@ const (
SYS_EPOLL_CREATE = 1042
SYS_EPOLL_WAIT = 1069
)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ var ts *Timespec
+ if timeout >= 0 {
+ ts = new(Timespec)
+ *ts = NsecToTimespec(int64(timeout) * 1e6)
+ }
+ if len(fds) == 0 {
+ return ppoll(nil, 0, ts, nil)
+ }
+ return ppoll(&fds[0], len(fds), ts, nil)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
index bb15ba3..440f54e 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
@@ -204,3 +204,12 @@ func (msghdr *Msghdr) SetControllen(length int) {
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
+
+//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ if len(fds) == 0 {
+ return poll(nil, 0, timeout)
+ }
+ return poll(&fds[0], len(fds), timeout)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
index b156d52..60770f6 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
@@ -18,6 +18,7 @@ package unix
//sysnb Getgid() (gid int)
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT
//sysnb Getuid() (uid int)
+//sysnb InotifyInit() (fd int, err error)
//sys Ioperm(from int, num int, on int) (err error)
//sys Iopl(level int) (err error)
//sys Lchown(path string, uid int, gid int) (err error)
@@ -97,3 +98,38 @@ func (msghdr *Msghdr) SetControllen(length int) {
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
+
+//sysnb pipe(p *[2]_C_int) (err error)
+
+func Pipe(p []int) (err error) {
+ if len(p) != 2 {
+ return EINVAL
+ }
+ var pp [2]_C_int
+ err = pipe(&pp)
+ p[0] = int(pp[0])
+ p[1] = int(pp[1])
+ return
+}
+
+//sysnb pipe2(p *[2]_C_int, flags int) (err error)
+
+func Pipe2(p []int, flags int) (err error) {
+ if len(p) != 2 {
+ return EINVAL
+ }
+ var pp [2]_C_int
+ err = pipe2(&pp, flags)
+ p[0] = int(pp[0])
+ p[1] = int(pp[1])
+ return
+}
+
+//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ if len(fds) == 0 {
+ return poll(nil, 0, timeout)
+ }
+ return poll(&fds[0], len(fds), timeout)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/newt/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
new file mode 100644
index 0000000..81c5f47
--- /dev/null
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
@@ -0,0 +1,329 @@
+// Copyright 2016 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.
+
+// +build s390x,linux
+
+package unix
+
+import (
+ "unsafe"
+)
+
+//sys Dup2(oldfd int, newfd int) (err error)
+//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
+//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Fstat(fd int, stat *Stat_t) (err error)
+//sys Fstatfs(fd int, buf *Statfs_t) (err error)
+//sys Ftruncate(fd int, length int64) (err error)
+//sysnb Getegid() (egid int)
+//sysnb Geteuid() (euid int)
+//sysnb Getgid() (gid int)
+//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb Getuid() (uid int)
+//sysnb InotifyInit() (fd int, err error)
+//sys Lchown(path string, uid int, gid int) (err error)
+//sys Lstat(path string, stat *Stat_t) (err error)
+//sys Pause() (err error)
+//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
+//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
+//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
+//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
+//sys Setfsgid(gid int) (err error)
+//sys Setfsuid(uid int) (err error)
+//sysnb Setregid(rgid int, egid int) (err error)
+//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
+//sysnb Setresuid(ruid int, euid int, suid int) (err error)
+//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb Setreuid(ruid int, euid int) (err error)
+//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
+//sys Stat(path string, stat *Stat_t) (err error)
+//sys Statfs(path string, buf *Statfs_t) (err error)
+//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
+//sys Truncate(path string, length int64) (err error)
+//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
+//sysnb setgroups(n int, list *_Gid_t) (err error)
+
+func Getpagesize() int { return 4096 }
+
+//sysnb Gettimeofday(tv *Timeval) (err error)
+
+func Time(t *Time_t) (tt Time_t, err error) {
+ var tv Timeval
+ err = Gettimeofday(&tv)
+ if err != nil {
+ return 0, err
+ }
+ if t != nil {
+ *t = Time_t(tv.Sec)
+ }
+ return Time_t(tv.Sec), nil
+}
+
+//sys Utime(path string, buf *Utimbuf) (err error)
+
+func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
+
+func NsecToTimespec(nsec int64) (ts Timespec) {
+ ts.Sec = nsec / 1e9
+ ts.Nsec = nsec % 1e9
+ return
+}
+
+func NsecToTimeval(nsec int64) (tv Timeval) {
+ nsec += 999 // round up to microsecond
+ tv.Sec = nsec / 1e9
+ tv.Usec = nsec % 1e9 / 1e3
+ return
+}
+
+//sysnb pipe2(p *[2]_C_int, flags int) (err error)
+
+func Pipe(p []int) (err error) {
+ if len(p) != 2 {
+ return EINVAL
+ }
+ var pp [2]_C_int
+ err = pipe2(&pp, 0) // pipe2 is the same as pipe when flags are set to 0.
+ p[0] = int(pp[0])
+ p[1] = int(pp[1])
+ return
+}
+
+func Pipe2(p []int, flags int) (err error) {
+ if len(p) != 2 {
+ return EINVAL
+ }
+ var pp [2]_C_int
+ err = pipe2(&pp, flags)
+ p[0] = int(pp[0])
+ p[1] = int(pp[1])
+ return
+}
+
+func Ioperm(from int, num int, on int) (err error) {
+ return ENOSYS
+}
+
+func Iopl(level int) (err error) {
+ return ENOSYS
+}
+
+func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr }
+
+func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc }
+
+func (iov *Iovec) SetLen(length int) {
+ iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+ msghdr.Controllen = uint64(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+ cmsg.Len = uint64(length)
+}
+
+// Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct.
+// mmap2 also requires arguments to be passed in a struct; it is currently not exposed in <asm/unistd.h>.
+func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
+ mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)}
+ r0, _, e1 := Syscall(SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0)
+ use(unsafe.Pointer(&mmap_args[0]))
+ xaddr = uintptr(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// On s390x Linux, all the socket calls go through an extra indirection.
+// The arguments to the underlying system call (SYS_SOCKETCALL) are the
+// number below and a pointer to an array of uintptr.
+const (
+ // see linux/net.h
+ netSocket = 1
+ netBind = 2
+ netConnect = 3
+ netListen = 4
+ netAccept = 5
+ netGetSockName = 6
+ netGetPeerName = 7
+ netSocketPair = 8
+ netSend = 9
+ netRecv = 10
+ netSendTo = 11
+ netRecvFrom = 12
+ netShutdown = 13
+ netSetSockOpt = 14
+ netGetSockOpt = 15
+ netSendMsg = 16
+ netRecvMsg = 17
+ netAccept4 = 18
+ netRecvMMsg = 19
+ netSendMMsg = 20
+)
+
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (int, error) {
+ args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
+ fd, _, err := Syscall(SYS_SOCKETCALL, netAccept, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(fd), nil
+}
+
+func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (int, error) {
+ args := [4]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)}
+ fd, _, err := Syscall(SYS_SOCKETCALL, netAccept4, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(fd), nil
+}
+
+func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) error {
+ args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
+ _, _, err := RawSyscall(SYS_SOCKETCALL, netGetSockName, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) error {
+ args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
+ _, _, err := RawSyscall(SYS_SOCKETCALL, netGetPeerName, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func socketpair(domain int, typ int, flags int, fd *[2]int32) error {
+ args := [4]uintptr{uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd))}
+ _, _, err := RawSyscall(SYS_SOCKETCALL, netSocketPair, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func bind(s int, addr unsafe.Pointer, addrlen _Socklen) error {
+ args := [3]uintptr{uintptr(s), uintptr(addr), uintptr(addrlen)}
+ _, _, err := Syscall(SYS_SOCKETCALL, netBind, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func connect(s int, addr unsafe.Pointer, addrlen _Socklen) error {
+ args := [3]uintptr{uintptr(s), uintptr(addr), uintptr(addrlen)}
+ _, _, err := Syscall(SYS_SOCKETCALL, netConnect, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func socket(domain int, typ int, proto int) (int, error) {
+ args := [3]uintptr{uintptr(domain), uintptr(typ), uintptr(proto)}
+ fd, _, err := RawSyscall(SYS_SOCKETCALL, netSocket, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(fd), nil
+}
+
+func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) error {
+ args := [5]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen))}
+ _, _, err := Syscall(SYS_SOCKETCALL, netGetSockOpt, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) error {
+ args := [4]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val)}
+ _, _, err := Syscall(SYS_SOCKETCALL, netSetSockOpt, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (int, error) {
+ var base uintptr
+ if len(p) > 0 {
+ base = uintptr(unsafe.Pointer(&p[0]))
+ }
+ args := [6]uintptr{uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))}
+ n, _, err := Syscall(SYS_SOCKETCALL, netRecvFrom, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(n), nil
+}
+
+func sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) error {
+ var base uintptr
+ if len(p) > 0 {
+ base = uintptr(unsafe.Pointer(&p[0]))
+ }
+ args := [6]uintptr{uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen)}
+ _, _, err := Syscall(SYS_SOCKETCALL, netSendTo, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func recvmsg(s int, msg *Msghdr, flags int) (int, error) {
+ args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)}
+ n, _, err := Syscall(SYS_SOCKETCALL, netRecvMsg, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(n), nil
+}
+
+func sendmsg(s int, msg *Msghdr, flags int) (int, error) {
+ args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)}
+ n, _, err := Syscall(SYS_SOCKETCALL, netSendMsg, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(n), nil
+}
+
+func Listen(s int, n int) error {
+ args := [2]uintptr{uintptr(s), uintptr(n)}
+ _, _, err := Syscall(SYS_SOCKETCALL, netListen, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+func Shutdown(s, how int) error {
+ args := [2]uintptr{uintptr(s), uintptr(how)}
+ _, _, err := Syscall(SYS_SOCKETCALL, netShutdown, uintptr(unsafe.Pointer(&args)), 0)
+ if err != 0 {
+ return err
+ }
+ return nil
+}
+
+//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
+
+func Poll(fds []PollFd, timeout int) (n int, err error) {
+ if len(fds) == 0 {
+ return poll(nil, 0, timeout)
+ }
+ return poll(&fds[0], len(fds), timeout)
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/syscall_openbsd.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/newt/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index 246131d..554a823 100644
--- a/newt/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/newt/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -111,6 +111,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
+ use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a719361/newt/vendor/golang.org/x/sys/unix/types_linux.go
----------------------------------------------------------------------
diff --git a/newt/vendor/golang.org/x/sys/unix/types_linux.go b/newt/vendor/golang.org/x/sys/unix/types_linux.go
index 974d28c..7dea79a 100644
--- a/newt/vendor/golang.org/x/sys/unix/types_linux.go
+++ b/newt/vendor/golang.org/x/sys/unix/types_linux.go
@@ -24,6 +24,7 @@ package unix
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netpacket/packet.h>
+#include <poll.h>
#include <signal.h>
#include <stdio.h>
#include <sys/epoll.h>
@@ -102,10 +103,22 @@ typedef struct user_pt_regs PtraceRegs;
typedef struct pt_regs PtraceRegs;
#elif defined(__mips__)
typedef struct user PtraceRegs;
+#elif defined(__s390x__)
+typedef struct _user_regs_struct PtraceRegs;
#else
typedef struct user_regs_struct PtraceRegs;
#endif
+#if defined(__s390x__)
+typedef struct _user_psw_struct ptracePsw;
+typedef struct _user_fpregs_struct ptraceFpregs;
+typedef struct _user_per_struct ptracePer;
+#else
+typedef struct {} ptracePsw;
+typedef struct {} ptraceFpregs;
+typedef struct {} ptracePer;
+#endif
+
// The real epoll_event is a union, and godefs doesn't handle it well.
struct my_epoll_event {
uint32_t events;
@@ -113,6 +126,8 @@ struct my_epoll_event {
// padding is not specified in linux/eventpoll.h but added to conform to the
// alignment requirements of EABI
int32_t padFd;
+#elif defined(__powerpc64__) || defined(__s390x__)
+ int32_t _padFd;
#endif
int32_t fd;
int32_t pad;
@@ -390,6 +405,13 @@ const SizeofInotifyEvent = C.sizeof_struct_inotify_event
// Register structures
type PtraceRegs C.PtraceRegs
+// Structures contained in PtraceRegs on s390x (exported by mkpost.go)
+type ptracePsw C.ptracePsw
+
+type ptraceFpregs C.ptraceFpregs
+
+type ptracePer C.ptracePer
+
// Misc
type FdSet C.fd_set
@@ -409,6 +431,20 @@ const (
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
)
+type PollFd C.struct_pollfd
+
+const (
+ POLLIN = C.POLLIN
+ POLLPRI = C.POLLPRI
+ POLLOUT = C.POLLOUT
+ POLLRDHUP = C.POLLRDHUP
+ POLLERR = C.POLLERR
+ POLLHUP = C.POLLHUP
+ POLLNVAL = C.POLLNVAL
+)
+
+type Sigset_t C.sigset_t
+
// Terminal handling
type Termios C.termios_t