From patchwork Wed Nov 17 16:04:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519226 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp1175558imj; Wed, 17 Nov 2021 08:13:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcunqRwrGmRjcnu5oayzwB6hwCtXIaYOoz6yzmH1OgLA4glO5m04q6sVo3Si7ooXrLcDmE X-Received: by 2002:a67:cb0a:: with SMTP id b10mr20595161vsl.0.1637165622717; Wed, 17 Nov 2021 08:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637165622; cv=none; d=google.com; s=arc-20160816; b=YoI+faWTq/i2yiOkWOGbBFfKRLTOaXLIlkysu947OLypQMypQKKBMPa3Pwm26LC9L3 A3U7T6oOigpx21XN0r2iLXfRUU3xHO7QWqaq3SqmdPVfEbtyyY8QIm3Iq8QXA1i+pySm nBQtXLOzOm9WlOCgmqeqhQjaA/FJ7dgYshOh/qtILh/eLOyrF/M8DZJTJF3Mp2M8RvaY EiPNcJLxe/An/ppllj2K9+nDlSrL6GlLmWeDgSYKKfU+aOkukQSHPfX3Vcaw0PFMEYXv 6fS2uzeaKkGELZJZxzZIWHX5lHIaKniZ5GRXXV3U9/lNatj8fthBHLNQtONQV9Iy2JZ6 TsEg== 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=lsz0dSeS3alNSK0Y33VjA4yL9Dqu5Jd7cft81LB0Bvs=; b=xDtElGuiiHiVszY3zl2G2lp26wXmhtG8XkCwSftzIYEl3zT1Yfk53klrBdl5MJo0Ha Legr+nDas0sjorYDVYBFP8Lhf6WcZ4m4bCHdVOTQI2YQ7AlYHuo4u1i+4Oe/rNVqcacx mHzqpz8hKjBcZfKmVnMqxkoW5DEr9NGbpIWC8WOfvLKM6n/aEozQwslVzq2epOC6ZAE2 KmsBSMIhhZY+Gvarzl9v8ZEeCL69+BCMZbNxB4yB4OYa6RHGB0M1xmMx/Nf9+EgovFeI LoR0caswpqBpP8pLS4BMVURQwndEVQRTW9cgozPEBIVJIhuvbpUQKwkBP5HePrCRvYnj r7Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="NY/aLkbr"; 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 s6si266659uap.230.2021.11.17.08.13.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Nov 2021 08:13:42 -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="NY/aLkbr"; 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]:60554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnNZ7-0000a7-JP for patch@linaro.org; Wed, 17 Nov 2021 11:13:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnNQL-0000QM-Q5 for qemu-devel@nongnu.org; Wed, 17 Nov 2021 11:04:37 -0500 Received: from [2a00:1450:4864:20::32c] (port=46628 helo=mail-wm1-x32c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnNQK-000344-CJ for qemu-devel@nongnu.org; Wed, 17 Nov 2021 11:04:37 -0500 Received: by mail-wm1-x32c.google.com with SMTP id b184-20020a1c1bc1000000b0033140bf8dd5so2496089wmb.5 for ; Wed, 17 Nov 2021 08:04:35 -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=lsz0dSeS3alNSK0Y33VjA4yL9Dqu5Jd7cft81LB0Bvs=; b=NY/aLkbrk5LYkJJaJOUy0lm3PB4Wg+KW8Uv5KDve0MKEH/QzBaoDbJm/z1wzR6soYW UycKIV4v+/tn7oknBI+UiFj4BtwkoIAu7E00FzKEj8qG2/RKkwXNsgaDmC61J2IKETK1 pvUEbma8GCD6a+UBE8lET8QLP/0kpjjG+87UwW04BP52EQMqu937p4qXUgevREjree6F /NXldAdx0AsyE/FM5r+vYH4o8ffnLPVZSKdi2xL0B5ixs1GP6vO28RJMF61cMiZn/VFr RqFnfBx8VRdtqk4QHg8Ic58q0qjxJypa7Qwn+yhJAZ6ne4RLCa2ZKQHVmgwH3KlX8lB3 UGvw== 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=lsz0dSeS3alNSK0Y33VjA4yL9Dqu5Jd7cft81LB0Bvs=; b=3AkbbVpSUmY8F3sBxuzk8ZTaGkmjOvKputfH4Z+dq2QXXTRftA2qYxe+DwyM2y22Hq Xgvnmc2kxMdz6IxomBA4s30+SjBrCMaUysVGZkpcOy/Upc9z0OQXhSnsVhSobNYNId9W zw5UnCvYwXdHATckL/rljd9Av8YQlZwnLeRwcJIYw9/ESc819k4pE/L8vesOBSyAsDcF u6ZalCn2UGxS6hAT3S5shmJRNAyZu/+FOXU0lbLvD75gLnM/7bxUyJMFX2Xrm6QPjb4L Lfwo44bD+tBwEjmg8L78GmqxzQNLxkm2mogH2pRjkDMftvEAUc1bElUPucAudFirD7hV eLqQ== X-Gm-Message-State: AOAM531AzaARSFu89StJeD1baFPiGWUKaTrwzF9sjQJMQQjXUzaVgTz8 NdD5+bFcqJjUEC3iyDbARHql5LuGqwuzwPasTgU= X-Received: by 2002:a05:600c:22d9:: with SMTP id 25mr843725wmg.71.1637165074548; Wed, 17 Nov 2021 08:04:34 -0800 (PST) Received: from localhost.localdomain (101.red-176-80-44.dynamicip.rima-tde.net. [176.80.44.101]) by smtp.gmail.com with ESMTPSA id m2sm5826742wml.15.2021.11.17.08.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Nov 2021 08:04:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 11/17] bsd-user: Create special-errno.h Date: Wed, 17 Nov 2021 17:04:06 +0100 Message-Id: <20211117160412.71563-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211117160412.71563-1-richard.henderson@linaro.org> References: <20211117160412.71563-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32c.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. 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 583ebe8cee..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 /* compat */ + +#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 */