mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-11 14:26:38 +02:00
72 lines
2.7 KiB
Diff
72 lines
2.7 KiB
Diff
Patch-Source: https://sources.debian.org/data/main/libs/libsys-syscall-perl/0.25-7/debian/patches/aarch64.patch
|
|
|
|
From 6c7c516edfabd2edc835d0aaad39f946164bb25d Mon Sep 17 00:00:00 2001
|
|
From: Yaakov Selkowitz <yselkowi@redhat.com>
|
|
Date: Fri, 4 Dec 2015 02:31:28 -0600
|
|
Subject: [PATCH 3/3] Add aarch64 support
|
|
|
|
This is a bit complicated because AArch64, as a completely new architecture,
|
|
does not support the deprecated epoll_create and epoll_wait syscalls.
|
|
Instead, these wrap the epoll_create1 and epoll_pwait syscalls, which serve
|
|
the same purpose but with slightly different syntaxes.
|
|
|
|
Origin: backport, https://github.com/bradfitz/sys-syscall/commit/6c7c516edfabd2edc835d0aaad39f946164bb25d
|
|
Bug-Debian: https://bugs.debian.org/824843
|
|
---
|
|
lib/Sys/Syscall.pm | 19 +++++++++++++++++--
|
|
1 file changed, 17 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/lib/Sys/Syscall.pm b/lib/Sys/Syscall.pm
|
|
index 702e835..abd010a 100644
|
|
--- a/lib/Sys/Syscall.pm
|
|
+++ b/lib/Sys/Syscall.pm
|
|
@@ -53,6 +53,8 @@ our (
|
|
$SYS_readahead,
|
|
);
|
|
|
|
+our $no_deprecated = 0;
|
|
+
|
|
if ($^O eq "linux") {
|
|
# whether the machine requires 64-bit numbers to be on 8-byte
|
|
# boundaries.
|
|
@@ -105,6 +107,14 @@ if ($^O eq "linux") {
|
|
$SYS_epoll_wait = 409;
|
|
$SYS_readahead = 379;
|
|
$u64_mod_8 = 1;
|
|
+ } elsif ($machine eq "aarch64") {
|
|
+ $SYS_epoll_create = 20; # (sys_epoll_create1)
|
|
+ $SYS_epoll_ctl = 21;
|
|
+ $SYS_epoll_wait = 22; # (sys_epoll_pwait)
|
|
+ $SYS_sendfile = 71; # (sys_sendfile64)
|
|
+ $SYS_readahead = 213;
|
|
+ $u64_mod_8 = 1;
|
|
+ $no_deprecated = 1;
|
|
} elsif ($machine =~ m/arm(v\d+)?.*l/) {
|
|
# ARM OABI
|
|
$SYS_epoll_create = 250;
|
|
@@ -207,7 +217,7 @@ sub epoll_defined { return $SYS_epoll_create ? 1 : 0; }
|
|
# size doesn't even matter (radix tree now, not hash)
|
|
sub epoll_create {
|
|
return -1 unless defined $SYS_epoll_create;
|
|
- my $epfd = eval { syscall($SYS_epoll_create, ($_[0]||100)+0) };
|
|
+ my $epfd = eval { syscall($SYS_epoll_create, $no_deprecated ? 0 : ($_[0]||100)+0) };
|
|
return -1 if $@;
|
|
return $epfd;
|
|
}
|
|
@@ -245,7 +255,12 @@ sub epoll_wait_mod8 {
|
|
$epoll_wait_size = $_[1];
|
|
$epoll_wait_events = "\0" x 16 x $epoll_wait_size;
|
|
}
|
|
- my $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0);
|
|
+ my $ct;
|
|
+ if ($no_deprecated) {
|
|
+ $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0, undef);
|
|
+ } else {
|
|
+ $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0);
|
|
+ }
|
|
for (0..$ct-1) {
|
|
# 16 byte epoll_event structs, with format:
|
|
# 4 byte mask [idx 1]
|
|
--
|
|
2.8.1
|
|
|