From patchwork Sun Jun 10 03:02:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138168 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2611398lji; Sat, 9 Jun 2018 21:10:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJcJTLMR+u7Huag2dIPZov160tGrJkua5axm5nDMujvSGYA/UwunShKNN4ZSxHpcZUcPep X-Received: by 2002:a0c:bd0e:: with SMTP id m14-v6mr10934469qvg.164.1528603802826; Sat, 09 Jun 2018 21:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528603802; cv=none; d=google.com; s=arc-20160816; b=wK3LMwaeavGHNBERaTUAxsP1wpAws3ihXPrzZk7U9Ssum/9/NXEPSMuuvQVIwKjKN1 gqHZs2A9JslfGUAMj7FMkl5cdy3kPozPtQwkryozqbrIG0eWgvZC0z+y+sjC8fKVgDZQ /cR5nYZME7Rw1CV9hjZyA5SUKaYTehVBNsZtlXFrQhiAwWSdVkDI2pNc38HyndHpQp+3 B6C9sD7Gr1Mheqm+OxNT6nsCW+FtAgdv/OtArkE4ibOuXtj6yuh5dnPx+oDlyDL5u7Sj Dt7H8DNbU1OLOaPaiEBXXHANxCNngp61+zVSEOrBnc/FUWi2wffz5+1kCvV0EEf2NnjJ oY5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=u9W96ZAXur1A2wkYUJubq/xHWKIANi4SOo8++E6F+fc=; b=DC9uYJB64U4EWLNFUTrTh+xwJ+e6jniUyRcpMOik+gzo6K7Oi45LP32pHzilOHta5x r92QMvInMDjcyxyhQgLc8EGQ1IU/jJxlxu7/oZ3cdVYGm3AmfkfDbjC+wQ3eJDRfhJQh Jt0es+CEQOeojPl65eEYuC+8fsct7+xFmZG9q2IM0OmGwECsMfI7FlHY8iuXp7RxpZbB EUrxfgWftIzG99ZtN1vR2riKn3islh6O3ZIIT7OpAIKrtL2z0FB0aRc2ihJpRPMlDXJe 3faaD/PlCoL5IZvRAhwAaxsq8LUucg5VyYOcIryathU+ZxheeyuVp+bWNcFZCVlfS5oG /0Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ATKJyc3M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b11-v6si1846055qtp.303.2018.06.09.21.10.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 21:10:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ATKJyc3M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRrg2-0004MP-7o for patch@linaro.org; Sun, 10 Jun 2018 00:10:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqg8-0004oq-1L for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:06:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqg7-0004sk-3X for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:06:04 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:32941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqg6-0004s2-T2 for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:06:03 -0400 Received: by mail-pf0-x244.google.com with SMTP id b17-v6so8496140pfi.0 for ; Sat, 09 Jun 2018 20:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u9W96ZAXur1A2wkYUJubq/xHWKIANi4SOo8++E6F+fc=; b=ATKJyc3MaWk5AltpcgUJEZAp8t/i/HhMNENIKPuYTvzxkBlCp9Q9vYvgeco0SFhZK8 DC6A6pFwPoii4zT3rlJy8yr+FRe5ojnPSPkIYcU9YmBIhyvs5LYWKwmEdtgB8yHA+W62 Kx3TC/m0bW6RaQRh0/FQ5R6xlU2UKb2d4uMYs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=u9W96ZAXur1A2wkYUJubq/xHWKIANi4SOo8++E6F+fc=; b=FxQXsXq4BlymUmwNJiolJUM7gcfBI7KseOE/iRFYq4xpgIF8AtKnjxmVB20HISyIZY 3y8RkOqbOiyLagr19l7F6mIalbPysPOpE+XBdglQdf9fe/QrddkfKUM99DVtmJ2gB+Q6 eM5uORJ6OxpLgxFkycx8tlZU9NdWGVFQIX/JtIlri2bWFFtSG4CyhbzSqZ8eTXXEDYgJ 2MSqx2+52M8WgC6hbJPh1okTRDUvesjkYVt5h8TjWBz4iD544nxv6N8pF6vv76ST9vsv 5KQoMrzqLgKKAL3+Ov86GRwJoYDN0jpZxrPTGvEtr7LGwpSSnnbvJHnta41QN5VAqke+ vt5A== X-Gm-Message-State: APt69E3zyU7h9HwRyiOAmWPcUiJfX2PfO4UMaIIAwSvXGno1aL1WTYrX oUZqdbTidMG+OqmqmpXpr3OWhj1XV3M= X-Received: by 2002:a63:6742:: with SMTP id b63-v6mr10427189pgc.54.1528599961751; Sat, 09 Jun 2018 20:06:01 -0700 (PDT) Received: from cloudburst.twiddle.net (rrcs-173-198-77-219.west.biz.rr.com. [173.198.77.219]) by smtp.gmail.com with ESMTPSA id y17-v6sm31712718pfe.33.2018.06.09.20.06.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:06:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:02:18 -1000 Message-Id: <20180610030220.3777-107-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180610030220.3777-1-richard.henderson@linaro.org> References: <20180610030220.3777-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH v2 106/108] linux-user: Split out ioprio_get, ioprio_set, kcmp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" All targets define all of these; remove the ifdefs. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 49 ++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 22 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c0752ad6e0..d15f994039 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -250,6 +250,15 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ #ifndef __NR_gettid #define __NR_gettid -1 #endif +#ifndef __NR_ioprio_get +#define __NR_ioprio_get -1 +#endif +#ifndef __NR_ioprio_set +#define __NR_ioprio_set -1 +#endif +#ifndef __NR_kcmp +#define __NR_kcmp -1 +#endif #ifndef __NR_set_tid_address #define __NR_set_tid_address -1 #endif @@ -296,18 +305,11 @@ _syscall2(int, capget, struct __user_cap_header_struct *, header, struct __user_cap_data_struct *, data); _syscall2(int, capset, struct __user_cap_header_struct *, header, struct __user_cap_data_struct *, data); -#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get) _syscall2(int, ioprio_get, int, which, int, who) -#endif -#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set) _syscall3(int, ioprio_set, int, which, int, who, int, ioprio) -#endif _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags) - -#if defined(TARGET_NR_kcmp) && defined(__NR_kcmp) _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2) -#endif static bitmask_transtbl fcntl_flags_tbl[] = { { TARGET_O_ACCMODE, TARGET_O_WRONLY, O_ACCMODE, O_WRONLY, }, @@ -9474,6 +9476,16 @@ IMPL(ioctl) return ret; } +IMPL(ioprio_get) +{ + return get_errno(ioprio_get(arg1, arg2)); +} + +IMPL(ioprio_set) +{ + return get_errno(ioprio_set(arg1, arg2, arg3)); +} + #ifdef TARGET_NR_ipc IMPL(ipc) { @@ -9553,6 +9565,11 @@ IMPL(ipc) } #endif +IMPL(kcmp) +{ + return get_errno(kcmp(arg1, arg2, arg3, arg4, arg5)); +} + IMPL(kill) { return get_errno(safe_kill(arg1, target_to_host_signal(arg2))); @@ -13187,16 +13204,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, abi_long ret; switch(num) { -#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get) - case TARGET_NR_ioprio_get: - return get_errno(ioprio_get(arg1, arg2)); -#endif - -#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set) - case TARGET_NR_ioprio_set: - return get_errno(ioprio_set(arg1, arg2, arg3)); -#endif - #if defined(TARGET_NR_setns) && defined(CONFIG_SETNS) case TARGET_NR_setns: return get_errno(setns(arg1, arg2)); @@ -13205,11 +13212,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, case TARGET_NR_unshare: return get_errno(unshare(arg1)); #endif -#if defined(TARGET_NR_kcmp) && defined(__NR_kcmp) - case TARGET_NR_kcmp: - return get_errno(kcmp(arg1, arg2, arg3, arg4, arg5)); -#endif - default: gemu_log("qemu: Unsupported syscall: %d\n", num); return -TARGET_ENOSYS; @@ -13510,9 +13512,12 @@ static impl_fn *syscall_table(unsigned num) SYSCALL(inotify_rm_watch); #endif SYSCALL(ioctl); + SYSCALL(ioprio_get); + SYSCALL(ioprio_set); #ifdef TARGET_NR_ipc SYSCALL(ipc); #endif + SYSCALL(kcmp); SYSCALL(kill); #ifdef TARGET_NR_lchown SYSCALL(lchown);