• Shenghou Ma's avatar
    syscall: fix mkall.sh, mksyscall_linux.pl, and regen for Linux/ARM · 6e211225
    Shenghou Ma authored
    CL 3075041 says ARM is not little-endian, but my test suggests otherwise.
    My test program is:
    
        package main
        import ("fmt"; "syscall"; "os")
        func main() {
           err := syscall.Fallocate(1, 1/*FALLOC_FL_KEEP_SIZE*/, 0, int64(40960));
           fmt.Fprintln(os.Stderr, err)
        }
    
    Without this CL, ./test > testfile will show: file too large; and strace shows:
        fallocate(1, 01, 0, 175921860444160)    = -1 EFBIG (File too large)
    With this CL, ./test > testfile will show: <nil>; and strace shows:
        fallocate(1, 01, 0, 40960)              = 0
    
    Quoting rsc:
    "[It turns out that] ARM syscall ABI requires 64-bit arguments to use an
    (even, odd) register pair, not an (odd, even) pair. Switching to "big-endian"
    worked because it ended up using the high 32-bits (always zero in the tests
    we had) as the padding word, because the 64-bit argument was the last one,
    and because we fill in zeros for the rest of the system call arguments, up to
    six. So it happened to work."
    
    I updated mksyscall_linux.pl to accommodate the register pair ABI requirement,
    and removed all hand-tweaked syscall routines in favor of the auto-generated
    ones. These including: Ftruncate, Truncate, Pread and Pwrite.
    
    Some recent Linux/ARM distributions do not bundle kernel asm headers,
    so instead we always get latest asm/unistd.h from git.kernel.org (just like
    what we do for FreeBSD).
    
    R=ken, r, rsc, r, dave, iant
    CC=golang-dev
    https://golang.org/cl/5726051
    6e211225
