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=1681150991; cv=none; d=zohomail.com; s=zohoarc; b=EXhm2YDfAClYJwDNRdhGAPEXhbNosQAmeec7bjaKL4DGirgsNb4m9+yPhngPYRn9G/HYsaO3qzI+cMycJVjRayn0QCTgD6pqGXAWFVEmCyaOnku7Ya2dwKGYmH5mU6y8VaBG+k7+6e66dhIo94uWPJx+iJj6Ok+Cs6o0gQ7H8f8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681150991; 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=YqE0cOIeNp+kyq+c5+Esj5WEVDxO+dIWwYCwGSiBV/o=; b=KQFmZ6aDF5WI1ryU8lvudYR1GOpMXJtmdvzxPkx7AzuIFsryK4eH2PwMowEDmtGPb0p7Lx8DzQCoJMyVTvqe5QcruWtb9MOQqChJ43tYwIsb2SMwqVnHRszmXdAhfsTVqtwYAsw8O0U2bkwgdBOJpODphkJ4iCqVMNAPnERIfCs= 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 1681150991389858.9332799071999; Mon, 10 Apr 2023 11:23:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plw8v-0002it-S0; Mon, 10 Apr 2023 14:21:29 -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-0002dz-OC for qemu-devel@nongnu.org; Mon, 10 Apr 2023 14:21:13 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1plw8c-0000f5-4o for qemu-devel@nongnu.org; Mon, 10 Apr 2023 14:21:11 -0400 Received: by mail-il1-x130.google.com with SMTP id k7so13378539ils.3 for ; Mon, 10 Apr 2023 11:21:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 11:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1681150869; 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=YqE0cOIeNp+kyq+c5+Esj5WEVDxO+dIWwYCwGSiBV/o=; b=jUM2dqPfr1ReKxXEs8izTyl6Idsz+U0dzA9GmgE/28YWpKS4ZJYk3S6Dixe/8QIXHv dHkFarcozqCPK2hU6pbvGc9BumlIF9B2idR0rrGWcE2/y6vGfi14/foSXJW8ft9MDiHB n8XZPAJwx++zcTnkmhZdiZH67cHAQQOf9vRaUCvChQcCM/n79kDaBXa8vuNuSsl7aeXd 3OxXASfIcSGbeB1BSynIkv/xU5xgSEgd3Gd36lZYFOi0P/zrMOnHXE/anqdhnmwc9Drr gxYgAh20ilhk1d7m1J89gT7QQaWzPTqJiDwvlyWrYcymBSEmYy4Rm66ZwHkHGS6dedAi f52g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681150869; 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=YqE0cOIeNp+kyq+c5+Esj5WEVDxO+dIWwYCwGSiBV/o=; b=O0D1gGL2Lo7+zGF4CNGVsw2R4stQa55F4XiZKL+0EQApwoPp7jwOG+eR2Q7of5H/qC 2GBjS5mLP0Ir/OlY7ChAkYS02npw0VDAe02p0sGMRfHOCueiuO3bBJp3Z99NuNCf3lyT QX6gM73dKun4ayzpkG2it4VLfgZarxSz1WqiiH4q6PRljrykDrKs6ons8JI2rlb0Cgof xt2CXP9FBq9J/Nwv39Mt4rrgNwwesAC+SYCejHVYQEKXRPzDQnW7e90Wb1pDbrrQrO7A KpmWaO94l0oFSWZWa/yx1tw4UFlo+LdZB9CZu06z54K9/UeYWozbVF6E6xZrASbvQMGG 4EPA== X-Gm-Message-State: AAQBX9drPxoZuUq+LVvOYng0LvJncu+T/hmvAqeFJhGoLuSRu68DerEG TnBel5pK4GKDQ6Mp6LQ8juFAJO4DwuDNf/JCMmI= X-Google-Smtp-Source: AKy350YUXl+H7KdYL85KAd3iRQm8ItSVPhnxhfoJuSmHVPSpnKoAyE/nv22Vj0izVjWHPbxpJKtgAQ== X-Received: by 2002:a92:50b:0:b0:328:6172:a739 with SMTP id q11-20020a92050b000000b003286172a739mr188367ile.23.1681150868727; Mon, 10 Apr 2023 11:21:08 -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, Richard Henderson Subject: [PATCH v2 04/19] bsd-user: Move system FreeBSD call table to freebsd/os-syscall.c Date: Mon, 10 Apr 2023 12:20:41 -0600 Message-Id: <20230410182056.320-5-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::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.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: 1681150993282100002 Content-Type: text/plain; charset="utf-8" Move the system call table, and FreeBSD helper routines out of strace.c. We do not support multiple BSD-types in one binary, so simplify things by moving it. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 19 +++++++++++++++++++ bsd-user/qemu.h | 5 ----- bsd-user/strace.c | 17 ----------------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index c8f998ecec1..354a38943e5 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -517,6 +517,25 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, return ret; } =20 +static const struct syscallname freebsd_scnames[] =3D { +#include "freebsd/strace.list" +}; + +static void print_freebsd_syscall(int num, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long a= rg5, + abi_long arg6) +{ + + print_syscall(num, freebsd_scnames, ARRAY_SIZE(freebsd_scnames), arg1,= arg2, + arg3, arg4, arg5, arg6); +} + +static void print_freebsd_syscall_ret(int num, abi_long ret) +{ + + print_syscall_ret(num, ret, freebsd_scnames, ARRAY_SIZE(freebsd_scname= s)); +} + /* * do_freebsd_syscall() should always have a single exit point at the end = so * that actions, such as logging of syscall results, can be performed. This diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 22e16816a9e..c5240938da7 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -196,11 +196,6 @@ struct syscallname { void (*result)(const struct syscallname *, abi_long); }; =20 -void -print_freebsd_syscall(int num, - abi_long arg1, abi_long arg2, abi_long arg3, - abi_long arg4, abi_long arg5, abi_long arg6); -void print_freebsd_syscall_ret(int num, abi_long ret); void print_netbsd_syscall(int num, abi_long arg1, abi_long arg2, abi_long arg3, diff --git a/bsd-user/strace.c b/bsd-user/strace.c index e45909b8688..7d0117fd3cf 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -146,9 +146,6 @@ void print_syscall_ret_addr(const struct syscallname *n= ame, abi_long ret) * An array of all of the syscalls we know about */ =20 -static const struct syscallname freebsd_scnames[] =3D { -#include "freebsd/strace.list" -}; static const struct syscallname netbsd_scnames[] =3D { #include "netbsd/strace.list" }; @@ -212,20 +209,6 @@ void print_syscall_ret(int num, abi_long ret, const st= ruct syscallname *scnames, /* * The public interface to this module. */ -void print_freebsd_syscall(int num, abi_long arg1, abi_long arg2, abi_long= arg3, - abi_long arg4, abi_long arg5, abi_long arg6) -{ - - print_syscall(num, freebsd_scnames, ARRAY_SIZE(freebsd_scnames), arg1,= arg2, - arg3, arg4, arg5, arg6); -} - -void print_freebsd_syscall_ret(int num, abi_long ret) -{ - - print_syscall_ret(num, ret, freebsd_scnames, ARRAY_SIZE(freebsd_scname= s)); -} - void print_netbsd_syscall(int num, abi_long arg1, abi_long arg2, abi_long = arg3, abi_long arg4, abi_long arg5, abi_long arg6) { --=20 2.40.0