From patchwork Tue Nov 23 17:37:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519326 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp8978470imj; Tue, 23 Nov 2021 09:42:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyxZVdPcEEvW+wpW+3xqDb23dMUkpIaxA1Wxqq5fPgkv8mxO2dD85ZCT8mE45Cz4rmVmkp X-Received: by 2002:a05:6102:c8a:: with SMTP id f10mr11826495vst.22.1637689336845; Tue, 23 Nov 2021 09:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637689336; cv=none; d=google.com; s=arc-20160816; b=buRDDS0k/lQElHa2xEG2orj3gBw/sWt29kB/G0dMCaVrxzqQOU36ojVVzF2JaihY59 YhzH2XcLDcTbClFUZe4jOt2oj9lOF5gEgWsuZqiHQ4yoSuySLMWW5E/iXIfe+6+nFdiY VvPjpsE6vzgrni5k0n6LT8EyGAWLWko3x5OtR3UK4fVqWcFzGcVBLKqlOzmcHU4XDEML tvYKIvBQelGy57e0v19tS+scMhSeIiWGGHPI0v4QFRe3lRbfT9GT0GO9F9bHWboxOjIZ Tbz7wXXN/JkFqfm2PndncR7FmYn6zQqNDXi0B/HL4k52eDJQfAMUIFz3Q4n2BTJgstc0 EZiQ== 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=nW/RjD5bFvPlKMJasiT8Pr/Z2/lP3A9S7na+9HD4LgtelmAX45fBUwty5kKcjPW06E tlH6HpF1ft++sGV13tFSG/4tEsBf5ZHRo7/7CFaphlMcUOuKeIzF1tRBJpc60+KCBIRK A4G0sacWpPaTXvanAVyRMbiadZZ7dF+NM6fk0ck+ALc5G2AXdNuXtjwHGZEV4u2xX6sJ 0386eS69S7tx0v2/iBmGXwWcpq7gaMAXWKOpdZD8YBSDimJVILVgMRSYankTGlfQQbhs K64M1Z78Pb+mk9LLSv+r5v9t2FsXyaFihyaVd5VtyTUjKym29poeVzmzscWnH79zSBqt xg2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FimBvJdc; 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 s12si5780441uar.70.2021.11.23.09.42.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Nov 2021 09:42:16 -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=fail header.i=@linaro.org header.s=google header.b=FimBvJdc; 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 ([::1]:40684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpZo5-0003ar-Hq for patch@linaro.org; Tue, 23 Nov 2021 12:42:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpZkN-0004Sl-0S for qemu-devel@nongnu.org; Tue, 23 Nov 2021 12:38:23 -0500 Received: from [2a00:1450:4864:20::32a] (port=42933 helo=mail-wm1-x32a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpZkL-00051A-Ge for qemu-devel@nongnu.org; Tue, 23 Nov 2021 12:38:22 -0500 Received: by mail-wm1-x32a.google.com with SMTP id d72-20020a1c1d4b000000b00331140f3dc8so3257536wmd.1 for ; Tue, 23 Nov 2021 09:38:20 -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=FimBvJdcIMhGd7b1EaVa1vdJBrLU5iBS3jvMX3zJQq3+jut1z1Yv10PTbHieu5pwGM xJ5HaBQKwUTbO2S1v2ULqcnoRtbvGbeZqQcSDF4rppQMbu1aTxAMyq/P3WhkjoRXsijn iEY8B2KSaJ7b7Wb0J3MJzeIkY6TyXVrckDDGhXw2crKC3mjcqfH5B2gro9dxaZBWQ3Nv C5nOKWpBeT101OqJoY3ythmtxIWEBagcs+6QCsURjxw7mdOsW27gh7I8sIOYP/48IcYe 31lxWInrxZWLuve5eYgeXzvB7Hs0CIieQAQPt5ruqKNJI/zFbwLBk8ZbFb0ss785oaVn X7HA== 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=Hqr8o8T8xIgKDHjXkYKLoEqm8FjiRlbwHYuIh27UiO3ylbcUctDy54mWvdDBKhgRy6 BZEnqceJDEAuxSAkiX6HLPjqifrnkvSk6r3ceaUnPfsIKdIOFZB2VXwWQwW2ZGZOeHZI lI+WJSAJ59EWvuB2z84hND9HWsaMlqBYciCGzDR4KI5M+i8wrMw/U6uY48pSFb/cI4oF rpbODrivZuuSQ6CHK7Txstr+gh8Ewn6VPt8RK6xU+TuX0K7tn2wL8AnG6ThXqD1/5/JR k+FTduqo1yoqrHr0g0l0bfODSJSpfkNo/dvZoMcLT1RcK30aSgNOdZi6TriOafpzNho8 F/OA== X-Gm-Message-State: AOAM532MgG3HAIyoKzPrvNg6iRLk6VtP0lyjcxxBYV9rgjOWp8euL4bo NAdEW3gYndVG/VlvtD3Vtic97lxt+Fh3SCXxgJM= X-Received: by 2002:a05:600c:4f0f:: with SMTP id l15mr5305484wmq.25.1637689099538; Tue, 23 Nov 2021 09:38:19 -0800 (PST) Received: from cloudburst.home (149.164.14.37.dynamic.jazztel.es. [37.14.164.149]) by smtp.gmail.com with ESMTPSA id n13sm13054883wrt.44.2021.11.23.09.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 09:38:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 11/16] bsd-user: Create special-errno.h Date: Tue, 23 Nov 2021 18:37:54 +0100 Message-Id: <20211123173759.1383510-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211123173759.1383510-1-richard.henderson@linaro.org> References: <20211123173759.1383510-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32a.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, PDS_HP_HELO_NORDNS=0.001, 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: laurent@vivier.eu, imp@bsdimp.com 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 --- 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 */