From patchwork Wed Sep 22 06:14:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF0FFC433EF for ; Wed, 22 Sep 2021 06:17:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6427460F12 for ; Wed, 22 Sep 2021 06:17:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6427460F12 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvZW-0004Hu-KU for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:17:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWq-0001JE-CW for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:48 -0400 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]:33477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWo-0007UD-SI for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:48 -0400 Received: by mail-io1-xd2b.google.com with SMTP id n71so2056347iod.0 for ; Tue, 21 Sep 2021 23:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BV9QoUo+n57AQjEYGXu9vkmc6azqGybk3j9BhDuzsdQ=; b=T1ehAf+3/evmWRqM3hwWgif7dpbEDslpmnuOTqd3Bm9jIYZ+ULqsnPHQIWSJVVAQ5j d5ViJ8V7IXitITMp8KSvvOhzT3vYHJYGFKAzJmmjm3s//0TFdeLVAASVT+oUlVbsZKRs yk8JS2O65OFOr7GJgP0JyhwXd26NDxvQtXTrKgYZGguCvusGHCVQ5rhl2TBaMFSBpLGU ckILLXI7beBAYKkqvHPr1Lp3cao4GfP98f3hHEcrXLmqZq0iDUzNX/lAGCWjyXsT8oLm AmGPqHLZDUhmxPjzj9LyjxO7hO5Y1Q949+enryQlOnVkn0HIBek3n1vBMkVVy1ShI6AZ ZtoA== 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=BV9QoUo+n57AQjEYGXu9vkmc6azqGybk3j9BhDuzsdQ=; b=bi+yw74e1qRk0lCy4iaFX+q+naJciGYPVm5IcmZMyRKYCvvqkHRtJGEnPkrMLtTSLw hHJASIEmqbDzszZSZGsBJx11A/TMOycrPUvn10UGLd27eUVvedTVB25nJcJSmEXNDt3R P7ugk6CZ0lK0RuxDNBYein4dh4ndot+3wkaYAZi4Wc1H4Wb/vuNxpPj4UfHg5kSVd3KY LnwHi25rYeTzNFw53qn9Xu1lSHvJYIBDSCWHZNj9XAEnKApY+gsL7kx4CSP6iMGTHQhU cqcHo090xOR8Kmq7QMCGhB/5c5rSpoxK4JFzWa7/3strNAjOWwPFEIw8NUn6SsU3V6am g6IQ== X-Gm-Message-State: AOAM5301iEouznsLeNVnekhqxwCX+Jz/WRv6sptd74VY1A7HNShkoM1U F3zW05Kjqivrzyse5QoKA+gkxyFnawDEVunY/wc= X-Google-Smtp-Source: ABdhPJwZJfEIAUjiyHoKUal0RWZ1Ylxg+WKTSNchShls2AeHWTkq4hAr33M3MuxDyh++XhB/2XmEGA== X-Received: by 2002:a5e:a60e:: with SMTP id q14mr2976710ioi.55.1632291285646; Tue, 21 Sep 2021 23:14:45 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id a25sm540817ioq.46.2021.09.21.23.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:45 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 05/14] bsd-user/errno_defs.h: Add internal error numbers Date: Wed, 22 Sep 2021 00:14:29 -0600 Message-Id: <20210922061438.27645-6-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2b; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh , Stacey Son Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stacey Son To emulate signals and interrupted system calls, we need to have the same mechanisms we have in the kernel, including these errno values. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/errno_defs.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bsd-user/errno_defs.h b/bsd-user/errno_defs.h index 1efa502a12..b538dd93da 100644 --- a/bsd-user/errno_defs.h +++ b/bsd-user/errno_defs.h @@ -1,6 +1,3 @@ -/* $OpenBSD: errno.h,v 1.20 2007/09/03 14:37:52 millert Exp $ */ -/* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */ - /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -37,6 +34,9 @@ * @(#)errno.h 8.5 (Berkeley) 1/21/94 */ +#ifndef _ERRNO_DEFS_H_ +#define _ERRNO_DEFS_H_ + #define TARGET_EPERM 1 /* Operation not permitted */ #define TARGET_ENOENT 2 /* No such file or directory */ #define TARGET_ESRCH 3 /* No such process */ @@ -147,3 +147,11 @@ #define TARGET_EIDRM 89 /* Identifier removed */ #define TARGET_ENOMSG 90 /* No message of desired type */ #define TARGET_ELAST 90 /* Must be equal largest errno */ + +/* Internal errors: */ +#define TARGET_EJUSTRETURN 254 /* Just return without + modifing regs */ +#define TARGET_ERESTART 255 /* Restart syscall */ +#define TARGET_ERESTARTSYS TARGET_ERESTART /* Linux compat */ + +#endif /* ! _ERRNO_DEFS_H_ */