From patchwork Sun Jun 10 03:01: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: 138133 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2597200lji; Sat, 9 Jun 2018 20:45:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFyPR2ilV/WMZJUDX5QGRIE4adk8rRh7Nx2r41j0HpySQh0sKL//erhmj80vfXJ5Izf3di X-Received: by 2002:a0c:aa10:: with SMTP id d16-v6mr10958225qvb.198.1528602314807; Sat, 09 Jun 2018 20:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528602314; cv=none; d=google.com; s=arc-20160816; b=hC2UexhbZ3DKRjCuesU7FIpNz8c7tWiv0pTRGZFEXFA4lL6dymLuXdtMg58sIQqRDB aCBtCRdRGfOoASbdR5+0elbUD4mnoNp5tiUrP71QLc0lMo58DtIvUAo5qb+2G4Dsp63E HMWUTFj195TY10ZB6lc0tF2uR+dlwzNJbbqEUXpB7V/C9W74+8gDZYhB+lh5LPx2VB3g HwdYUb508be+RvXa5V76Gp3oL3k0MnntrBtJY30YKb46M8CE1lhTNmhS1X/wNA0fBbG+ 3s3u2LaSiZ6A+qldJE+jSboXJHHnnkEol3rA5vLGr4jbwrUQT1wz4QsZZGQSiMxJAaCG dbPw== 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=KzgeLj332Hg4hhdYbzBjX+ZAj17V4ISuX+GMsvoIFCk=; b=T5rKADXxiQQT4qy5DJiJWpn1L6Kz718W/rQiqNBpauv0bhg0sZghd77vbG2ab280vC /4o/2A2Nkk482rmvx4UbBDl0ZDQ4SNntSeaHtD0FpK7o5LaXKjAkiJQaUgzmw2z9Tl05 wOR3dT4OLRk2opBLrup5Ja4zMR1jMbxWP3UIq3sALDCQ1IxIZIYVWQqwv+vWd/bnWjPX Km7pEughXSHyYuTH9JaLpG80Pi/fy0G7QPF5IWe+3DUUmKKtKpkykYPBX0WF/pCOjtes HV5MWRlcPFEr5atYxG3ez+VyTD5WnqjW5G0Cv568QX3IN0dIt55sTDjy6bAtGlkSAlSF ymrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AGMk63ta; 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 v18-v6si4572370qta.163.2018.06.09.20.45.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 20:45:14 -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=AGMk63ta; 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]:42407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRrI2-00061l-6B for patch@linaro.org; Sat, 09 Jun 2018 23:45:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqeH-0002z6-NZ for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqeG-0003gQ-Hj for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:04:09 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:33743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqeG-0003gF-Bk for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:04:08 -0400 Received: by mail-pl0-x241.google.com with SMTP id n10-v6so10391225plp.0 for ; Sat, 09 Jun 2018 20:04:08 -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=KzgeLj332Hg4hhdYbzBjX+ZAj17V4ISuX+GMsvoIFCk=; b=AGMk63taUU3N3waxP05MsTnB2+J5PQODHYhua4R55CYCUqkCuss8GrQ5J3ufw3lhjP Wodp0S96BBteukuLU6y80U1kKCmOaNSK6BUwkultN1qvcaxLBJ5lnnmgz27xOSVquzn4 vRBcuGQ9MbdmkDTO0DwlEHMrTFKUcQcNOYclc= 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=KzgeLj332Hg4hhdYbzBjX+ZAj17V4ISuX+GMsvoIFCk=; b=A4rwnmw2DeZtkd+TnS3toSbr1xw3qzY0wnWOIl6tkUFKg382MypG3EnI+zpiVZpGsK yGnYXdV83q6n8bDKYWMZrmJUDWZ76k/hEqBhG+jbUj30nU+OyYgDWhFI4DA7NmdBLhMk JhRr60fV06xA9dw214IFickyXVeULJCzVvkbbmQbo9jNxn91JidNmXPN2P2rdvLcIYfj pJ/6dHp1VmH/Ab3gLmnn1MpYuWOTLD6NP78PjXD472jjiza94aHwUMLnVm8BejGdlaJ2 XDMO0Hw8ctlsm/M35DFuHKyg9hmfzdLGxu7eLaB3CuXabduvidmR71trm1FEZy1ImZaE OR/g== X-Gm-Message-State: APt69E0/eDaRvvUbRWebzBnKUgmqLy50xnZub7OjSllhW7PK7yJFs/jD L+qCnTkGbNGGKvQNzY2jiACFSWL+V/k= X-Received: by 2002:a17:902:b604:: with SMTP id b4-v6mr12940611pls.18.1528599847137; Sat, 09 Jun 2018 20:04:07 -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.04.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:04:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:01:18 -1000 Message-Id: <20180610030220.3777-47-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:c01::241 Subject: [Qemu-devel] [PATCH v2 046/108] linux-user: Split out 7 syscalls 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" Handle getpeername, getsockname, getsockopt, listen, recv, recvfrom, recvmsg. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 98 +++++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 28 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 155da4f523..98a982f83f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8153,6 +8153,13 @@ IMPL(futimesat) } #endif +#ifdef TARGET_NR_getpeername +IMPL(getpeername) +{ + return do_getpeername(arg1, arg2, arg3); +} +#endif + #ifdef TARGET_NR_getpgrp IMPL(getpgrp) { @@ -8226,6 +8233,20 @@ IMPL(getrusage) return ret; } +#ifdef TARGET_NR_getsockname +IMPL(getsockname) +{ + return do_getsockname(arg1, arg2, arg3); +} +#endif + +#ifdef TARGET_NR_getsockopt +IMPL(getsockopt) +{ + return do_getsockopt(arg1, arg2, arg3, arg4, arg5); +} +#endif + IMPL(gettimeofday) { struct timeval tv; @@ -8374,6 +8395,13 @@ IMPL(linkat) return ret; } +#ifdef TARGET_NR_listen +IMPL(listen) +{ + return get_errno(listen(arg1, arg2)); +} +#endif + IMPL(lseek) { return get_errno(lseek(arg1, arg2, arg3)); @@ -8912,6 +8940,27 @@ IMPL(reboot) return ret; } +#ifdef TARGET_NR_recv +IMPL(recv) +{ + return do_recvfrom(arg1, arg2, arg3, arg4, 0, 0); +} +#endif + +#ifdef TARGET_NR_recvfrom +IMPL(recvfrom) +{ + return do_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6); +} +#endif + +#ifdef TARGET_NR_recvmsg +IMPL(recvmsg) +{ + return do_sendrecvmsg(arg1, arg2, arg3, 0); +} +#endif + #ifdef TARGET_NR_rename IMPL(rename) { @@ -9951,34 +10000,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, void *p; switch(num) { -#ifdef TARGET_NR_getpeername - case TARGET_NR_getpeername: - return do_getpeername(arg1, arg2, arg3); -#endif -#ifdef TARGET_NR_getsockname - case TARGET_NR_getsockname: - return do_getsockname(arg1, arg2, arg3); -#endif -#ifdef TARGET_NR_getsockopt - case TARGET_NR_getsockopt: - return do_getsockopt(arg1, arg2, arg3, arg4, arg5); -#endif -#ifdef TARGET_NR_listen - case TARGET_NR_listen: - return get_errno(listen(arg1, arg2)); -#endif -#ifdef TARGET_NR_recv - case TARGET_NR_recv: - return do_recvfrom(arg1, arg2, arg3, arg4, 0, 0); -#endif -#ifdef TARGET_NR_recvfrom - case TARGET_NR_recvfrom: - return do_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6); -#endif -#ifdef TARGET_NR_recvmsg - case TARGET_NR_recvmsg: - return do_sendrecvmsg(arg1, arg2, arg3, 0); -#endif #ifdef TARGET_NR_send case TARGET_NR_send: return do_sendto(arg1, arg2, arg3, arg4, 0, 0); @@ -12827,6 +12848,9 @@ static impl_fn *syscall_table(unsigned num) #ifdef TARGET_NR_futimesat SYSCALL(futimesat); #endif +#ifdef TARGET_NR_getpeername + SYSCALL(getpeername); +#endif #ifdef TARGET_NR_getpgrp SYSCALL(getpgrp); #endif @@ -12839,6 +12863,12 @@ static impl_fn *syscall_table(unsigned num) SYSCALL(getpriority); SYSCALL(getrlimit); SYSCALL(getrusage); +#ifdef TARGET_NR_getsockname + SYSCALL(getsockname); +#endif +#ifdef TARGET_NR_getsockopt + SYSCALL(getsockopt); +#endif SYSCALL(gettimeofday); #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA) SYSCALL(getxpid); @@ -12849,6 +12879,9 @@ static impl_fn *syscall_table(unsigned num) SYSCALL(link); #endif SYSCALL(linkat); +#ifdef TARGET_NR_listen + SYSCALL(listen); +#endif SYSCALL(lseek); #ifdef TARGET_NR_mkdir SYSCALL(mkdir); @@ -12903,6 +12936,15 @@ static impl_fn *syscall_table(unsigned num) #endif SYSCALL(readlinkat); SYSCALL(reboot); +#ifdef TARGET_NR_recv + SYSCALL(recv); +#endif +#ifdef TARGET_NR_recvfrom + SYSCALL(recvfrom); +#endif +#ifdef TARGET_NR_recvmsg + SYSCALL(recvmsg); +#endif #ifdef TARGET_NR_rename SYSCALL(rename); #endif