From 9a16bd169e8c40dcdaf5b38eecdd925706e57d4b Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 26 Apr 2018 18:54:00 +0000 Subject: [PATCH] libsysdecode: support errno and syscalls for arm64 Linux Sponsored by: Turing Robotic Industries Inc. --- lib/libsysdecode/errno.c | 6 +++--- lib/libsysdecode/syscallnames.c | 8 +++++--- lib/libsysdecode/sysdecode.3 | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/libsysdecode/errno.c b/lib/libsysdecode/errno.c index ef463df4ae67..0b6ae6083fb2 100644 --- a/lib/libsysdecode/errno.c +++ b/lib/libsysdecode/errno.c @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) || defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) static #include #endif @@ -130,7 +130,7 @@ sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, int error) case SYSDECODE_ABI_FREEBSD: case SYSDECODE_ABI_FREEBSD32: return (error); -#if defined(__i386__) || defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) case SYSDECODE_ABI_LINUX: case SYSDECODE_ABI_LINUX32: { unsigned int i; @@ -166,7 +166,7 @@ sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi, int error) case SYSDECODE_ABI_FREEBSD: case SYSDECODE_ABI_FREEBSD32: return (error); -#if defined(__i386__) || defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) case SYSDECODE_ABI_LINUX: case SYSDECODE_ABI_LINUX32: if (error >= 0 && error <= ELAST) diff --git a/lib/libsysdecode/syscallnames.c b/lib/libsysdecode/syscallnames.c index abe284c693aa..ae587c916df5 100644 --- a/lib/libsysdecode/syscallnames.c +++ b/lib/libsysdecode/syscallnames.c @@ -49,9 +49,11 @@ static #include #endif -#if defined(__amd64__) || defined(__i386__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) static -#ifdef __amd64__ +#ifdef __aarch64__ +#include +#elif __amd64__ #include #else #include @@ -83,7 +85,7 @@ sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code) return (freebsd32_syscallnames[code]); break; #endif -#if defined(__amd64__) || defined(__i386__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) case SYSDECODE_ABI_LINUX: if (code < nitems(linux_syscallnames)) return (linux_syscallnames[code]); diff --git a/lib/libsysdecode/sysdecode.3 b/lib/libsysdecode/sysdecode.3 index ef67a2b0a6f4..0d93ef0338b4 100644 --- a/lib/libsysdecode/sysdecode.3 +++ b/lib/libsysdecode/sysdecode.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2018 +.Dd April 26, 2018 .Dt SYSDECODE 3 .Os .Sh NAME @@ -57,7 +57,7 @@ Supported on all platforms. Supported on amd64 and powerpc64. .It Li SYSDECODE_ABI_LINUX Linux binaries of the same platform. -Supported on amd64 and i386. +Supported on amd64, i386, and arm64. .It Li SYSDECODE_ABI_LINUX32 32-bit Linux binaries. Supported on amd64.