From patchwork Tue Dec 14 00:25:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523659 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5338877wro; Mon, 13 Dec 2021 16:32:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+LDGR3i6pvNZxY9dFm+rlQ67blqy7jta+7/vR/qWsnVR8ydGHirb/Ob8vLa3CYvkfNJYX X-Received: by 2002:a05:6102:c0e:: with SMTP id x14mr2362473vss.24.1639441935395; Mon, 13 Dec 2021 16:32:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441935; cv=none; d=google.com; s=arc-20160816; b=0bdtVcufiORgtQk58PWGcEg/3U3uoUHn+MVFObvy/oaEnFQOE5fvTR8P56EBDKOlPX cJpTwbmeeEy6J8OL3Kr2OpuZ8TrPALPn1OVvJ8GX1aw68pbSmVTHCN/HEQqGb83HipKw ByCD5qHNcUCeeSDHVJIXbfXRv1Kr1WvTzmDLyZw2clNa27jPtagp9ZQLPHgO2ljrNS29 3kaaw3o96p+Q8QQ+N1rPcEsN7e6FwPy7Mlk628M4/g78AEAfka63N00YvEw6D7AWkf1Z 6v/iOLE6TCpjrGbBmxQpmZ1VgF4VbSzkOBPQCc1t7xGb0GopSMFooraPBgO7Z8IT40ig aWmQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HHuNKnhfo/1w0XhuBwX3/PDJWu35E1qSroF+d/Nu4gg=; b=uL7yTRKhrdwZPMp/o45NntDD+A8Y+2Gz1RYTiToH+E/aa9Maib4fQ2JuAoiI1SlUxT cUzAOF5OnWKojtVF6c38sw3nPKTD5cZQU3Gx0WoGejJquGDrklakY8IXDDIwmKXr98FG cQcCh4BhLZD6zJqrw+iIrH1VnfIPK228m486XxSgs/P7Iz8EbzlJsnp4iV24q4xGySvr YhsCbXhjHbWmUnU+OJiFJPvHVVX/DcvtqHXe+0ag9LvI7aDKD4hXxCjgZ8/LX75dOagY NOEpAKgunxrx5cOVc9hAlxF9rAMnPXyC9lwATzVS6w+TeJgt2keC9JwdIFQZg6KvoMQU bVqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xHAihF5f; 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=pass (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 w12si10936511uaj.7.2021.12.13.16.32.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:32:15 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=xHAihF5f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvjq-0007rv-PZ for patch@linaro.org; Mon, 13 Dec 2021 19:32:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveA-0008GE-Vb for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:23 -0500 Received: from [2607:f8b0:4864:20::62b] (port=46997 helo=mail-pl1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve5-0005Sq-1t for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:22 -0500 Received: by mail-pl1-x62b.google.com with SMTP id p18so12332512plf.13 for ; Mon, 13 Dec 2021 16:26:16 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=HHuNKnhfo/1w0XhuBwX3/PDJWu35E1qSroF+d/Nu4gg=; b=xHAihF5fnAB24mFHo66RY38HsKkD9qqAanvezlTSRVowpXZMdQZjauxTbj7BZPZg8x 3zbqgzje3dOYLG9y1DLIx5PSKvUzBK8i0StTpm0P7N0ovVaHfiYbQN8LRaP3PldJ5ddh xYuSP4BIvhvIimWLy2dTNuLlbNnOj+itSiDkdNWC9h/oU492JgBqDvymoeMT0kQRURw4 qeylRZrss7wc9JmK5HykLwncXQeeGIrbNhYHszqYwbc4y936DqJLg3JzspVHnwQSFLKr 8+eKc4eUXRfkDuNKWjaoSCQNUqmRrXO4yU72dwzzqHDebC5kjra6RTTKO4DSavxB0qte bv3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HHuNKnhfo/1w0XhuBwX3/PDJWu35E1qSroF+d/Nu4gg=; b=CO6W7wYTyd4BF4AEYVpe3fw6Sd4913pIjpz42tADlhFpWFPZE2iWwDyPPkQXbQEWhy 6zcDpij4x70DYNAMpkSNP09EioOSNkId+c3Tf73iRjk9C5ywovmcT6KR75c0fgQXyGPP ixvm8BEtPz95CN+E6Ku56CFuz1jwAY+iZnfc1wWbfMmREZ67tGH86mzaUCnOnwlVcSAC 4Jm3EuLQovTjoXCNU3Fm0DygwbL4q32b53yGcEq7DrMInXYxPbv5dj2KK5onEvV7wSWH r95dQhytdJrl4zuOePurpyHAn0T041sqOzb5sbXgXc6LMX7KMuUZ9IcMJPG3bHezIy4z gSXw== X-Gm-Message-State: AOAM533jP9X1NhFnJk4SAxTLbdxSUkAFSJvch7bVBrV6H4h8xq3AahN8 ezYnokGhASMvrNVuur0P7LLiGeByy0ancg== X-Received: by 2002:a17:90a:ec0a:: with SMTP id l10mr1755670pjy.92.1639441575802; Mon, 13 Dec 2021 16:26:15 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 10/15] bsd-user: Create special-errno.h Date: Mon, 13 Dec 2021 16:25:59 -0800 Message-Id: <20211214002604.161983-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Pull the internal errno used by qemu internally its own header file, for use by safe-syscall.S. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/errno_defs.h | 6 +++++- bsd-user/special-errno.h | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 bsd-user/special-errno.h diff --git a/bsd-user/errno_defs.h b/bsd-user/errno_defs.h index 141e08456c..73cfa24b7f 100644 --- a/bsd-user/errno_defs.h +++ b/bsd-user/errno_defs.h @@ -151,6 +151,10 @@ /* Internal errors: */ #define TARGET_EJUSTRETURN 254 /* Just return without modifing regs */ #define TARGET_ERESTART 255 /* Restart syscall */ -#define QEMU_ERESTARTSYS TARGET_ERESTART + +#include "special-errno.h" + +_Static_assert(TARGET_ERESTART == QEMU_ERESTARTSYS, + "TARGET_ERESTART and QEMU_ERESTARTSYS expected to match"); #endif /* ! _ERRNO_DEFS_H_ */ diff --git a/bsd-user/special-errno.h b/bsd-user/special-errno.h new file mode 100644 index 0000000000..03599d9b5a --- /dev/null +++ b/bsd-user/special-errno.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * QEMU internal errno values for implementing user-only POSIX. + * + * Copyright (c) 2021 Linaro, Ltd. + */ + +#ifndef SPECIAL_ERRNO_H +#define SPECIAL_ERRNO_H + +/* + * All of these are QEMU internal, not visible to the guest. + * They should be chosen so as to not overlap with any host + * or guest errno. + */ + +/* + * This is returned when a system call should be restarted, to tell the + * main loop that it should wind the guest PC backwards so it will + * re-execute the syscall after handling any pending signals. + */ +#define QEMU_ERESTARTSYS 255 + +#endif /* SPECIAL_ERRNO_H */