From mboxrd@z Thu Jan 1 00:00:00 1970 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,URIBL_BLOCKED,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 31538C4320E for ; Thu, 26 Aug 2021 21:33:56 +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 EB1BD60F6F for ; Thu, 26 Aug 2021 21:33:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB1BD60F6F 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]:45728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJN0V-000076-4Y for qemu-devel@archiver.kernel.org; Thu, 26 Aug 2021 17:33:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJMfw-0006Cl-WF for qemu-devel@nongnu.org; Thu, 26 Aug 2021 17:12:41 -0400 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]:35458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJMfv-0006sF-C1 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 17:12:40 -0400 Received: by mail-il1-x131.google.com with SMTP id h29so4749669ila.2 for ; Thu, 26 Aug 2021 14:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tu+3Mzgedz4+rqUQiO3m+rYiNxkgF+2/GqBtZIvUR6I=; b=CGlnBzKdvQgaVgPWCrFCQHyFDjB6HDYlYNMqrvWyO0+YvcSCuoQn0xC8uO+caFGcLU C/9O4BF7TojcPROZ5m7I9Zd/zHgUe6fV5chYMKfdxrzdFRGzH0W0M93sCGoXMr4SGl/4 QgWWH1HHkUkfeYeab2nLCrZsEfS3ZjZQhEVUjrAYPbY4FgaElqndiCBmt4/qHo5LbZB9 LQPDQymqdKNwKqc7bYi+mDLQ33KDrmWNdhUySyPMNFQeogExrTlLh/Ot5seANZhnrLVJ soT+8pWEW/EKu8POYze9mEMA4nnCgTgr6I9bbi/F2B+VHOOFzuLsUlmcKzO8TVYtRw4n 3DHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tu+3Mzgedz4+rqUQiO3m+rYiNxkgF+2/GqBtZIvUR6I=; b=dEd+2vCEiAlqBddvWQRjD71Ljmj9Ia5lZo+eP6TUqjwM1hpdoPEo/Zu7UmR9gGHX6d O5hM4/V2ApB3nsjxAhHYDvj3F1is6+GDM96u5eiIny0lBHVjrmAo0qGOKl8DtnrH3/PA OnSM0d1GQiBr0Mvxn0/advAG+7qf1ABeRKpiYCAV1qZC2m5hxkHkImA//qHa87iY4lVh Yumai7yhiZ5vaXDcOu8VzB+mZwP+vpDZQ3YjKiF+dAfBFnISmIejd4sqi2LcfM7sdQqF POqXf+RrUGPsQrGfA1P6Yw9syF03mzEns385B9XMJaguIiJWC06DpcaPhH5Gbbo1HDXv c/Nw== X-Gm-Message-State: AOAM533tB5kCHJe5S5oZNTDGAZ/ivZVk8Sf0zlMqkhqDFLOwn9YPYfjJ KlK/Y3LSV4QKPSxocYiYPgAoZp48xp/Vs3zE X-Google-Smtp-Source: ABdhPJwxXcVL/crUYRDGSvwK6S7J0WLD3NjJLLsyovdIJaJy7p/LE5vNCqjGQyRViGkhrX7LyZy1Bg== X-Received: by 2002:a92:d848:: with SMTP id h8mr3842766ilq.230.1630012358051; Thu, 26 Aug 2021 14:12:38 -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 a17sm2348633ilp.75.2021.08.26.14.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 14:12:37 -0700 (PDT) From: imp@bsdimp.com To: qemu-devel@nongnu.org Subject: [PATCH v2 17/43] bsd-user: Include host-os.h from main Date: Thu, 26 Aug 2021 15:11:35 -0600 Message-Id: <20210826211201.98877-18-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210826211201.98877-1-imp@bsdimp.com> References: <20210826211201.98877-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=2607:f8b0:4864:20::131; envelope-from=imp@bsdimp.com; helo=mail-il1-x131.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: Richard Henderson , Stacey Son , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Warner Losh Include host-os.h from main.c to pick up the default OS to emulate. Set that default in main(). Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/host-os.h | 2 ++ bsd-user/main.c | 4 +++- bsd-user/netbsd/host-os.h | 2 ++ bsd-user/openbsd/host-os.h | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bsd-user/freebsd/host-os.h b/bsd-user/freebsd/host-os.h index a799164324..ceb1543d06 100644 --- a/bsd-user/freebsd/host-os.h +++ b/bsd-user/freebsd/host-os.h @@ -20,4 +20,6 @@ #ifndef __HOST_OS_H_ #define __HOST_OS_H_ +#define HOST_DEFAULT_BSD_TYPE target_freebsd + #endif /*!__HOST_OS_H_ */ diff --git a/bsd-user/main.c b/bsd-user/main.c index 3f6f4080e8..3a23e63cf8 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -41,6 +41,8 @@ #include "exec/log.h" #include "trace/control.h" +#include "host-os.h" + int singlestep; unsigned long mmap_min_addr; uintptr_t guest_base; @@ -352,7 +354,7 @@ int main(int argc, char **argv) const char *gdbstub = NULL; char **target_environ, **wrk; envlist_t *envlist = NULL; - bsd_type = target_openbsd; + bsd_type = HOST_DEFAULT_BSD_TYPE; if (argc <= 1) { usage(); diff --git a/bsd-user/netbsd/host-os.h b/bsd-user/netbsd/host-os.h index b44cb7fdda..ccbea076e6 100644 --- a/bsd-user/netbsd/host-os.h +++ b/bsd-user/netbsd/host-os.h @@ -20,4 +20,6 @@ #ifndef __HOST_OS_H_ #define __HOST_OS_H_ +#define HOST_DEFAULT_BSD_TYPE target_netbsd + #endif /*!__HOST_OS_H_ */ diff --git a/bsd-user/openbsd/host-os.h b/bsd-user/openbsd/host-os.h index 9083555f26..79468073e4 100644 --- a/bsd-user/openbsd/host-os.h +++ b/bsd-user/openbsd/host-os.h @@ -20,4 +20,6 @@ #ifndef __HOST_OS_H_ #define __HOST_OS_H_ +#define HOST_DEFAULT_BSD_TYPE target_openbsd + #endif /*!__HOST_OS_H_ */ -- 2.32.0