From patchwork Sun May 19 20:36:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164527 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4797954ili; Sun, 19 May 2019 14:07:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEobvFMacVlzQ6DHBdpYDhTqg36rOAFHB5QGYPozQEBDHIjC3CGTRLbrLP3X8QmeLGKjOm X-Received: by 2002:a50:90dd:: with SMTP id d29mr70974814eda.127.1558300058734; Sun, 19 May 2019 14:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558300058; cv=none; d=google.com; s=arc-20160816; b=hOtX4q61jIIJsC1fqu/xEGUKX/9bmojC6rR17LxFQFeSdmUJJamR6tGUNCHCfEL9vO uaR5iIKXFT6sb7dMufr7QM3H+xJ+jhl4RHbW75Mb7C2zPCkNgGXJjUGWjXp5gv6wCwpD bZ1Sn6hhK6ZmQRY+5QpFfxVw7gBoi/v1yKGE5QfTVA4O/AW9mnZ2m48QiIPDZaAq0RSv gbZw3NpdtgO4NE1vMneFudLh/ghAVo3GgJDTdnWWTaWd2hNGCh3HgM9qmj1zhYH6yiiN 67K395l9ij7OD1pIHGQ2ZunXdzDmNg3XQmxQ/jCRwDX5msnf7S/PCEEvfjt+h4NoKMSe 2LJA== 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; bh=D7GWj/lXqLo0o5VRDqbo6Uitm8MC1Kjd/6DUhBjIuPo=; b=Q9+ySWYzc5kD5kPQTXE8SR1L96VLtr0o6/HpBgf3OXMGllt7hAURGMe9IZzLQMJqnv DShcI+N1WxwXJCDVKr4//l6jiNgP+ulBy8NF8uKmusAJ1iyOr3DYi0x0zzKxuhBkAukl 7C6mfLxVY6q0l2z9DbpFy9NOPvaGeGjh2t2TH1vrqDUDe5hdVoB/3FT3l/X8HRJbAeEH kO+jbkQHt4EyremoDXQkFcfWpLxRkuqAQyeYMCQiXApB06oDgul2ToUMTgSLQogc2A6j JqOtxBUSu83f0xLZYyQDygDVmXBHRgu1GQ/DJa+cV5BNT5BmG2KGgu+dpufbxxVq5dU0 ygow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TZDbAixz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id t4si2252671eda.280.2019.05.19.14.07.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 19 May 2019 14:07:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TZDbAixz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:53538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hST1t-0003BH-JY for patch@linaro.org; Sun, 19 May 2019 17:07:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSZK-0003Pi-Ip for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSSZJ-00041B-Dh for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:06 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:34264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSSZJ-00040H-76 for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:05 -0400 Received: by mail-pf1-x444.google.com with SMTP id n19so6182715pfa.1 for ; Sun, 19 May 2019 13:38:05 -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=D7GWj/lXqLo0o5VRDqbo6Uitm8MC1Kjd/6DUhBjIuPo=; b=TZDbAixztVBkqw7lKtMXBgrdRBWHWKYzgjNlobC63Oyqzic4+0AFnhNHmPqTg0KqVp tAhqpbYNlYIuYy+dkurt+px0Z9k5E9Dye+MomeyFA3GZLE8W1Rs4gy+a02aldCXc7oRe hwTsgckJAro6rmOLrFYRSm6+pdwbNafgu0hmn8VuqXFFJKXLqffUNfT6tJ/YhGFWrKrR faLcJM4auzgxvMTSUken3DqYxhMLgwlcU21+PRB8VAyImXQGG5G8SxK9cP3jClrLogD+ ESJopDhEHrIykxXwmLjjM5j9gK35EeESvDhLcv+BuK6bEuiRJGlE8Q0XSM4NAh+5cg7Y iTDw== 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=D7GWj/lXqLo0o5VRDqbo6Uitm8MC1Kjd/6DUhBjIuPo=; b=MY189kc+NencyN0i6fCyOgHXA34PSKkVO4nv0dWRllwcG80ynSCyWf50RLuEvDk3cG l38IE/5cRGgj7myanzPIFlw41BWmiIe3HaPbiUZzDt5WkqYklFkzFPKkl+0raLSQHUJw ZhvJyR/9GiSMzWRuQoJkML6+lsE2kqN5XXKAFG+O/TtS1iW5SC+TdOxR92ljBXT2G0ym Zoe7cqMqp4L5X/6FLIBx1976Ndr1o1qa8NWDIe9EpOy1/TkrQMc+9nN/xoAJvc917ez2 0VyV+2DD2kCsyT5GcJH5SHU50L0A0ChSMFQXyaaoG8WdLaB4qiHgIK45h7eeiLiCaH1I yxOg== X-Gm-Message-State: APjAAAUhZDQB84bymJOie0ciC+j+xXXyDCaxDo8VJiECCD36JfkK5qEh sz0MnmwHCUcPQ1a6duUPKJn4jveYPmY= X-Received: by 2002:aa7:951c:: with SMTP id b28mr57475214pfp.99.1558298283888; Sun, 19 May 2019 13:38:03 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id i7sm11397448pfo.19.2019.05.19.13.38.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 13:38:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 19 May 2019 13:36:38 -0700 Message-Id: <20190519203726.20729-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190519203726.20729-1-richard.henderson@linaro.org> References: <20190519203726.20729-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [PATCH v7 26/74] linux-user: Split out time 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" Signed-off-by: Richard Henderson --- linux-user/syscall-defs.h | 3 +++ linux-user/syscall-time.inc.c | 32 ++++++++++++++++++++++++++++++++ linux-user/syscall.c | 13 +------------ linux-user/strace.list | 3 --- 4 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 linux-user/syscall-time.inc.c -- 2.17.1 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 3fad9d51f0..9950b73e76 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -127,6 +127,9 @@ SYSCALL_DEF(shmdt, ARG_PTR); #if !defined(SYSCALL_TABLE) || defined(TARGET_NR_shmget) SYSCALL_DEF(shmget, ARG_DEC, ARG_DEC, ARG_HEX); #endif +#ifdef TARGET_NR_time +SYSCALL_DEF(time, ARG_PTR); +#endif #ifdef TARGET_NR_unlink SYSCALL_DEF(unlink, ARG_STR); #endif diff --git a/linux-user/syscall-time.inc.c b/linux-user/syscall-time.inc.c new file mode 100644 index 0000000000..14fec88e47 --- /dev/null +++ b/linux-user/syscall-time.inc.c @@ -0,0 +1,32 @@ +/* + * Linux time related syscalls + * Copyright (c) 2003 Fabrice Bellard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifdef TARGET_NR_time +SYSCALL_IMPL(time) +{ + time_t host_time; + abi_long ret = get_errno(time(&host_time)); + + if (!is_error(ret) + && arg1 + && put_user_sal(host_time, arg1)) { + return -TARGET_EFAULT; + } + return ret; +} +#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0bf5901014..ea89734706 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5384,18 +5384,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, void *p; switch(num) { -#ifdef TARGET_NR_time - case TARGET_NR_time: - { - time_t host_time; - ret = get_errno(time(&host_time)); - if (!is_error(ret) - && arg1 - && put_user_sal(host_time, arg1)) - return -TARGET_EFAULT; - } - return ret; -#endif #ifdef TARGET_NR_mknod case TARGET_NR_mknod: if (!(p = lock_user_string(arg1))) @@ -9392,6 +9380,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #include "syscall-ipc.inc.c" #include "syscall-mem.inc.c" #include "syscall-proc.inc.c" +#include "syscall-time.inc.c" #undef SYSCALL_IMPL #undef SYSCALL_ARGS diff --git a/linux-user/strace.list b/linux-user/strace.list index 3f79159b63..95706a696b 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1350,9 +1350,6 @@ #ifdef TARGET_NR_tgkill { TARGET_NR_tgkill, "tgkill" , NULL, print_tgkill, NULL }, #endif -#ifdef TARGET_NR_time -{ TARGET_NR_time, "time" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_timer_create { TARGET_NR_timer_create, "timer_create" , NULL, NULL, NULL }, #endif