Name
Last commit
Last update
..
asm_darwin_386.s Loading commit data...
asm_darwin_amd64.s Loading commit data...
asm_freebsd_386.s Loading commit data...
asm_freebsd_amd64.s Loading commit data...
asm_linux_386.s Loading commit data...
asm_linux_amd64.s Loading commit data...
asm_linux_arm.s Loading commit data...
asm_netbsd_386.s Loading commit data...
asm_netbsd_amd64.s Loading commit data...
asm_openbsd_386.s Loading commit data...
asm_openbsd_amd64.s Loading commit data...
asm_plan9_386.s Loading commit data...
asm_windows_386.s Loading commit data...
asm_windows_amd64.s Loading commit data...
bpf_bsd.go Loading commit data...
dll_windows.go Loading commit data...
env_plan9.go Loading commit data...
env_unix.go Loading commit data...
env_windows.go Loading commit data...
exec_bsd.go Loading commit data...
exec_linux.go Loading commit data...
exec_plan9.go Loading commit data...
exec_unix.go Loading commit data...
exec_windows.go Loading commit data...
lsf_linux.go Loading commit data...
mkall.sh Loading commit data...
mkerrors.sh Loading commit data...
mkerrors_windows.sh Loading commit data...
mksyscall.pl Loading commit data...
mksyscall_windows.pl Loading commit data...
mksysctl_openbsd.pl Loading commit data...
mksysnum_darwin.pl Loading commit data...
mksysnum_freebsd.pl Loading commit data...
mksysnum_linux.pl Loading commit data...
mksysnum_netbsd.pl Loading commit data...
mksysnum_openbsd.pl Loading commit data...
mksysnum_plan9.sh Loading commit data...
netlink_linux.go Loading commit data...
route_bsd.go Loading commit data...
route_darwin.go Loading commit data...
route_freebsd.go Loading commit data...
route_netbsd.go Loading commit data...
route_openbsd.go Loading commit data...
security_windows.go Loading commit data...
sockcmsg_linux.go Loading commit data...
sockcmsg_unix.go Loading commit data...
str.go Loading commit data...
syscall.go Loading commit data...
syscall_bsd.go Loading commit data...
syscall_darwin.go Loading commit data...
syscall_darwin_386.go Loading commit data...
syscall_darwin_amd64.go Loading commit data...
syscall_freebsd.go Loading commit data...
syscall_freebsd_386.go Loading commit data...
syscall_freebsd_amd64.go Loading commit data...
syscall_linux.go Loading commit data...
syscall_linux_386.go Loading commit data...
syscall_linux_amd64.go Loading commit data...
syscall_linux_arm.go Loading commit data...
syscall_netbsd.go Loading commit data...
syscall_netbsd_386.go Loading commit data...
syscall_netbsd_amd64.go Loading commit data...
syscall_openbsd.go Loading commit data...
syscall_openbsd_386.go Loading commit data...
syscall_openbsd_amd64.go Loading commit data...
syscall_plan9.go Loading commit data...
syscall_plan9_386.go Loading commit data...
syscall_unix.go Loading commit data...
syscall_windows.go Loading commit data...
syscall_windows_386.go Loading commit data...
syscall_windows_amd64.go Loading commit data...
types_darwin.go Loading commit data...
types_freebsd.go Loading commit data...
types_linux.go Loading commit data...
types_netbsd.go Loading commit data...
types_openbsd.go Loading commit data...
types_plan9.c Loading commit data...
zerrors_darwin_386.go Loading commit data...
zerrors_darwin_amd64.go Loading commit data...
zerrors_freebsd_386.go Loading commit data...
zerrors_freebsd_amd64.go Loading commit data...
zerrors_linux_386.go Loading commit data...
zerrors_linux_amd64.go Loading commit data...
zerrors_linux_arm.go Loading commit data...
zerrors_netbsd_386.go Loading commit data...
zerrors_netbsd_amd64.go Loading commit data...
zerrors_openbsd_386.go Loading commit data...
zerrors_openbsd_amd64.go Loading commit data...
zerrors_plan9_386.go Loading commit data...
zerrors_windows.go Loading commit data...
zerrors_windows_386.go Loading commit data...
zerrors_windows_amd64.go Loading commit data...
zsyscall_darwin_386.go Loading commit data...
zsyscall_darwin_amd64.go Loading commit data...
zsyscall_freebsd_386.go Loading commit data...
zsyscall_freebsd_amd64.go Loading commit data...
zsyscall_linux_386.go Loading commit data...
zsyscall_linux_amd64.go Loading commit data...
zsyscall_linux_arm.go Loading commit data...
zsyscall_netbsd_386.go Loading commit data...
zsyscall_netbsd_amd64.go Loading commit data...
zsyscall_openbsd_386.go Loading commit data...
zsyscall_openbsd_amd64.go Loading commit data...
zsyscall_plan9_386.go Loading commit data...
zsyscall_windows_386.go Loading commit data...
zsyscall_windows_amd64.go Loading commit data...
zsysctl_openbsd.go Loading commit data...
zsysnum_darwin_386.go Loading commit data...
zsysnum_darwin_amd64.go Loading commit data...
zsysnum_freebsd_386.go Loading commit data...
zsysnum_freebsd_amd64.go Loading commit data...
zsysnum_linux_386.go Loading commit data...
zsysnum_linux_amd64.go Loading commit data...
zsysnum_linux_arm.go Loading commit data...
zsysnum_netbsd_386.go Loading commit data...
zsysnum_netbsd_amd64.go Loading commit data...
zsysnum_openbsd_386.go Loading commit data...
zsysnum_openbsd_amd64.go Loading commit data...
zsysnum_plan9_386.go Loading commit data...
zsysnum_windows_386.go Loading commit data...
zsysnum_windows_amd64.go Loading commit data...
ztypes_darwin_386.go Loading commit data...
ztypes_darwin_amd64.go Loading commit data...
ztypes_freebsd_386.go Loading commit data...
ztypes_freebsd_amd64.go Loading commit data...
ztypes_linux_386.go Loading commit data...
ztypes_linux_amd64.go Loading commit data...
ztypes_linux_arm.go Loading commit data...
ztypes_netbsd_386.go Loading commit data...
ztypes_netbsd_amd64.go Loading commit data...
ztypes_openbsd_386.go Loading commit data...
ztypes_openbsd_amd64.go Loading commit data...
ztypes_plan9_386.go Loading commit data...
ztypes_windows.go Loading commit data...
ztypes_windows_386.go Loading commit data...
ztypes_windows_amd64.go Loading commit data...