From nobody Tue Feb 10 01:50:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681150977; cv=none; d=zohomail.com; s=zohoarc; b=CryHsPtfZz+F+tOS99fAWGj7cWafkNQt6cniwZKf88RFUeRzlUr6qMu/d/HSLkEhoij3nh1BuzeCoftkhqk4kZJVQfm7B0TYhiJxhdqdT0O78jlmfQv9qtKykKVfx0D/nkaHYOIXxHnGkKZMbkM8GlDSG/IxDWRN+O0gK38B97A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681150977; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vxR1gdsQAsuHf2IN6tJm6YdCj/AcvFHJBZVDZiQZkYs=; b=Rx8vnWTX+8pbs3TKEp3NpEqqVIgUbMScrrMVLnHgbYyuX69K431e4JUeomjqPga9Xu/4WFEGQjwLDDIUpmbTLihQx1LHOGNSyyIQPQjZDBi2gCqXgv+ZNckmHvW6ddZXquXYeX7nlh0sFK8p0GUI5T8/WgrpthxR/lcHfoKs1kc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681150977805333.567464010005; Mon, 10 Apr 2023 11:22:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plw8x-0002kr-Nj; Mon, 10 Apr 2023 14:21:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plw8d-0002e0-P3 for qemu-devel@nongnu.org; Mon, 10 Apr 2023 14:21:13 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1plw8a-0000eq-DX for qemu-devel@nongnu.org; Mon, 10 Apr 2023 14:21:11 -0400 Received: by mail-il1-x12a.google.com with SMTP id s4so2662993ilv.11 for ; Mon, 10 Apr 2023 11:21:08 -0700 (PDT) Received: from dune.bsdimp.com (c-71-237-47-177.hsd1.co.comcast.net. [71.237.47.177]) by smtp.gmail.com with ESMTPSA id a15-20020a056e02120f00b00313b281ecd2sm3104314ilq.70.2023.04.10.11.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 11:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1681150867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vxR1gdsQAsuHf2IN6tJm6YdCj/AcvFHJBZVDZiQZkYs=; b=1gBf4Cgb59rbB3qOtNU01kiosgLcIyXYrzbWd5Be8vZIBM+4Vp0QjaNgBQW3ovsb/D FdZuu7nPTcK6Sd2zRM2UYHqNiKc1imXuHc0zDU7jI7RzH6LVJdR7QBIeAY3LGm/xZZoU CFyBUNUjNPXqTThDGRiaOSD3F7x+q0z30livbZ9SJ/wX36/yHI4SITw7IKCGKOZDt/vT BXUKOLdBopzfSqN3MhgFVbhS029+0EPYEacedUE3KU5Kv0mhVINgbT2vxi72vY1nhpt1 Asg9fZ1HxxGiSzU/zKvE7gAGGo3fogzDJ0K2gDZjevJmK0t9z3Yxt04omeRbbzghWtV/ SL1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681150867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vxR1gdsQAsuHf2IN6tJm6YdCj/AcvFHJBZVDZiQZkYs=; b=fC2KqeL/F9XlzQGHlazDPH5G3iG9JM/TDZJeIrBwMLyZxLBtFyupgR96j6xgtzE//Z SOOIWqyndgadwMdWJfjQ+g3tl2zabOtBqTPJgy/11wzia6WFu1YXt7PGG7YhaqSFwogJ 2oLL87fsQndgSTMjhd+Ld+5OzT9fvxNVC6STXc9uvZ0H+pdV1+FNWl12KvnxBusQTJIi laTAWRlCvDcgH9hLcldrgqwwVMqNF49kXCxKqc2qoMJe6ppwaCRlMk4Jzk3Gq3ykhIQ2 sqNVkg8wUjNpValutfxsvyBoZj4UoOehCiPaXL+/wFfNlHDxh75tzgbgkwi4ORkZRosC nCjw== X-Gm-Message-State: AAQBX9ecW+vSbCSsYDjo1+4HGxsc6s2Bys50iN2PTytbne/FzSxWacM+ 9utRQMrwT9oe6g1yuzWnwR/B1B+FH2C/tC8eGfs= X-Google-Smtp-Source: AKy350ZlJsreSzRIETfN2KhEk0PN/2OIKCPxt/bValKfcd/z83lG8b6XrV3phcXAaANIgAfl45hv3A== X-Received: by 2002:a92:c811:0:b0:328:8245:38a2 with SMTP id v17-20020a92c811000000b00328824538a2mr4454585iln.8.1681150866964; Mon, 10 Apr 2023 11:21:06 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: jrtc27@jrtc27.com, riastradh@netbsd.org, Kyle Evans , Ryo ONODERA , Brad Smith , Warner Losh , reinoud@netbsd.org Subject: [PATCH v2 02/19] bsd-user: Ifdef a few MAP_ constants for NetBSD / OpenBSD. Date: Mon, 10 Apr 2023 12:20:39 -0600 Message-Id: <20230410182056.320-3-imp@bsdimp.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230410182056.320-1-imp@bsdimp.com> References: <20230410182056.320-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12a; envelope-from=imp@bsdimp.com; helo=mail-il1-x12a.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1681150979198100007 Content-Type: text/plain; charset="utf-8" MAP_GUARD, MAP_EXCL, and MAP_NOCORE are FreeBSD only. Define them to be 0 if they aren't defined, and rely on the compiler to optimize away sections not relevant. Added only to the top of mmap.c since that's the only place we need this. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/mmap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index d6c5a344c9b..2d91e8e8826 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -20,6 +20,20 @@ =20 #include "qemu.h" =20 +/* + * Not all the BSDs have all the MAP flags, so define some of them to 0 he= re and + * rely on the compiler optimizing always false conditions away. + */ +#ifndef MAP_GUARD +#define MAP_GUARD 0 +#endif +#ifndef MAP_EXCL +#define MAP_EXCL 0 +#endif +#ifndef MAP_NOCORE +#define MAP_NOCORE 0 +#endif + static pthread_mutex_t mmap_mutex =3D PTHREAD_MUTEX_INITIALIZER; static __thread int mmap_lock_count; =20 --=20 2.40.0