forked from golang/sys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For now zerrors_freebsd_arm64.go and ztypes_freebsd_arm64.go is just a copy of the freebsd/amd64 version of the files. Regenerate once bootstrapping a compiler works. Updates golang/go#24715 DO NOT REVIEW DO NOT SUBMIT Change-Id: I90a7e3ea0c0b6ecab4033f2908331b7be164a236
- Loading branch information
Showing
7 changed files
with
4,894 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.