-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This wasn't actually generated on freebsd/arm64 yet. It's mostly a copy of the amd64 files for now. Updates golang/go#24715 Change-Id: If24c3c5803a4708f0b26d738f690cbea1694ca88 Reviewed-on: https://go-review.googlesource.com/c/155978 Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
- Loading branch information
Showing
7 changed files
with
4,892 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2018 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 ARM64, FreeBSD | ||
// | ||
|
||
// Just jump to package syscall's implementation for all these functions. | ||
// The runtime may know about them. | ||
|
||
TEXT ·Syscall(SB),NOSPLIT,$0-56 | ||
JMP syscall·Syscall(SB) | ||
|
||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 | ||
JMP syscall·Syscall6(SB) | ||
|
||
TEXT ·Syscall9(SB),NOSPLIT,$0-104 | ||
JMP syscall·Syscall9(SB) | ||
|
||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 | ||
JMP syscall·RawSyscall(SB) | ||
|
||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 | ||
JMP syscall·RawSyscall6(SB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2018 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 arm64,freebsd | ||
|
||
package unix | ||
|
||
import ( | ||
"syscall" | ||
"unsafe" | ||
) | ||
|
||
func setTimespec(sec, nsec int64) Timespec { | ||
return Timespec{Sec: sec, Nsec: nsec} | ||
} | ||
|
||
func setTimeval(sec, usec int64) Timeval { | ||
return Timeval{Sec: sec, Usec: usec} | ||
} | ||
|
||
func SetKevent(k *Kevent_t, fd, mode, flags int) { | ||
k.Ident = uint64(fd) | ||
k.Filter = int16(mode) | ||
k.Flags = uint16(flags) | ||
} | ||
|
||
func (iov *Iovec) SetLen(length int) { | ||
iov.Len = uint64(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(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 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) |
Oops, something went wrong.