From d8ea6acb5f586aabbde0dc18ca3c2f3aced45a49 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 2 Aug 2020 14:00:48 -0700 Subject: [PATCH] internal/syscall/unix: define copyFileRangeTrap for all architectures Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/246363 --- gcc/go/gofrontend/MERGE | 2 +- .../{getrandom_linux_alpha.go => sysnum_linux_alpha.go} | 7 ++++--- ...etrandom_linux_amd64p32.go => sysnum_linux_amd64p32.go} | 7 ++++--- libgo/go/internal/syscall/unix/sysnum_linux_generic.go | 4 ++-- .../unix/{getrandom_linux_s390.go => sysnum_linux_ia64.go} | 7 ++++--- .../unix/{getrandom_linux_m68k.go => sysnum_linux_m68k.go} | 7 ++++--- ...ndom_linux_mips64p32x.go => sysnum_linux_mips64p32x.go} | 7 ++++--- .../unix/{getrandom_linux_ia64.go => sysnum_linux_s390.go} | 7 ++++--- .../unix/{getrandom_linux_shx.go => sysnum_linux_shx.go} | 7 ++++--- .../{getrandom_linux_sparcx.go => sysnum_linux_sparcx.go} | 7 ++++--- 10 files changed, 35 insertions(+), 27 deletions(-) rename libgo/go/internal/syscall/unix/{getrandom_linux_alpha.go => sysnum_linux_alpha.go} (61%) rename libgo/go/internal/syscall/unix/{getrandom_linux_amd64p32.go => sysnum_linux_amd64p32.go} (58%) rename libgo/go/internal/syscall/unix/{getrandom_linux_s390.go => sysnum_linux_ia64.go} (61%) rename libgo/go/internal/syscall/unix/{getrandom_linux_m68k.go => sysnum_linux_m68k.go} (61%) rename libgo/go/internal/syscall/unix/{getrandom_linux_mips64p32x.go => sysnum_linux_mips64p32x.go} (65%) rename libgo/go/internal/syscall/unix/{getrandom_linux_ia64.go => sysnum_linux_s390.go} (61%) rename libgo/go/internal/syscall/unix/{getrandom_linux_shx.go => sysnum_linux_shx.go} (63%) rename libgo/go/internal/syscall/unix/{getrandom_linux_sparcx.go => sysnum_linux_sparcx.go} (64%) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 89d1f3c7623..39849522124 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -2c390ba951e83b547f6387cc9e19436c085b3775 +82a0db12bcb205748a5319b03e070d5502246ba7 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_alpha.go b/libgo/go/internal/syscall/unix/sysnum_linux_alpha.go similarity index 61% rename from libgo/go/internal/syscall/unix/getrandom_linux_alpha.go rename to libgo/go/internal/syscall/unix/sysnum_linux_alpha.go index 9587b5aa4ca..c40bc848813 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_alpha.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_alpha.go @@ -4,6 +4,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 511 +const ( + getrandomTrap uintptr = 511 + copyFileRangeTrap uintptr = 519 +) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_amd64p32.go b/libgo/go/internal/syscall/unix/sysnum_linux_amd64p32.go similarity index 58% rename from libgo/go/internal/syscall/unix/getrandom_linux_amd64p32.go rename to libgo/go/internal/syscall/unix/sysnum_linux_amd64p32.go index 911b6089ff3..3e5fd4583ba 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_amd64p32.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_amd64p32.go @@ -4,6 +4,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 0x40000000 + 318 +const ( + getrandomTrap uintptr = 0x40000000 + 318 + copyFileRangeTrap uintptr = 0x40000000 + 326 +) diff --git a/libgo/go/internal/syscall/unix/sysnum_linux_generic.go b/libgo/go/internal/syscall/unix/sysnum_linux_generic.go index f48da40188e..3e00703679a 100644 --- a/libgo/go/internal/syscall/unix/sysnum_linux_generic.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_generic.go @@ -3,13 +3,13 @@ // license that can be found in the LICENSE file. // +build linux -// +build arm64 riscv64 +// +build arm64 arm64be nios2 riscv riscv64 package unix // This file is named "generic" because at a certain point Linux started // standardizing on system call numbers across architectures. So far this -// means only arm64 and riscv64 use the standard numbers. +// means only arm64, nios2 and riscv use the standard numbers. const ( getrandomTrap uintptr = 278 diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_s390.go b/libgo/go/internal/syscall/unix/sysnum_linux_ia64.go similarity index 61% rename from libgo/go/internal/syscall/unix/getrandom_linux_s390.go rename to libgo/go/internal/syscall/unix/sysnum_linux_ia64.go index e3bc4ee355c..bb7c363cdc2 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_s390.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_ia64.go @@ -4,6 +4,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 349 +const ( + getrandomTrap uintptr = 315 + copyFileRangeTrap uintptr = 323 +) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_m68k.go b/libgo/go/internal/syscall/unix/sysnum_linux_m68k.go similarity index 61% rename from libgo/go/internal/syscall/unix/getrandom_linux_m68k.go rename to libgo/go/internal/syscall/unix/sysnum_linux_m68k.go index 5559d30d331..97fc51215b6 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_m68k.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_m68k.go @@ -4,6 +4,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 352 +const ( + getrandomTrap uintptr = 352 + copyFileRangeTrap uintptr = 376 +) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_mips64p32x.go b/libgo/go/internal/syscall/unix/sysnum_linux_mips64p32x.go similarity index 65% rename from libgo/go/internal/syscall/unix/getrandom_linux_mips64p32x.go rename to libgo/go/internal/syscall/unix/sysnum_linux_mips64p32x.go index 4d8f6c53a99..b75a618e9cf 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_mips64p32x.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_mips64p32x.go @@ -6,6 +6,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 6317 +const ( + getrandomTrap uintptr = 6317 + copyFileRangeTrap uintptr = 6324 +) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_ia64.go b/libgo/go/internal/syscall/unix/sysnum_linux_s390.go similarity index 61% rename from libgo/go/internal/syscall/unix/getrandom_linux_ia64.go rename to libgo/go/internal/syscall/unix/sysnum_linux_s390.go index d20ba238fcf..bf2c01e4e16 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_ia64.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_s390.go @@ -4,6 +4,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 1339 +const ( + getrandomTrap uintptr = 349 + copyFileRangeTrap uintptr = 375 +) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_shx.go b/libgo/go/internal/syscall/unix/sysnum_linux_shx.go similarity index 63% rename from libgo/go/internal/syscall/unix/getrandom_linux_shx.go rename to libgo/go/internal/syscall/unix/sysnum_linux_shx.go index e0e3521a704..b5e58e4ee3c 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_shx.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_shx.go @@ -6,6 +6,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 373 +const ( + getrandomTrap uintptr = 373 + copyFileRangeTrap uintptr = 380 +) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_sparcx.go b/libgo/go/internal/syscall/unix/sysnum_linux_sparcx.go similarity index 64% rename from libgo/go/internal/syscall/unix/getrandom_linux_sparcx.go rename to libgo/go/internal/syscall/unix/sysnum_linux_sparcx.go index 4874ec1bd86..63db571433b 100644 --- a/libgo/go/internal/syscall/unix/getrandom_linux_sparcx.go +++ b/libgo/go/internal/syscall/unix/sysnum_linux_sparcx.go @@ -6,6 +6,7 @@ package unix -// Linux getrandom system call number. -// See GetRandom in getrandom_linux.go. -const randomTrap uintptr = 347 +const ( + getrandomTrap uintptr = 347 + copyFileRangeTrap uintptr = 357 +) -- 2.30.2