From nobody Sat May 30 16:35:41 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=1778121129; cv=none; d=zohomail.com; s=zohoarc; b=S+JpeN+h8LTthxzV86rYBSCNUQ4fQqnCEA8U1WAmA3u7Xrw4uGBqZ6UMz5eZe1UbKuzjdjj10/Wls4omZSPiRe4K7yiAz+K8c3D9OmJxw1REDbLSLj+5i7LtzZAiNwlL/0GKlrHOzAepx7Q4UIhePZDhJ/REThXFFD+lD1d6HZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121129; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a4qZqxhOzngQmEvRDxcGHAbPP+n1V6Vsluq21YDlzvA=; b=H5MxN6ENhdgmjMtNy8c9+TiQrckkttiStL1ix5bFJKYJfBKeELXDjrUeyS47k4iIkeLS4b1eIcq5winKDUf0/70GUtsH6MhGglVwPqqPhswLqizZ6hYH1J0BMJtgjfrqieQmwU4pLSdkOfgS+p5YDAipxNcvBwTrLjcd6Sl+b8o= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121128996389.6488352929023; Wed, 6 May 2026 19:32:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWF-0007kU-Qh; Wed, 06 May 2026 22:31:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0007Tn-8O for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVN-0000VA-8V for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:35 -0400 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7de46b8e432so336002a34.1 for ; Wed, 06 May 2026 19:30:22 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121022; x=1778725822; darn=nongnu.org; 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=a4qZqxhOzngQmEvRDxcGHAbPP+n1V6Vsluq21YDlzvA=; b=fsSh3EGm+5Jc+H98Fd+/CTKm/5YgCfyuvD8RMDG6/Oe1wm8HFZ80eIfBXdZOdiJjYO kG4A3LYPzYVdCeJsHf3LVbRifejnqwgrxbYQs/gNf60pYHKvIiEXL5H6YavvbjHrN5hx yGNewjkH0Zya3glk5wjD0QSKMe2LbSY5zH7/8jOE2uqfMyO1LIzrTCvW7EJ9mGc+KnlP 49GBU4Ex7xOWysm6KhOSdhhhPUsiCdAsDuyooiZsCz18Tf5Bhg+TnA0ohcThgizFeNUo ExoDpFLR7RVCDuRTFOuC9Z1wX6H/9OKx5DE0V6i15EbItpzswqejvjKc67A2rV6/J8DH H10w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121022; x=1778725822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=a4qZqxhOzngQmEvRDxcGHAbPP+n1V6Vsluq21YDlzvA=; b=GMvnWcDVJb70W7ENcJGOIy68ZCczozp3Ql2hSKp6I+/ZZfVUQ51uB6RBr8Qg87IMTs 7LI/Dla/+tixHI0hpihX/9HblIrpj2JdSkCGoxN0RsCKWgh9UR6oj59mPqb8eUwx0qMn UBqRPxktS7g21Kim2sxDjqHgb8Fh/lzbP+6A0mgDkP3pzgix2yxq7MWBfQ0n5UXgG4mB Uv6ZOn0t43GuzKq/Ow+vkSFUIgVaEHqo2S48tXJlZkIkp/eC0RGk0uAV3Awlcz3H9ydl UuAv4afDtn4a4aQ4w6Z80sLjKiJNROTcKQdit60yTd9/Clo5sjiPoS4jSLpVEfC+WauM K0rw== X-Gm-Message-State: AOJu0YxQndnuNWp9hSgseWIZB5QMkBhgfS22HEh0wexNensKxAgbjEtA PcaAN9Y4ezkzWiGJ0naRgZVHzd1RTGV46AGRfhjqaJ8dPWqgj3M/P8jorLU64DbouanpUyZupAC oW9BxAME= X-Gm-Gg: AeBDies7EPUb7aPG7GQIZDleLb90gg8fX35D8ziaomLK3DA+3xkn36VwrcQ++OqtqSa /FLbAaUoc3HfIJBgTHDcJqwNZNqNFzMCadhMuqjhyrzSXMx5UKBVWCcJd3ihI7soPZrNd0tPXxj +3Yl5kIKe5sOGbv/6C7hwTuHq1UsyuXhZedbsOxuvZkAImjLdS9/BXmmdqw41YAY+purnj8jNtA LrXZuDZkYiyPkR7clUApU44tA0wwNcIu30kAP2kVq9C46ept5s0voHDJm/MX4Nb627mRJQtXgPt 447NV2r0I5CddRzSJrWy4/sx92uMF4H6Rme5lDj/Va+ZnnCQdtp7AEAOTe3skQW5XRxMmqA2dU7 Gyygc2Mo8IlC+VhOBriSyq/M4/jXY7BvW4BQcdqlIc+Uxq0G3fhRQgzgdQCEazLEdbodryiU3he m39DBKzpg6lfk3SJj0xcsd X-Received: by 2002:a05:6830:6f86:b0:7dc:c338:d23d with SMTP id 46e09a7af769-7e1df072b3bmr3738585a34.14.1778121019641; Wed, 06 May 2026 19:30:19 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Sean Bruno , =?UTF-8?q?Mika=C3=ABl=20Urankar?= , Kyle Evans , Guy Yur , Alexander Kabaev , Michal Meloun , Ed Schouten , Karim Taha , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 01/25] bsd-user: Switch to SPDX-License-Expression Date: Wed, 6 May 2026 20:28:03 -0600 Message-ID: <20260507022827.44499-2-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32c; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32c.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121129753154100 Two minor changes to the copyright and license marking for these files: (1) Stacey D Son is used instead of variations of his name. (2) The GPL boilerplate is replaced by SPDX markings. No change to the terms of the license are intended, and this matches current QEMU practice. There's no changes to the license or additional claims to any IP that others may hold in these files. All the S-o-bs in this commit have given me permission to do this to the extent they may hold rights. git blame over multiple repos and branches suggests that only minimal other material is present (much of it likely not subject to copyright protection). The project's long and complex history as well as tooling limitations make it hard to be 100% sure. Any omissions are unintentional and I will correct them as they come to light. Signed-off-by: Stacey Son Signed-off-by: Sean Bruno Signed-off-by: Mika=C3=ABl Urankar Signed-off-by: Kyle Evans Signed-off-by: Guy Yur Signed-off-by: Alexander Kabaev Signed-off-by: Michal Meloun Signed-off-by: Ed Schouten Signed-off-by: Karim Taha Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Warner Losh --- bsd-user/aarch64/signal.c | 15 ++------------- bsd-user/aarch64/target_arch.h | 16 ++-------------- bsd-user/aarch64/target_arch_cpu.c | 15 ++------------- bsd-user/aarch64/target_arch_cpu.h | 18 +++--------------- bsd-user/aarch64/target_arch_elf.h | 14 +------------- bsd-user/aarch64/target_arch_reg.h | 19 +++---------------- bsd-user/aarch64/target_arch_signal.h | 16 ++-------------- bsd-user/aarch64/target_arch_sigtramp.h | 16 ++-------------- bsd-user/aarch64/target_arch_sysarch.h | 16 ++-------------- bsd-user/aarch64/target_arch_thread.h | 16 ++-------------- bsd-user/aarch64/target_arch_vmparam.h | 16 ++-------------- bsd-user/aarch64/target_syscall.h | 16 ++-------------- bsd-user/arm/signal.c | 18 +++--------------- bsd-user/arm/target_arch.h | 16 ++-------------- bsd-user/arm/target_arch_cpu.c | 18 +++--------------- bsd-user/arm/target_arch_cpu.h | 18 +++--------------- bsd-user/arm/target_arch_elf.h | 18 +++--------------- bsd-user/arm/target_arch_reg.h | 18 +++--------------- bsd-user/arm/target_arch_signal.h | 18 +++--------------- bsd-user/arm/target_arch_sigtramp.h | 18 +++--------------- bsd-user/arm/target_arch_sysarch.h | 18 +++--------------- bsd-user/arm/target_arch_thread.h | 18 +++--------------- bsd-user/arm/target_arch_vmparam.h | 18 +++--------------- bsd-user/arm/target_syscall.h | 18 +++--------------- bsd-user/bsd-file.h | 18 +++--------------- bsd-user/bsd-mem.c | 17 +++-------------- bsd-user/bsd-mem.h | 17 +++-------------- bsd-user/bsd-proc.c | 17 +++-------------- bsd-user/bsd-proc.h | 17 +++-------------- bsd-user/freebsd/os-misc.h | 18 +++--------------- bsd-user/freebsd/os-proc.c | 17 +++-------------- bsd-user/freebsd/os-proc.h | 18 +++--------------- bsd-user/freebsd/os-stat.c | 17 +++-------------- bsd-user/freebsd/os-stat.h | 18 +++--------------- bsd-user/freebsd/os-strace.h | 19 +++---------------- bsd-user/freebsd/target_os_elf.h | 18 +++--------------- bsd-user/freebsd/target_os_siginfo.h | 18 +++--------------- bsd-user/freebsd/target_os_signal.h | 7 +++++++ bsd-user/freebsd/target_os_stack.h | 18 +++--------------- bsd-user/freebsd/target_os_thread.h | 18 +++--------------- bsd-user/freebsd/target_os_user.h | 18 +++--------------- bsd-user/freebsd/target_os_vmparam.h | 18 +++--------------- bsd-user/i386/signal.c | 17 +++-------------- bsd-user/i386/target_arch.h | 16 ++-------------- bsd-user/i386/target_arch_cpu.c | 17 +++-------------- bsd-user/i386/target_arch_cpu.h | 17 +++-------------- bsd-user/i386/target_arch_elf.h | 18 +++--------------- bsd-user/i386/target_arch_reg.h | 19 +++---------------- bsd-user/i386/target_arch_signal.h | 16 +++------------- bsd-user/i386/target_arch_sigtramp.h | 16 ++-------------- bsd-user/i386/target_arch_sysarch.h | 18 +++--------------- bsd-user/i386/target_arch_thread.h | 18 +++--------------- bsd-user/i386/target_arch_vmparam.h | 18 +++--------------- bsd-user/i386/target_syscall.h | 16 +++------------- bsd-user/qemu-bsd.h | 18 +++--------------- bsd-user/syscall_defs.h | 18 +++--------------- bsd-user/x86_64/signal.c | 16 +++------------- bsd-user/x86_64/target_arch.h | 16 ++-------------- bsd-user/x86_64/target_arch_cpu.c | 17 +++-------------- bsd-user/x86_64/target_arch_cpu.h | 17 +++-------------- bsd-user/x86_64/target_arch_elf.h | 18 +++--------------- bsd-user/x86_64/target_arch_reg.h | 19 +++---------------- bsd-user/x86_64/target_arch_signal.h | 17 +++-------------- bsd-user/x86_64/target_arch_sigtramp.h | 17 ++--------------- bsd-user/x86_64/target_arch_sysarch.h | 17 +++-------------- bsd-user/x86_64/target_arch_thread.h | 18 +++--------------- bsd-user/x86_64/target_arch_vmparam.h | 18 +++--------------- bsd-user/x86_64/target_syscall.h | 16 +++------------- 68 files changed, 192 insertions(+), 971 deletions(-) diff --git a/bsd-user/aarch64/signal.c b/bsd-user/aarch64/signal.c index 6bc73a798f..ad19e5144e 100644 --- a/bsd-user/aarch64/signal.c +++ b/bsd-user/aarch64/signal.c @@ -1,20 +1,9 @@ /* * ARM AArch64 specific signal definitions for bsd-user * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" =20 diff --git a/bsd-user/aarch64/target_arch.h b/bsd-user/aarch64/target_arch.h index 4815a56ae3..7861233889 100644 --- a/bsd-user/aarch64/target_arch.h +++ b/bsd-user/aarch64/target_arch.h @@ -1,22 +1,10 @@ /* * ARM AArch64 specific prototypes for bsd-user * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_H #define TARGET_ARCH_H =20 diff --git a/bsd-user/aarch64/target_arch_cpu.c b/bsd-user/aarch64/target_a= rch_cpu.c index b2fa59efaf..6e9519e1b0 100644 --- a/bsd-user/aarch64/target_arch_cpu.c +++ b/bsd-user/aarch64/target_arch_cpu.c @@ -1,20 +1,9 @@ /* * ARM AArch64 specific CPU for bsd-user * - * Copyright (c) 2015 Stacey Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" #include "target_arch.h" diff --git a/bsd-user/aarch64/target_arch_cpu.h b/bsd-user/aarch64/target_a= rch_cpu.h index 15df84fda2..09d942b040 100644 --- a/bsd-user/aarch64/target_arch_cpu.h +++ b/bsd-user/aarch64/target_arch_cpu.h @@ -1,22 +1,10 @@ /* - * ARM AArch64 cpu init and loop + * ARM AArch64 cpu init and loop * - * Copyright (c) 2015 Stacey Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_CPU_H #define TARGET_ARCH_CPU_H =20 diff --git a/bsd-user/aarch64/target_arch_elf.h b/bsd-user/aarch64/target_a= rch_elf.h index cec254f88b..5ea5232a57 100644 --- a/bsd-user/aarch64/target_arch_elf.h +++ b/bsd-user/aarch64/target_arch_elf.h @@ -3,20 +3,8 @@ * * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 diff --git a/bsd-user/aarch64/target_arch_reg.h b/bsd-user/aarch64/target_a= rch_reg.h index b53302e7f7..9cca3c0ea0 100644 --- a/bsd-user/aarch64/target_arch_reg.h +++ b/bsd-user/aarch64/target_arch_reg.h @@ -1,23 +1,10 @@ /* - * FreeBSD arm64 register structures + * FreeBSD arm64 register structures * - * Copyright (c) 2015 Stacey Son - * All rights reserved. + * Copyright (c) 2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_REG_H #define TARGET_ARCH_REG_H =20 diff --git a/bsd-user/aarch64/target_arch_signal.h b/bsd-user/aarch64/targe= t_arch_signal.h index b72ba7aa50..6085217546 100644 --- a/bsd-user/aarch64/target_arch_signal.h +++ b/bsd-user/aarch64/target_arch_signal.h @@ -1,22 +1,10 @@ /* * ARM AArch64 specific signal definitions for bsd-user * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGNAL_H #define TARGET_ARCH_SIGNAL_H =20 diff --git a/bsd-user/aarch64/target_arch_sigtramp.h b/bsd-user/aarch64/tar= get_arch_sigtramp.h index 8cdd33b621..38a447fc25 100644 --- a/bsd-user/aarch64/target_arch_sigtramp.h +++ b/bsd-user/aarch64/target_arch_sigtramp.h @@ -1,22 +1,10 @@ /* * ARM AArch64 sigcode for bsd-user * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGTRAMP_H #define TARGET_ARCH_SIGTRAMP_H =20 diff --git a/bsd-user/aarch64/target_arch_sysarch.h b/bsd-user/aarch64/targ= et_arch_sysarch.h index b003015daf..5569c996cb 100644 --- a/bsd-user/aarch64/target_arch_sysarch.h +++ b/bsd-user/aarch64/target_arch_sysarch.h @@ -1,22 +1,10 @@ /* * ARM AArch64 sysarch() system call emulation for bsd-user. * - * Copyright (c) 2015 + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SYSARCH_H #define TARGET_ARCH_SYSARCH_H =20 diff --git a/bsd-user/aarch64/target_arch_thread.h b/bsd-user/aarch64/targe= t_arch_thread.h index 4c911e605a..06676980c9 100644 --- a/bsd-user/aarch64/target_arch_thread.h +++ b/bsd-user/aarch64/target_arch_thread.h @@ -1,22 +1,10 @@ /* * ARM AArch64 thread support for bsd-user. * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_THREAD_H #define TARGET_ARCH_THREAD_H =20 diff --git a/bsd-user/aarch64/target_arch_vmparam.h b/bsd-user/aarch64/targ= et_arch_vmparam.h index 0c35491970..ea32f5b56d 100644 --- a/bsd-user/aarch64/target_arch_vmparam.h +++ b/bsd-user/aarch64/target_arch_vmparam.h @@ -1,22 +1,10 @@ /* * ARM AArch64 VM parameters definitions for bsd-user. * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_VMPARAM_H #define TARGET_ARCH_VMPARAM_H =20 diff --git a/bsd-user/aarch64/target_syscall.h b/bsd-user/aarch64/target_sy= scall.h index 08ae913c42..a574edc429 100644 --- a/bsd-user/aarch64/target_syscall.h +++ b/bsd-user/aarch64/target_syscall.h @@ -1,22 +1,10 @@ /* * ARM AArch64 specific CPU for bsd-user * - * Copyright (c) 2015 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef BSD_USER_AARCH64_TARGET_SYSCALL_H #define BSD_USER_AARCH64_TARGET_SYSCALL_H =20 diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c index 9734407543..35cedeba06 100644 --- a/bsd-user/arm/signal.c +++ b/bsd-user/arm/signal.c @@ -1,22 +1,10 @@ /* - * arm signal functions + * arm signal functions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #include "qemu/osdep.h" #include "qemu.h" =20 diff --git a/bsd-user/arm/target_arch.h b/bsd-user/arm/target_arch.h index d80cb85c64..e0add162e8 100644 --- a/bsd-user/arm/target_arch.h +++ b/bsd-user/arm/target_arch.h @@ -1,22 +1,10 @@ /* * ARM 32-bit specific prototypes for bsd-user * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_H #define TARGET_ARCH_H =20 diff --git a/bsd-user/arm/target_arch_cpu.c b/bsd-user/arm/target_arch_cpu.c index fe38ae2210..6a4f5cec0e 100644 --- a/bsd-user/arm/target_arch_cpu.c +++ b/bsd-user/arm/target_arch_cpu.c @@ -1,22 +1,10 @@ /* - * arm cpu related code + * arm cpu related code * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #include "qemu/osdep.h" #include "target_arch.h" =20 diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 9a952ef0ff..faef3ea17a 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -1,22 +1,10 @@ /* - * arm cpu init and loop + * arm cpu init and loop * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_CPU_H #define TARGET_ARCH_CPU_H =20 diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h index b54bf5fbc6..fd13bc87f4 100644 --- a/bsd-user/arm/target_arch_elf.h +++ b/bsd-user/arm/target_arch_elf.h @@ -1,22 +1,10 @@ /* - * arm ELF definitions + * arm ELF definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 diff --git a/bsd-user/arm/target_arch_reg.h b/bsd-user/arm/target_arch_reg.h index 070fa24da1..9d23dda27d 100644 --- a/bsd-user/arm/target_arch_reg.h +++ b/bsd-user/arm/target_arch_reg.h @@ -1,22 +1,10 @@ /* - * FreeBSD arm register structures + * FreeBSD arm register structures * - * Copyright (c) 2015 Stacey Son + * Copyright (c) 2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_REG_H #define TARGET_ARCH_REG_H =20 diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_s= ignal.h index 10f96b8bfc..dfaefa25d1 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -1,22 +1,10 @@ /* - * arm signal definitions + * arm signal definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGNAL_H #define TARGET_ARCH_SIGNAL_H =20 diff --git a/bsd-user/arm/target_arch_sigtramp.h b/bsd-user/arm/target_arch= _sigtramp.h index 06198045ed..8a2d34aafc 100644 --- a/bsd-user/arm/target_arch_sigtramp.h +++ b/bsd-user/arm/target_arch_sigtramp.h @@ -1,22 +1,10 @@ /* - * arm sysarch() system call emulation + * arm sysarch() system call emulation * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGTRAMP_H #define TARGET_ARCH_SIGTRAMP_H =20 diff --git a/bsd-user/arm/target_arch_sysarch.h b/bsd-user/arm/target_arch_= sysarch.h index 5cb7864197..5f7c421e11 100644 --- a/bsd-user/arm/target_arch_sysarch.h +++ b/bsd-user/arm/target_arch_sysarch.h @@ -1,22 +1,10 @@ /* - * arm sysarch() system call emulation + * arm sysarch() system call emulation * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SYSARCH_H #define TARGET_ARCH_SYSARCH_H =20 diff --git a/bsd-user/arm/target_arch_thread.h b/bsd-user/arm/target_arch_t= hread.h index fd257f313d..d22619a845 100644 --- a/bsd-user/arm/target_arch_thread.h +++ b/bsd-user/arm/target_arch_thread.h @@ -1,22 +1,10 @@ /* - * arm thread support + * arm thread support * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_THREAD_H #define TARGET_ARCH_THREAD_H =20 diff --git a/bsd-user/arm/target_arch_vmparam.h b/bsd-user/arm/target_arch_= vmparam.h index 3fb69aff51..c973fcf7d5 100644 --- a/bsd-user/arm/target_arch_vmparam.h +++ b/bsd-user/arm/target_arch_vmparam.h @@ -1,22 +1,10 @@ /* - * arm VM parameters definitions + * arm VM parameters definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_VMPARAM_H #define TARGET_ARCH_VMPARAM_H =20 diff --git a/bsd-user/arm/target_syscall.h b/bsd-user/arm/target_syscall.h index 5804a53541..deab3baebf 100644 --- a/bsd-user/arm/target_syscall.h +++ b/bsd-user/arm/target_syscall.h @@ -1,22 +1,10 @@ /* - * arm cpu system call stubs + * arm cpu system call stubs * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef ARM_TARGET_SYSCALL_H #define ARM_TARGET_SYSCALL_H =20 diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 6fa2c30b4d..dca1518cb1 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -1,22 +1,10 @@ /* - * file related system call shims and definitions + * file related system call shims and definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef BSD_FILE_H #define BSD_FILE_H =20 diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c index 2ab1334b70..8c6c4081f7 100644 --- a/bsd-user/bsd-mem.c +++ b/bsd-user/bsd-mem.c @@ -1,20 +1,9 @@ /* - * memory management system conversion routines + * memory management system conversion routines * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" #include "qemu.h" diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h index a118e57260..8c0b0b6919 100644 --- a/bsd-user/bsd-mem.h +++ b/bsd-user/bsd-mem.h @@ -1,20 +1,9 @@ /* - * memory management system call shims and definitions + * memory management system call shims and definitions * - * Copyright (c) 2013-15 Stacey D. Son + * Copyright (c) 2013-2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ =20 /* diff --git a/bsd-user/bsd-proc.c b/bsd-user/bsd-proc.c index 8dcac9608d..7fb46046c7 100644 --- a/bsd-user/bsd-proc.c +++ b/bsd-user/bsd-proc.c @@ -1,20 +1,9 @@ /* - * BSD process related system call helpers + * BSD process related system call helpers * - * Copyright (c) 2013-14 Stacey D. Son + * Copyright (c) 2013-2014 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" =20 diff --git a/bsd-user/bsd-proc.h b/bsd-user/bsd-proc.h index 8b1c2deea3..b1d4446ff1 100644 --- a/bsd-user/bsd-proc.h +++ b/bsd-user/bsd-proc.h @@ -1,20 +1,9 @@ /* - * process related system call shims and definitions + * process related system call shims and definitions * - * Copyright (c) 2013-2014 Stacey D. Son + * Copyright (c) 2013-2014 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ =20 #ifndef BSD_PROC_H_ diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h index 71145764a4..d9979b2a8b 100644 --- a/bsd-user/freebsd/os-misc.h +++ b/bsd-user/freebsd/os-misc.h @@ -1,22 +1,10 @@ /* - * miscellaneous FreeBSD system call shims + * miscellaneous FreeBSD system call shims * - * Copyright (c) 2013-14 Stacey D. Son + * Copyright (c) 2013-2014 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef OS_MISC_H #define OS_MISC_H =20 diff --git a/bsd-user/freebsd/os-proc.c b/bsd-user/freebsd/os-proc.c index bf993f1b66..0309036178 100644 --- a/bsd-user/freebsd/os-proc.c +++ b/bsd-user/freebsd/os-proc.c @@ -1,20 +1,9 @@ /* - * FreeBSD process related emulation code + * FreeBSD process related emulation code * - * Copyright (c) 2013-15 Stacey D. Son + * Copyright (c) 2013-2014 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" =20 diff --git a/bsd-user/freebsd/os-proc.h b/bsd-user/freebsd/os-proc.h index cc53215138..72ccf23e17 100644 --- a/bsd-user/freebsd/os-proc.h +++ b/bsd-user/freebsd/os-proc.h @@ -1,22 +1,10 @@ /* - * process related system call shims and definitions + * process related system call shims and definitions * - * Copyright (c) 2013-14 Stacey D. Son + * Copyright (c) 2013-2014 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef BSD_USER_FREEBSD_OS_PROC_H #define BSD_USER_FREEBSD_OS_PROC_H =20 diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/freebsd/os-stat.c index f0f9e609c3..10870430fe 100644 --- a/bsd-user/freebsd/os-stat.c +++ b/bsd-user/freebsd/os-stat.c @@ -1,20 +1,9 @@ /* - * FreeBSD stat related conversion routines + * FreeBSD stat related conversion routines * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" =20 diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 3bdc66aa98..ea95aa6344 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -1,22 +1,10 @@ /* - * stat related system call shims and definitions + * stat related system call shims and definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef BSD_USER_FREEBSD_OS_STAT_H #define BSD_USER_FREEBSD_OS_STAT_H =20 diff --git a/bsd-user/freebsd/os-strace.h b/bsd-user/freebsd/os-strace.h index a222f093b5..ad48e99db1 100644 --- a/bsd-user/freebsd/os-strace.h +++ b/bsd-user/freebsd/os-strace.h @@ -1,25 +1,12 @@ /* - * FreeBSD dependent strace print functions + * FreeBSD dependent strace print functions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #include "target_arch_sysarch.h" /* architecture dependent functions */ =20 - static inline void do_os_print_sysarch(const struct syscallname *name, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) diff --git a/bsd-user/freebsd/target_os_elf.h b/bsd-user/freebsd/target_os_= elf.h index 01124979f7..c67e5a0f8e 100644 --- a/bsd-user/freebsd/target_os_elf.h +++ b/bsd-user/freebsd/target_os_elf.h @@ -1,22 +1,10 @@ /* - * freebsd ELF definitions + * FreeBSD ELF definitions * - * Copyright (c) 2013-15 Stacey D. Son + * Copyright (c) 2013-2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_OS_ELF_H #define TARGET_OS_ELF_H =20 diff --git a/bsd-user/freebsd/target_os_siginfo.h b/bsd-user/freebsd/target= _os_siginfo.h index 6c282d8502..e7cf76b9bd 100644 --- a/bsd-user/freebsd/target_os_siginfo.h +++ b/bsd-user/freebsd/target_os_siginfo.h @@ -1,22 +1,10 @@ /* - * FreeBSD siginfo related definitions + * FreeBSD siginfo related definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_OS_SIGINFO_H #define TARGET_OS_SIGINFO_H =20 diff --git a/bsd-user/freebsd/target_os_signal.h b/bsd-user/freebsd/target_= os_signal.h index 5030abb52b..c571b41693 100644 --- a/bsd-user/freebsd/target_os_signal.h +++ b/bsd-user/freebsd/target_os_signal.h @@ -1,3 +1,10 @@ +/* + * FreeBSD signal related symbols + * + * Copyright (c) 2013 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #ifndef TARGET_OS_SIGNAL_H #define TARGET_OS_SIGNAL_H =20 diff --git a/bsd-user/freebsd/target_os_stack.h b/bsd-user/freebsd/target_o= s_stack.h index ac0ef22cd7..262f33d839 100644 --- a/bsd-user/freebsd/target_os_stack.h +++ b/bsd-user/freebsd/target_os_stack.h @@ -1,22 +1,10 @@ /* - * FreeBSD setup_initial_stack() implementation. + * FreeBSD setup_initial_stack() implementation. * - * Copyright (c) 2013-14 Stacey D. Son + * Copyright (c) 2013-2014 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_OS_STACK_H #define TARGET_OS_STACK_H =20 diff --git a/bsd-user/freebsd/target_os_thread.h b/bsd-user/freebsd/target_= os_thread.h index 1b32cebd26..ff88679e40 100644 --- a/bsd-user/freebsd/target_os_thread.h +++ b/bsd-user/freebsd/target_os_thread.h @@ -1,22 +1,10 @@ /* - * FreeBSD thread dependent code and definitions + * FreeBSD thread dependent code and definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_OS_THREAD_H #define TARGET_OS_THREAD_H =20 diff --git a/bsd-user/freebsd/target_os_user.h b/bsd-user/freebsd/target_os= _user.h index 1ca7b5ab17..9703b9a61a 100644 --- a/bsd-user/freebsd/target_os_user.h +++ b/bsd-user/freebsd/target_os_user.h @@ -1,22 +1,10 @@ /* - * sys/user.h definitions + * sys/user.h definitions * - * Copyright (c) 2015 Stacey D. Son (sson at FreeBSD) + * Copyright (c) 2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_OS_USER_H #define TARGET_OS_USER_H =20 diff --git a/bsd-user/freebsd/target_os_vmparam.h b/bsd-user/freebsd/target= _os_vmparam.h index 8457dd3913..9feec5296d 100644 --- a/bsd-user/freebsd/target_os_vmparam.h +++ b/bsd-user/freebsd/target_os_vmparam.h @@ -1,22 +1,10 @@ /* - * FreeBSD VM parameters definitions + * FreeBSD VM parameters definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_OS_VMPARAM_H #define TARGET_OS_VMPARAM_H =20 diff --git a/bsd-user/i386/signal.c b/bsd-user/i386/signal.c index a3131047b8..742032090d 100644 --- a/bsd-user/i386/signal.c +++ b/bsd-user/i386/signal.c @@ -1,20 +1,9 @@ /* - * i386 dependent signal definitions + * i386 dependent signal definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "qemu/osdep.h" diff --git a/bsd-user/i386/target_arch.h b/bsd-user/i386/target_arch.h index 9595e60f09..74c8e7fb47 100644 --- a/bsd-user/i386/target_arch.h +++ b/bsd-user/i386/target_arch.h @@ -1,22 +1,10 @@ /* * Intel x86 specific prototypes for bsd-user * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_H #define TARGET_ARCH_H =20 diff --git a/bsd-user/i386/target_arch_cpu.c b/bsd-user/i386/target_arch_cp= u.c index 2a3af2ddef..fa8ad4b385 100644 --- a/bsd-user/i386/target_arch_cpu.c +++ b/bsd-user/i386/target_arch_cpu.c @@ -1,20 +1,9 @@ /* - * i386 cpu related code + * i386 cpu related code * - * Copyright (c) 2013 Stacey Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "qemu/osdep.h" diff --git a/bsd-user/i386/target_arch_cpu.h b/bsd-user/i386/target_arch_cp= u.h index f147d5b6f8..c6e8bfd8ca 100644 --- a/bsd-user/i386/target_arch_cpu.h +++ b/bsd-user/i386/target_arch_cpu.h @@ -1,21 +1,10 @@ /* - * i386 cpu init and loop + * i386 cpu init and loop * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_CPU_H #define TARGET_ARCH_CPU_H =20 diff --git a/bsd-user/i386/target_arch_elf.h b/bsd-user/i386/target_arch_el= f.h index 4ac27b02e7..99cff66a22 100644 --- a/bsd-user/i386/target_arch_elf.h +++ b/bsd-user/i386/target_arch_elf.h @@ -1,22 +1,10 @@ /* - * i386 ELF definitions + * i386 ELF definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 diff --git a/bsd-user/i386/target_arch_reg.h b/bsd-user/i386/target_arch_re= g.h index 8123109697..cebf2fd5cc 100644 --- a/bsd-user/i386/target_arch_reg.h +++ b/bsd-user/i386/target_arch_reg.h @@ -1,23 +1,10 @@ /* - * FreeBSD i386 register structures + * FreeBSD i386 register structures * - * Copyright (c) 2015 Stacey Son - * All rights reserved. + * Copyright (c) 2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_REG_H #define TARGET_ARCH_REG_H =20 diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch= _signal.h index 2c14153ab6..070ba4357a 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -1,19 +1,9 @@ /* - * i386 dependent signal definitions + * i386 dependent signal definitions * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef TARGET_ARCH_SIGNAL_H #define TARGET_ARCH_SIGNAL_H diff --git a/bsd-user/i386/target_arch_sigtramp.h b/bsd-user/i386/target_ar= ch_sigtramp.h index ef94cc864f..ace243b6f5 100644 --- a/bsd-user/i386/target_arch_sigtramp.h +++ b/bsd-user/i386/target_arch_sigtramp.h @@ -1,22 +1,10 @@ /* * Intel i386 sigcode for bsd-user * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGTRAMP_H #define TARGET_ARCH_SIGTRAMP_H =20 diff --git a/bsd-user/i386/target_arch_sysarch.h b/bsd-user/i386/target_arc= h_sysarch.h index db8fee6380..7b128dfab1 100644 --- a/bsd-user/i386/target_arch_sysarch.h +++ b/bsd-user/i386/target_arch_sysarch.h @@ -1,22 +1,10 @@ /* - * i386 sysarch system call emulation + * i386 sysarch system call emulation * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SYSARCH_H #define TARGET_ARCH_SYSARCH_H =20 diff --git a/bsd-user/i386/target_arch_thread.h b/bsd-user/i386/target_arch= _thread.h index cee2148d94..8ef4f6b648 100644 --- a/bsd-user/i386/target_arch_thread.h +++ b/bsd-user/i386/target_arch_thread.h @@ -1,22 +1,10 @@ /* - * i386 thread support + * i386 thread support * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_THREAD_H #define TARGET_ARCH_THREAD_H =20 diff --git a/bsd-user/i386/target_arch_vmparam.h b/bsd-user/i386/target_arc= h_vmparam.h index 79db420e59..cdf6ab0a49 100644 --- a/bsd-user/i386/target_arch_vmparam.h +++ b/bsd-user/i386/target_arch_vmparam.h @@ -1,22 +1,10 @@ /* - * i386 VM parameters definitions + * i386 VM parameters definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_VMPARAM_H #define TARGET_ARCH_VMPARAM_H =20 diff --git a/bsd-user/i386/target_syscall.h b/bsd-user/i386/target_syscall.h index 940c687a52..a52851f635 100644 --- a/bsd-user/i386/target_syscall.h +++ b/bsd-user/i386/target_syscall.h @@ -1,19 +1,9 @@ /* - * i386 system call definitions + * i386 system call definitions * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef TARGET_SYSCALL_H #define TARGET_SYSCALL_H diff --git a/bsd-user/qemu-bsd.h b/bsd-user/qemu-bsd.h index b98d1d76b2..756425d18e 100644 --- a/bsd-user/qemu-bsd.h +++ b/bsd-user/qemu-bsd.h @@ -1,22 +1,10 @@ /* - * BSD conversion extern declarations + * BSD conversion extern declarations * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef QEMU_BSD_H #define QEMU_BSD_H =20 diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 4dbd90c2f1..90ec3c048d 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -1,22 +1,10 @@ /* - * System call related declarations + * System call related declarations * - * Copyright (c) 2013-15 Stacey D. Son (sson at FreeBSD) + * Copyright (c) 2013-2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef SYSCALL_DEFS_H #define SYSCALL_DEFS_H =20 diff --git a/bsd-user/x86_64/signal.c b/bsd-user/x86_64/signal.c index 46cb865180..823d7217ad 100644 --- a/bsd-user/x86_64/signal.c +++ b/bsd-user/x86_64/signal.c @@ -1,19 +1,9 @@ /* - * x86_64 signal definitions + * x86_64 signal definitions * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "qemu/osdep.h" diff --git a/bsd-user/x86_64/target_arch.h b/bsd-user/x86_64/target_arch.h index 09bd974889..177e6b442a 100644 --- a/bsd-user/x86_64/target_arch.h +++ b/bsd-user/x86_64/target_arch.h @@ -1,22 +1,10 @@ /* * Intel x86_64 specific prototypes for bsd-user * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_H #define TARGET_ARCH_H =20 diff --git a/bsd-user/x86_64/target_arch_cpu.c b/bsd-user/x86_64/target_arc= h_cpu.c index 1d32f18907..aeeb1235c9 100644 --- a/bsd-user/x86_64/target_arch_cpu.c +++ b/bsd-user/x86_64/target_arch_cpu.c @@ -1,20 +1,9 @@ /* - * x86_64 cpu related code + * x86_64 cpu related code * - * Copyright (c) 2013 Stacey Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "qemu/osdep.h" diff --git a/bsd-user/x86_64/target_arch_cpu.h b/bsd-user/x86_64/target_arc= h_cpu.h index 1fa71d87f1..f12a8ab49e 100644 --- a/bsd-user/x86_64/target_arch_cpu.h +++ b/bsd-user/x86_64/target_arch_cpu.h @@ -1,21 +1,10 @@ /* - * x86_64 cpu init and loop + * x86_64 cpu init and loop * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_CPU_H #define TARGET_ARCH_CPU_H =20 diff --git a/bsd-user/x86_64/target_arch_elf.h b/bsd-user/x86_64/target_arc= h_elf.h index e51c2faf08..020533904e 100644 --- a/bsd-user/x86_64/target_arch_elf.h +++ b/bsd-user/x86_64/target_arch_elf.h @@ -1,22 +1,10 @@ /* - * x86_64 ELF definitions + * x86_64 ELF definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 diff --git a/bsd-user/x86_64/target_arch_reg.h b/bsd-user/x86_64/target_arc= h_reg.h index 7a766de918..c0c766ac1a 100644 --- a/bsd-user/x86_64/target_arch_reg.h +++ b/bsd-user/x86_64/target_arch_reg.h @@ -1,23 +1,10 @@ /* - * FreeBSD amd64 register structures + * FreeBSD amd64 register structures * - * Copyright (c) 2015 Stacey Son - * All rights reserved. + * Copyright (c) 2015 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_REG_H #define TARGET_ARCH_REG_H =20 diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_= arch_signal.h index f833ee66ce..2b63048f8b 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -1,21 +1,10 @@ /* - * x86_64 signal definitions + * x86_64 signal definitions * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGNAL_H #define TARGET_ARCH_SIGNAL_H =20 diff --git a/bsd-user/x86_64/target_arch_sigtramp.h b/bsd-user/x86_64/targe= t_arch_sigtramp.h index 01da614098..cab22fb7e8 100644 --- a/bsd-user/x86_64/target_arch_sigtramp.h +++ b/bsd-user/x86_64/target_arch_sigtramp.h @@ -1,29 +1,16 @@ /* * Intel x86_64 sigcode for bsd-user * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SIGTRAMP_H #define TARGET_ARCH_SIGTRAMP_H =20 static inline abi_long setup_sigtramp(abi_ulong offset, unsigned sigf_uc, unsigned sys_sigreturn) { - return 0; } #endif /* TARGET_ARCH_SIGTRAMP_H */ diff --git a/bsd-user/x86_64/target_arch_sysarch.h b/bsd-user/x86_64/target= _arch_sysarch.h index 152cb8bcb8..3a6f74161f 100644 --- a/bsd-user/x86_64/target_arch_sysarch.h +++ b/bsd-user/x86_64/target_arch_sysarch.h @@ -1,21 +1,10 @@ /* - * x86_64 sysarch() syscall emulation + * x86_64 sysarch() syscall emulation * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_SYSARCH_H #define TARGET_ARCH_SYSARCH_H =20 diff --git a/bsd-user/x86_64/target_arch_thread.h b/bsd-user/x86_64/target_= arch_thread.h index 7739bb2154..176c347037 100644 --- a/bsd-user/x86_64/target_arch_thread.h +++ b/bsd-user/x86_64/target_arch_thread.h @@ -1,22 +1,10 @@ /* - * x86_64 thread support + * x86_64 thread support * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_THREAD_H #define TARGET_ARCH_THREAD_H =20 diff --git a/bsd-user/x86_64/target_arch_vmparam.h b/bsd-user/x86_64/target= _arch_vmparam.h index 6797623a6b..8919c5e6e5 100644 --- a/bsd-user/x86_64/target_arch_vmparam.h +++ b/bsd-user/x86_64/target_arch_vmparam.h @@ -1,22 +1,10 @@ /* - * Intel x86_64 VM parameters definitions + * Intel x86_64 VM parameters definitions * - * Copyright (c) 2013 Stacey D. Son + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ - #ifndef TARGET_ARCH_VMPARAM_H #define TARGET_ARCH_VMPARAM_H =20 diff --git a/bsd-user/x86_64/target_syscall.h b/bsd-user/x86_64/target_sysc= all.h index a8e6274b76..5adced9bde 100644 --- a/bsd-user/x86_64/target_syscall.h +++ b/bsd-user/x86_64/target_syscall.h @@ -1,19 +1,9 @@ /* - * x86_64 system call definitions + * x86_64 system call definitions * + * Copyright (c) 2013 Stacey D. Son * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef TARGET_SYSCALL_H #define TARGET_SYSCALL_H --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121076; cv=none; d=zohomail.com; s=zohoarc; b=MJKlRoJIMFBpCpeETkJS6cfWpbFCYB0/gXVghRdsEt0b8mki2/aO9vrdD4HFGdbdvYfHNxGI9MTi/CVc4EzCEYOKRe9vJuVdcjqc5OVrt0Swe3R2NFyoZwNhxPxcdutWzLYGZr5H/AKF9jEeMcI0rYGtGsVqyNb/LLGdhFRqZN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121076; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JqvWmLbjmlBIF1ObHpc6uVNCAxesbDWMi6ixpyg9t3o=; b=OiARr9iuxxtyZq+hyxNk0NPfjGgoAzcsIZQ9fGkW0e6x4/8VMfdKYfNTvI73szKP66Qrk/gz98lqWyux7s9AOVcsMPI8gho8x2s1+tLnTBOKtuFAmwrUbhVU7BBwozn04yt3EfL5hdIl3dD7KkBf0fxJDTlQM8dzxUAEiMPBSnk= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177812107631978.79291053467307; Wed, 6 May 2026 19:31:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoVl-0007Vn-IK; Wed, 06 May 2026 22:30:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVU-0007Sj-5s for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:32 -0400 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVK-0000V4-Ew for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:23 -0400 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-7d4c12ff3d5so316242a34.2 for ; Wed, 06 May 2026 19:30:21 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121021; x=1778725821; darn=nongnu.org; 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=JqvWmLbjmlBIF1ObHpc6uVNCAxesbDWMi6ixpyg9t3o=; b=IW+o/yU+fzRXu4CuACwaY5UFisYmnVTfVoDtqRF4JV2CGSIi8FxGirmRqny/M0+0IW Miz98s/Rjlcct+FL7Cj846aqsvTl1/x6OkGnaDDg//dybnbNkKxKM9GwCv6+RJGcEYxn 400fXZvBOoX1xIXyNFg2jUArn2OPEbI3MCS+XNa+5Y/lNR9w6N36Be4I/zPeCKDZ9x+s TZpMSSagsfIdgqMtw9MljntT3GvEj1R+PitoERyb9kl2vqsbLzu73GR+xTxRuYngeWqA 2frAqa24a9rL9ff1mS+ZLRuF8g3cvW+bZZBHtAySodJxf7+0GehaFeD7wvu5iRvqrihw p+LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121021; x=1778725821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JqvWmLbjmlBIF1ObHpc6uVNCAxesbDWMi6ixpyg9t3o=; b=bp+X0vQhLYu01UI9PXWCx0ZUxJVJSM4G1CZkLIjukzh3KcWYobLojPElS9DqBJc64Z BWkSB6IjWScl82vPObQBwbclONtMhftbMixFiDJWSAE7ufvkHpR0d/ZZmwoWyqKnDt1D fmaUbJc4+J1knJEivRgvtNfQVn4DTdsS/QUFh6ZSNyJW7TSGwpgNaNeEPc9C3E2BawpB oZmoDsQxUnvu3WVFY0VgY1ytKqneoW78PCp709jn+oFeyiufq22JANd1CAlq2R8hrEuO c2NrkhRW4v3ggJowGlkmeDjzv/ndyv4eqKnzzoip3YghTvcb7G2zKb+4iWbTJ3lok6Xs wm6A== X-Gm-Message-State: AOJu0YxzKCztHSh4h2Rnqc/HKUhEmBk5EqFmpsS/XXlbJGT5UrT1S1I3 mPQ6uL2POH1LIN3SmUH+xSIrwZqT7aYhIgy7ErVRn05YOEdPekY3Z1CCmCEznPNfW2a57VfWzIy 445zaMPM= X-Gm-Gg: AeBDietA/STZAOwRBFJ5z9QgzCoTEaYt2h1bn1ZKnME5eILMyRJ8O/AQAD3Tgeeoiq6 FdHbc0vy9RASyGfW0uEFt0HNYKjXlV9nVblmtD8GdReLNWRmnZBDn2gmESfhxB2T41p58WmvSRq vgFEuZ+Qhu2p16w3sLxm2HbrjVo1c7F/1sePA4FsdOtPpcau4raYlv6MRl55uzOzR3RXvKt2x6f TaAzZZGHCmYKL5P7XijHZKyM77K8gxn8kDfD5sBHW8VIAQZ1D6kkqpoYC4a8XlWO9vqRIR3flxc o6SRpl5b3AvNrd8bS4w5htukMGxCqtXtVCVW/pa9dQH4yoHv7TAONciY1gSBTE6fIaWtfxgza85 dFyA8nP8JPuH3ThPgiq9g2UHH2lZVdMLgS2uvwtNACO4gic1+MbfFf763cE3vQnK5l2HXww8pG9 ZMGCNedd75SOBN2H6m9vsagJnWkNVQVCg= X-Received: by 2002:a05:6830:3110:b0:7dc:c7aa:22bd with SMTP id 46e09a7af769-7e1deec720emr3828690a34.6.1778121020959; Wed, 06 May 2026 19:30:20 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PULL 02/25] bsd-user: Add syscall header generator for FreeBSD Date: Wed, 6 May 2026 20:28:04 -0600 Message-ID: <20260507022827.44499-3-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::329; envelope-from=imp@bsdimp.com; helo=mail-ot1-x329.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121077376158500 Generate the syscall numbers from the installed header that has them. Ideally, we'd use FreeBSD's lua infra for this, but that requires that we have those files installed, and they aren't quite the same across supported versions yet, so use this simple, but effective hack. Add to meson build, but unused. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/meson.build | 10 ++++++++-- bsd-user/freebsd/scripts/syscallhdr.sh | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 bsd-user/freebsd/scripts/syscallhdr.sh diff --git a/bsd-user/freebsd/meson.build b/bsd-user/freebsd/meson.build index 8fd6c7cfb8..38f2debf7e 100644 --- a/bsd-user/freebsd/meson.build +++ b/bsd-user/freebsd/meson.build @@ -1,6 +1,12 @@ +bsd_syscall_nr =3D custom_target('bsd-syscall-h', + output: '@BASENAME@_nr.h', + input: ['/usr/include/sys/syscall.h'], + command: [sh, meson.current_source_dir() / 'scripts/syscallhdr.sh', '@= INPUT@', '@OUTPUT@', 'FREEBSD']) + bsd_user_ss.add(files( 'os-stat.c', 'os-proc.c', 'os-sys.c', - 'os-syscall.c', -)) + 'os-syscall.c'), + bsd_syscall_nr +) diff --git a/bsd-user/freebsd/scripts/syscallhdr.sh b/bsd-user/freebsd/scri= pts/syscallhdr.sh new file mode 100644 index 0000000000..fa38500775 --- /dev/null +++ b/bsd-user/freebsd/scripts/syscallhdr.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Copyright (c) 2026 Warner Losh +# SPDX-License-Identifier: GPL-2.0-or-later + +in=3D"$1" +out=3D"$2" +bsd=3D"$3" + +awk -v bsd=3D"$3" '{sub("SYS_", "TARGET_" bsd "_NR_", $0); print;}' < $in = > $out --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121142; cv=none; d=zohomail.com; s=zohoarc; b=QEHSy7Ce6ZgAu9PsNT+oNq0coNylGsF8CiQRAO0rxdnoUwpNhcexMMxSIEcijxvqPUMKtia5m08BLktaAkZOXjj7wkM1/jjyJ3p4fKif+Lr0GFJ5OlMhsbFbnZK0dfG/tDteNfQBilHOiLVUhhPo2oxr5Qiw7YU/eNjJdYvtyoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121142; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vXEfs1TaESiD4JHlvL5ysOYZtnmF0KSz463zLYe2his=; b=BCujEB3z7ddWw+eU1DaAUk3DMOQGNBd3NydwL0vIwFHFTXclq+3RblygUHg9J86hgg+v7ElU9m2oFWHtq7okNeGx9z04JvMsRJfz8sOVDFfvZjdt+dHzW9cPuDTxlwmE4SJtMZ3armQoWjmiksSp1Q+J6dlcskP4m8y5vpBoLbw= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121142214936.697007085191; Wed, 6 May 2026 19:32:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWp-0000x4-23; Wed, 06 May 2026 22:31:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVV-0007T3-Ia for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:34 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVS-0000VD-S0 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:32 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7d4c383f2fcso320404a34.0 for ; Wed, 06 May 2026 19:30:23 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121022; x=1778725822; darn=nongnu.org; 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=vXEfs1TaESiD4JHlvL5ysOYZtnmF0KSz463zLYe2his=; b=CNfSNWwENlujMEJ4CWkkoBqr85aQYpLZ9yJb39XF0RaeS8wOGVYQkR+a30pluy0TP/ 3mcA8pzcoaxl2R7lHqZJ4NeWyVeE3DwQbOJ96wLv6AdXs5HOh94+v/BB9JolW54AsxSk C2DKWRTivB0HRqvimNLGzscdulB4sH14jqCRGI4cNG+1HKSv+I1qOE6L6JQLEIYykpUz 179le083pSLBjTJBmyuRRipjjidyHQuB1IrX6a8dY+p/ZIgVzVs+/LNSImEK8r+PhbV8 rCXl9avhFsvC+cjBSaxDRpvsW3y/YJ1zXtBttS7BoObxCv8BehPKiuiOJbHqheSX6UDE 2ZSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121022; x=1778725822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vXEfs1TaESiD4JHlvL5ysOYZtnmF0KSz463zLYe2his=; b=bkfaIO1VuQQBv4Mb5reQY3kXCFF0KEA6fKN6qXBk2ACPqaiQSpvgIxgFRJ+UsPe8+O 8AsQ1DiyiorzFUd9AvSsfypucLrNpmAnr97TTnpnPVCUIHXnG7GPsxqZ8Ye0gVdDZaRZ vvfZUzXA+kRWRbq0WRbcadNaOYTSTworeBsM+b3CjHAxF1VOdN3cEQicFztYQgSMgN7l gthK0SffKCnSoBmHUm02LiFfm0VOmjjC3HS8xc4o+wsOkVsV3KFLHF5OpOe3LKcjTNys CqBcGqUv8Eg8502ccLDm0NTo5JtngkqhQf29NzarctlRCQViQA4k8dF4aqqaPYycWAee BAhQ== X-Gm-Message-State: AOJu0YwGWmd5eqJEoCWJRv1fujoK/2BnFLdV6MYPLgriXbKwTQoyIYX8 w5wagU0zbSJDHGLwgz7hTP19iHjZwvzyeO5jizZuSoMV5/Z/eFEittT8FA3XOex6lrC3Kwo/rlj UtREmCL4= X-Gm-Gg: AeBDiev1cFWaLu/0MCOjfN1+mBXujQ2PPg6/hxZRt/NLDJ3Mc5obt2lixWrEGml3cZO UPYs/CgwV3UgdWRg7GCok/0LhW5GECtGrJ/IJGM5lsn8gN2tkzENj4jfmFL0O7vt11ssv4ckPBY ThIk1EH3zjnYg9iHjto6BQqkND+SNk3q3qLFkddbcA+RqsoYVeHBWuDTmf1Oj8g9rtL4j24yDxF Z/7qD3cfITHv5KjxldMJyIgTOwYC8nS9yLT7kFad2qm4NNmxmuoJCiQtwAWG+Zmg+IzD54RcNzn jguO1dTg5aInELz6+Ay5Cv4IQJtO5w5vlYj741k+CDg+JUBPxeEMRNiJnFwGlF/w7xHu/LyDd9F BQp4wIIB51AIEcuwMsm38A9nPKnXNCgxXvQb7eihU+n9yRhYWhd2Hthtgu1ldFR70lcZ7uVmxEH K66PN7ohboeWSC9m9QvuDOKfYGT2ds+SM= X-Received: by 2002:a05:6830:6acc:b0:7dd:9b19:a875 with SMTP id 46e09a7af769-7e1deea2a08mr3413490a34.2.1778121022236; Wed, 06 May 2026 19:30:22 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 03/25] bsd-user: Delete sbrk and sstk system calls. Date: Wed, 6 May 2026 20:28:05 -0600 Message-ID: <20260507022827.44499-4-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32b; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32b.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121143588158500 Content-Type: text/plain; charset="utf-8" sbrk and sstk were an experimental system call introduced in 4.2BSD, but with an blank implementation. They remained in subsequent 4BSD releases doing nothing (with 4.3-Reno and later returning not supported). FreeBSD 1.x imported this. They were removed in 2023. Remove them from here because no real, non-contrived program on FreeBSD ever had them. Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-mem.h | 13 ------------- bsd-user/freebsd/os-syscall.c | 8 -------- bsd-user/freebsd/strace.list | 4 ++++ 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h index 8c0b0b6919..9d7b60d3c3 100644 --- a/bsd-user/bsd-mem.h +++ b/bsd-user/bsd-mem.h @@ -428,17 +428,4 @@ static inline abi_long do_bsd_vadvise(void) /* See sys_ovadvise() in vm_unix.c */ return -TARGET_EINVAL; } - -static inline abi_long do_bsd_sbrk(void) -{ - /* see sys_sbrk() in vm_mmap.c */ - return -TARGET_EOPNOTSUPP; -} - -static inline abi_long do_bsd_sstk(void) -{ - /* see sys_sstk() in vm_mmap.c */ - return -TARGET_EOPNOTSUPP; -} - #endif /* BSD_USER_BSD_MEM_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 85e5db19a3..ca819fc530 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -918,14 +918,6 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_bsd_vadvise(); break; =20 - case TARGET_FREEBSD_NR_sbrk: - ret =3D do_bsd_sbrk(); - break; - - case TARGET_FREEBSD_NR_sstk: - ret =3D do_bsd_sstk(); - break; - /* * Misc */ diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list index 275d2dbe27..d7f61f480e 100644 --- a/bsd-user/freebsd/strace.list +++ b/bsd-user/freebsd/strace.list @@ -194,7 +194,9 @@ { TARGET_FREEBSD_NR_rfork, "rfork", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_rmdir, "rmdir", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_rtprio_thread, "rtprio_thread", "%s(%d, %d, %p)", NULL= , NULL }, +#ifdef TARGET_FREEBSD_NR_sbrk { TARGET_FREEBSD_NR_sbrk, "sbrk", NULL, NULL, NULL }, +#endif { TARGET_FREEBSD_NR_sched_get_priority_max, "sched_get_priority_max", NULL= , NULL, NULL }, { TARGET_FREEBSD_NR_sched_get_priority_min, "sched_get_priority_min", NULL= , NULL, NULL }, { TARGET_FREEBSD_NR_sched_yield, "sched_yield", NULL, NULL, NULL }, @@ -234,7 +236,9 @@ { TARGET_FREEBSD_NR_sigsuspend, "sigsuspend", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_socket, "socket", "%s(%d,%d,%d)", NULL, NULL }, { TARGET_FREEBSD_NR_socketpair, "socketpair", NULL, NULL, NULL }, +#ifdef TARGET_FREEBSD_NR_sstk { TARGET_FREEBSD_NR_sstk, "sstk", NULL, NULL, NULL }, +#endif { TARGET_FREEBSD_NR_freebsd11_stat, "freebsd11_stat", "%s(\"%s\",%p)", NUL= L, NULL }, { TARGET_FREEBSD_NR_freebsd11_statfs, "freebsd11_statfs", "%s(\"%s\",%p)",= NULL, NULL }, { TARGET_FREEBSD_NR_symlink, "symlink", "%s(\"%s\",\"%s\")", NULL, NULL }, --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121136; cv=none; d=zohomail.com; s=zohoarc; b=W8m1q5bVPQnPkMClX/N5+RxClFnBJx2TWd5GHlx7VrWwmu4yqpsmFw+lx4wn5DbI2K+pirt/6cc9QAyaR5ETuUrgebGFk+7rdeh9ZYtLtLBtCdUuImVh0BBGXlt6zxmVRHqmpxMOt+pc832gIhke66JMKb/0YOFbSNBNQi0Msdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121136; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/18BWWz2Wbj63GAgi/PilHsC5xbsmE42NiHRmg2gYNo=; b=HjcS7pKYB2T2MXMEspb/Z+y3HZAVEgouitIkwyTyju83vN4M98fWYUCkYK6mLU8cK6tbPOhng1ixyUa0xqm5BNjYqmC5d56jZ41MEz3e+m02vhnt05DjuoXlFcy+1iDuV0Hc2Ce8kXjFtmlmRi3Esv9R0G4mAYk5G9pOxyE4wOs= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121136310131.48444055793334; Wed, 6 May 2026 19:32:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWG-0007lG-1Z; Wed, 06 May 2026 22:31:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVW-0007T7-Bf for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:34 -0400 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVT-0000VL-Lw for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:34 -0400 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7dbe07d3ec3so176260a34.0 for ; Wed, 06 May 2026 19:30:25 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121024; x=1778725824; darn=nongnu.org; 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=/18BWWz2Wbj63GAgi/PilHsC5xbsmE42NiHRmg2gYNo=; b=wE0kottk5XNzUZkYFYdca6/UJK3TkhQrC66Ha0beyHJoUX9kReaBsDrVwgsSnTGP39 g6rEYc7tT4gQlJXgEyJ6ig9JA5vZEZLK/uJvgWFzE7gTJl1LGe9QcccSntXS5DzYK1tL OwVIob5xkirhOGNwGrvZ2/ObzLbwmdCSwHnboxtJENI3EAzLPhcbK/3qaNMQ/E2Gdp53 qTD7WaoHQjMIljbYNuXbdB2LgltSbXpDRi02tJcYdCF6f140V0JJbCPICckYnyDU4tRw dkqqNZfBuMsSmLp8Z/fXAVf3uEwP8tRGhj5OoVJvJUZE2PvhEbsAw5zUjD85ZmeTh4wz bTNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121024; x=1778725824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/18BWWz2Wbj63GAgi/PilHsC5xbsmE42NiHRmg2gYNo=; b=WcIgoy3UxH1/CJnp0GEVmBnaH6jd7MREe4D/ZY2OkwRS1jJgfUDJgwiQiyC1pmaFrF Aq2jHQENsGYlpAZPEIumEc05WRiAcQiD4ZNXTIJo+1zgzONiYRDRPv4vXAwSvaP0mPbf iXYHWmm//i6/VneG6zxZSoI43i1Xm3ukDVBp5+dkkc9/MuRw29kX/NlIM2jxdJPNhJaR ahPgm18wgvUiAt4bJ05xqCywgIGDgdvUsfONgP+k0p0OzouTQ0HKhQEu9gl47ep1k9to gi1s3USHQsCGL3rK7BRTXNsYgNLW4ovL44YbhBAT0ijzfMYFZgltJxhtqW2tNhMXhqaN qbYg== X-Gm-Message-State: AOJu0YzIfyGP1Ba4ZTxDLpnw4ZrNky1sbfuFyJn4KbtIeGw/GPptA3zk OaFmtO20mX9EDi/2iPe5zp+a3/PhH2Mee62RFpVD+gxk/G4ssCi1Tty4RFyciQoU9GvUKiY6ZnT 8qQhELEc= X-Gm-Gg: AeBDietblThljGfxV3XJpSA9MYE3Owt6oCtEIW9x32End9i/qvsOt46LPIem88Pkoat mtCv389l2CNAR6YHHwEnmO+NCv0yq+OIT5sp8AgSIPKdvVD+Mp9WKCKWxM6uq5PwReYxn0z7fIx Ojvf/rRDYGdL+vFsf2nfDYrzPCu/cnKTtRORL6JGVF3xZHLKSQIoTWmjJhvwDD1IqxbuKgFYxmD 7UWaKj/mC4y55e/dv75C3Kf3aEFHVn6MbDcxQzzUWJsNQbqMcdC2fxiMQyphxL6qO83COwbIxAv dzrC7O5ZEYVJd9aJPjTsD45ikL5ksg5tBgLzAcoNDeHdQTfRNMSaVhVO8i0DQ4MXF2cqGxOIEIR 1/oKPoTQZEsA0ywEh7fPhx5RVc8n2aetYpgWreJ4QPCbQU7ZjFV1DvQ0LkKYOZxv8CmQl9+MVrR VxXDEE1y4yYr5RcSt4Di38 X-Received: by 2002:a05:6830:921:b0:7d8:b269:e99b with SMTP id 46e09a7af769-7e1defd48f0mr3145649a34.17.1778121023942; Wed, 06 May 2026 19:30:23 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 04/25] bsd-user: Create os-syscall.h Date: Wed, 6 May 2026 20:28:06 -0600 Message-ID: <20260507022827.44499-5-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::331; envelope-from=imp@bsdimp.com; helo=mail-ot1-x331.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121137566158500 Content-Type: text/plain; charset="utf-8" Create os-syscall.h. The purpose of this file is to define anything that's different among the BSDs, like system call numbers and time_t. While there's a lot more different between the BSDs, this is at least a start at capturing it. Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bsd-user/freebsd/os-syscall.h diff --git a/bsd-user/freebsd/os-syscall.h b/bsd-user/freebsd/os-syscall.h new file mode 100644 index 0000000000..962adfa91a --- /dev/null +++ b/bsd-user/freebsd/os-syscall.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Warner Losh + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * OS-Specific portion of syscall_defs.h + */ + +#include "syscall_nr.h" + +/* + * FreeBSD uses a 64bits time_t except on i386 so we have to add a special= case + * here. + */ +#if defined(TARGET_I386) && !defined(TARGET_X86_64) +typedef int32_t target_time_t; +#else +typedef int64_t target_time_t; +#endif + +typedef abi_long target_suseconds_t; --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121164; cv=none; d=zohomail.com; s=zohoarc; b=avFG5EuoA8cw9f1v1V0vsYuEvfifu6PGm7dtRS/QvQl1EFAjryH2IlTM/3mnoJVCwnuzzfte2nnRxqjLbmQWWjaw9YTub8WoIXLNS6Xe6Y/mUOWeIU9u0Cbt3UGAOdC3HwXCtMjACc4BIDvYB7vaezAJ5j0aXuL1GRsrirYu4YA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121164; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=O7SZ6lAY6ZCBUxSAZMSAdpqw2kicfzkrQL90sVENz6c=; b=c2pDOndsF3XLiEfLCv28Zx3BYxH0FTD45l6LmrFXYS9VZ+uYk5/oPWVpPlDW9kNaKrparoBr6/Q0zDdgQG5C4APTDveB3QxYYSqc5lcAgU/F8VkiTFOm83XOFjAbEwbgwpj7cLTBBpGGwvxKE2ZsKr6UwR/ZKxpUMrjoyuWEaQc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121164060879.8924881620612; Wed, 6 May 2026 19:32:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWa-00005L-Ge; Wed, 06 May 2026 22:31:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0007Ts-TQ for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVT-0000VR-M4 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:37 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-7de7c57b52cso289466a34.3 for ; Wed, 06 May 2026 19:30:26 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121025; x=1778725825; darn=nongnu.org; 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=O7SZ6lAY6ZCBUxSAZMSAdpqw2kicfzkrQL90sVENz6c=; b=hQTnP3n863eJdfggbPl+hJ4xz8p28dSc28aFJlWN4nuFvXmpEBhIiZ925Mx7+1hHUf TH05/4wYLS7cvx4is5eBc7cbG/+hWh8vGRvDPge0UdA/fPwbdtTno7k1e1wXnogXZNID TAdPNdg0zfJPB9sMAYBQdpwaJLw2HhMjU27lukaYwfXPhX9UyiTYK1fctRTiFFnT3DaE PoTaWkUIUqokAzZXyxa3zXMPzQzgNybXLb9m/3cVf80fSuF+8NvXsJLJxZdZGBOZBAIs 3rd0hzezgDNTCuqCvlb9C8WSb32M9bKriAnXXK61Gaw75KgK75pd5TggNDL9xHv2TRcY /DyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121025; x=1778725825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=O7SZ6lAY6ZCBUxSAZMSAdpqw2kicfzkrQL90sVENz6c=; b=pHI9skd7+BFSs9Lu5Km5BAt7dOz+bNGe/MW8XJPt/cARTBz7CeZ5KlFPWIao2e9wvk ibTqBUOr5EFZUh6sXJnoUsdxdfg5sR7FWRYVCkqiAU7osAveu3UgY+bvFJo3vyy3Fh6A wBSjN4tOK71q7rFdqspKgf+NKuQfF8562nb+xRdY1+dviJQ7gGraIgPPKhgIdIPcbc/0 U4hDWxWzZMXhFhD5rdxgHviOnQL56Wc7dzIAdfBeWW5g4ensz1NeCmCqZcXiYHqH61Qz xQOCZH6Zyd2p+EIBATSG6M1NjX39uRv+wwXPgpBipPyQYuAFgVkoV5AkgFOfOiUgzBxQ hDSA== X-Gm-Message-State: AOJu0YxfcTlA+EaaoYAw24v/HfZvNctJNJG9+HdFO+cy8GG1XLmBYG3m kIEwuUTHWi5p8d6dnpo+SL6mHRQVVDpg5Nb+688BhCMOFBgttb7zMoQawSvxWZMOumrR6IMhJRJ KizsZApE= X-Gm-Gg: AeBDievaPHcG0E8m1Ng/3X648PsGtsxoR17Pf4y70ahZciHpeSZlacvQKLfsN4tOUmR FZiEMV3QFNexM2o/p0CdkhZCvukTnuYj1Lh+6VmBkOzOOgREQz+xF29krksCwGfBCL29fZMXy3/ mSRqf29fFRcyFWJw9fHYIDrl6l8KmqthJgGpQ74upzzWiPjxLVic5Ez0dqVdFFzj/Zagn8P6dSC LGqmo+ALPx2569y8ErapA5mgBwniyOXGsqey5b1JxBOOjaUXVd5Zih/PJtN/J1VSKDg9KLg0H8t rhCTxrA8q9A0gosyLF1U/ReXowblE0pqAQyNfZdKlHD3GpMwiws3gs0H0dweIDky8GLh65CzDl7 iu3e3bZSX+VdlIZqmsnEh9dRlIlOemKp99L2ePAus7eyLsvTXII7soPHEoEEbfL2J++iAeivkmP ppI5qU3HTqMwY5Iv2eenzC X-Received: by 2002:a05:6830:83b1:b0:7d7:ccc7:c546 with SMTP id 46e09a7af769-7e1df1bb37emr3720149a34.23.1778121024932; Wed, 06 May 2026 19:30:24 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 05/25] bsd-user: Switch to generated syscall_nr.h Date: Wed, 6 May 2026 20:28:07 -0600 Message-ID: <20260507022827.44499-6-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::330; envelope-from=imp@bsdimp.com; helo=mail-ot1-x330.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121166216154100 Content-Type: text/plain; charset="utf-8" Now that this will build and work, remove the old syscall_nr.h and switch the include over to the generated file in syscall_defs.h. To do this, I had to delete the old, wrong definition of time_t for FreeBSD on amd64 since it stumbled over the fact that TARGET_i386 is defined for both 32-bit and 64-bit builds (the new os-syscall.h had the rigth definition). Rather than modify this file twice to fix it, rolled the fix into using os-syscall.h since it's still easy enough to review. Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/syscall_nr.h | 515 ---------------------------------- bsd-user/syscall_defs.h | 18 +- 2 files changed, 1 insertion(+), 532 deletions(-) delete mode 100644 bsd-user/freebsd/syscall_nr.h diff --git a/bsd-user/freebsd/syscall_nr.h b/bsd-user/freebsd/syscall_nr.h deleted file mode 100644 index 7f73a6d0f1..0000000000 --- a/bsd-user/freebsd/syscall_nr.h +++ /dev/null @@ -1,515 +0,0 @@ -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically @generated. - * $FreeBSD$ - */ - -#define TARGET_FREEBSD_NR_syscall 0 -#define TARGET_FREEBSD_NR_exit 1 -#define TARGET_FREEBSD_NR_fork 2 -#define TARGET_FREEBSD_NR_read 3 -#define TARGET_FREEBSD_NR_write 4 -#define TARGET_FREEBSD_NR_open 5 -#define TARGET_FREEBSD_NR_close 6 -#define TARGET_FREEBSD_NR_wait4 7 - /* 8 is old creat */ -#define TARGET_FREEBSD_NR_link 9 -#define TARGET_FREEBSD_NR_unlink 10 - /* 11 is obsolete execv */ -#define TARGET_FREEBSD_NR_chdir 12 -#define TARGET_FREEBSD_NR_fchdir 13 -#define TARGET_FREEBSD_NR_freebsd11_mknod 14 -#define TARGET_FREEBSD_NR_chmod 15 -#define TARGET_FREEBSD_NR_chown 16 -#define TARGET_FREEBSD_NR_break 17 - /* 18 is freebsd4 getfsstat */ - /* 19 is old lseek */ -#define TARGET_FREEBSD_NR_getpid 20 -#define TARGET_FREEBSD_NR_mount 21 -#define TARGET_FREEBSD_NR_unmount 22 -#define TARGET_FREEBSD_NR_setuid 23 -#define TARGET_FREEBSD_NR_getuid 24 -#define TARGET_FREEBSD_NR_geteuid 25 -#define TARGET_FREEBSD_NR_ptrace 26 -#define TARGET_FREEBSD_NR_recvmsg 27 -#define TARGET_FREEBSD_NR_sendmsg 28 -#define TARGET_FREEBSD_NR_recvfrom 29 -#define TARGET_FREEBSD_NR_accept 30 -#define TARGET_FREEBSD_NR_getpeername 31 -#define TARGET_FREEBSD_NR_getsockname 32 -#define TARGET_FREEBSD_NR_access 33 -#define TARGET_FREEBSD_NR_chflags 34 -#define TARGET_FREEBSD_NR_fchflags 35 -#define TARGET_FREEBSD_NR_sync 36 -#define TARGET_FREEBSD_NR_kill 37 - /* 38 is old stat */ -#define TARGET_FREEBSD_NR_getppid 39 - /* 40 is old lstat */ -#define TARGET_FREEBSD_NR_dup 41 -#define TARGET_FREEBSD_NR_freebsd10_pipe 42 -#define TARGET_FREEBSD_NR_getegid 43 -#define TARGET_FREEBSD_NR_profil 44 -#define TARGET_FREEBSD_NR_ktrace 45 - /* 46 is old sigaction */ -#define TARGET_FREEBSD_NR_getgid 47 - /* 48 is old sigprocmask */ -#define TARGET_FREEBSD_NR_getlogin 49 -#define TARGET_FREEBSD_NR_setlogin 50 -#define TARGET_FREEBSD_NR_acct 51 - /* 52 is old sigpending */ -#define TARGET_FREEBSD_NR_sigaltstack 53 -#define TARGET_FREEBSD_NR_ioctl 54 -#define TARGET_FREEBSD_NR_reboot 55 -#define TARGET_FREEBSD_NR_revoke 56 -#define TARGET_FREEBSD_NR_symlink 57 -#define TARGET_FREEBSD_NR_readlink 58 -#define TARGET_FREEBSD_NR_execve 59 -#define TARGET_FREEBSD_NR_umask 60 -#define TARGET_FREEBSD_NR_chroot 61 - /* 62 is old fstat */ - /* 63 is old getkerninfo */ - /* 64 is old getpagesize */ -#define TARGET_FREEBSD_NR_msync 65 -#define TARGET_FREEBSD_NR_vfork 66 - /* 67 is obsolete vread */ - /* 68 is obsolete vwrite */ -#define TARGET_FREEBSD_NR_sbrk 69 -#define TARGET_FREEBSD_NR_sstk 70 - /* 71 is old mmap */ -#define TARGET_FREEBSD_NR_freebsd11_vadvise 72 -#define TARGET_FREEBSD_NR_munmap 73 -#define TARGET_FREEBSD_NR_mprotect 74 -#define TARGET_FREEBSD_NR_madvise 75 - /* 76 is obsolete vhangup */ - /* 77 is obsolete vlimit */ -#define TARGET_FREEBSD_NR_mincore 78 -#define TARGET_FREEBSD_NR_getgroups 79 -#define TARGET_FREEBSD_NR_setgroups 80 -#define TARGET_FREEBSD_NR_getpgrp 81 -#define TARGET_FREEBSD_NR_setpgid 82 -#define TARGET_FREEBSD_NR_setitimer 83 - /* 84 is old wait */ -#define TARGET_FREEBSD_NR_swapon 85 -#define TARGET_FREEBSD_NR_getitimer 86 - /* 87 is old gethostname */ - /* 88 is old sethostname */ -#define TARGET_FREEBSD_NR_getdtablesize 89 -#define TARGET_FREEBSD_NR_dup2 90 -#define TARGET_FREEBSD_NR_fcntl 92 -#define TARGET_FREEBSD_NR_select 93 -#define TARGET_FREEBSD_NR_fsync 95 -#define TARGET_FREEBSD_NR_setpriority 96 -#define TARGET_FREEBSD_NR_socket 97 -#define TARGET_FREEBSD_NR_connect 98 - /* 99 is old accept */ -#define TARGET_FREEBSD_NR_getpriority 100 - /* 101 is old send */ - /* 102 is old recv */ - /* 103 is old sigreturn */ -#define TARGET_FREEBSD_NR_bind 104 -#define TARGET_FREEBSD_NR_setsockopt 105 -#define TARGET_FREEBSD_NR_listen 106 - /* 107 is obsolete vtimes */ - /* 108 is old sigvec */ - /* 109 is old sigblock */ - /* 110 is old sigsetmask */ - /* 111 is old sigsuspend */ - /* 112 is old sigstack */ - /* 113 is old recvmsg */ - /* 114 is old sendmsg */ - /* 115 is obsolete vtrace */ -#define TARGET_FREEBSD_NR_gettimeofday 116 -#define TARGET_FREEBSD_NR_getrusage 117 -#define TARGET_FREEBSD_NR_getsockopt 118 -#define TARGET_FREEBSD_NR_readv 120 -#define TARGET_FREEBSD_NR_writev 121 -#define TARGET_FREEBSD_NR_settimeofday 122 -#define TARGET_FREEBSD_NR_fchown 123 -#define TARGET_FREEBSD_NR_fchmod 124 - /* 125 is old recvfrom */ -#define TARGET_FREEBSD_NR_setreuid 126 -#define TARGET_FREEBSD_NR_setregid 127 -#define TARGET_FREEBSD_NR_rename 128 - /* 129 is old truncate */ - /* 130 is old ftruncate */ -#define TARGET_FREEBSD_NR_flock 131 -#define TARGET_FREEBSD_NR_mkfifo 132 -#define TARGET_FREEBSD_NR_sendto 133 -#define TARGET_FREEBSD_NR_shutdown 134 -#define TARGET_FREEBSD_NR_socketpair 135 -#define TARGET_FREEBSD_NR_mkdir 136 -#define TARGET_FREEBSD_NR_rmdir 137 -#define TARGET_FREEBSD_NR_utimes 138 - /* 139 is obsolete 4.2 sigreturn */ -#define TARGET_FREEBSD_NR_adjtime 140 - /* 141 is old getpeername */ - /* 142 is old gethostid */ - /* 143 is old sethostid */ - /* 144 is old getrlimit */ - /* 145 is old setrlimit */ - /* 146 is old killpg */ -#define TARGET_FREEBSD_NR_setsid 147 -#define TARGET_FREEBSD_NR_quotactl 148 - /* 149 is old quota */ - /* 150 is old getsockname */ -#define TARGET_FREEBSD_NR_nlm_syscall 154 -#define TARGET_FREEBSD_NR_nfssvc 155 - /* 156 is old getdirentries */ - /* 157 is freebsd4 statfs */ - /* 158 is freebsd4 fstatfs */ -#define TARGET_FREEBSD_NR_lgetfh 160 -#define TARGET_FREEBSD_NR_getfh 161 - /* 162 is freebsd4 getdomainname */ - /* 163 is freebsd4 setdomainname */ - /* 164 is freebsd4 uname */ -#define TARGET_FREEBSD_NR_sysarch 165 -#define TARGET_FREEBSD_NR_rtprio 166 -#define TARGET_FREEBSD_NR_semsys 169 -#define TARGET_FREEBSD_NR_msgsys 170 -#define TARGET_FREEBSD_NR_shmsys 171 - /* 173 is freebsd6 pread */ - /* 174 is freebsd6 pwrite */ -#define TARGET_FREEBSD_NR_setfib 175 -#define TARGET_FREEBSD_NR_ntp_adjtime 176 -#define TARGET_FREEBSD_NR_setgid 181 -#define TARGET_FREEBSD_NR_setegid 182 -#define TARGET_FREEBSD_NR_seteuid 183 - /* 184 is obsolete lfs_bmapv */ - /* 185 is obsolete lfs_markv */ - /* 186 is obsolete lfs_segclean */ - /* 187 is obsolete lfs_segwait */ -#define TARGET_FREEBSD_NR_freebsd11_stat 188 -#define TARGET_FREEBSD_NR_freebsd11_fstat 189 -#define TARGET_FREEBSD_NR_freebsd11_lstat 190 -#define TARGET_FREEBSD_NR_pathconf 191 -#define TARGET_FREEBSD_NR_fpathconf 192 -#define TARGET_FREEBSD_NR_getrlimit 194 -#define TARGET_FREEBSD_NR_setrlimit 195 -#define TARGET_FREEBSD_NR_freebsd11_getdirentries 196 - /* 197 is freebsd6 mmap */ -#define TARGET_FREEBSD_NR___syscall 198 - /* 199 is freebsd6 lseek */ - /* 200 is freebsd6 truncate */ - /* 201 is freebsd6 ftruncate */ -#define TARGET_FREEBSD_NR___sysctl 202 -#define TARGET_FREEBSD_NR_mlock 203 -#define TARGET_FREEBSD_NR_munlock 204 -#define TARGET_FREEBSD_NR_undelete 205 -#define TARGET_FREEBSD_NR_futimes 206 -#define TARGET_FREEBSD_NR_getpgid 207 -#define TARGET_FREEBSD_NR_poll 209 -#define TARGET_FREEBSD_NR_freebsd7___semctl 220 -#define TARGET_FREEBSD_NR_semget 221 -#define TARGET_FREEBSD_NR_semop 222 - /* 223 is obsolete semconfig */ -#define TARGET_FREEBSD_NR_freebsd7_msgctl 224 -#define TARGET_FREEBSD_NR_msgget 225 -#define TARGET_FREEBSD_NR_msgsnd 226 -#define TARGET_FREEBSD_NR_msgrcv 227 -#define TARGET_FREEBSD_NR_shmat 228 -#define TARGET_FREEBSD_NR_freebsd7_shmctl 229 -#define TARGET_FREEBSD_NR_shmdt 230 -#define TARGET_FREEBSD_NR_shmget 231 -#define TARGET_FREEBSD_NR_clock_gettime 232 -#define TARGET_FREEBSD_NR_clock_settime 233 -#define TARGET_FREEBSD_NR_clock_getres 234 -#define TARGET_FREEBSD_NR_ktimer_create 235 -#define TARGET_FREEBSD_NR_ktimer_delete 236 -#define TARGET_FREEBSD_NR_ktimer_settime 237 -#define TARGET_FREEBSD_NR_ktimer_gettime 238 -#define TARGET_FREEBSD_NR_ktimer_getoverrun 239 -#define TARGET_FREEBSD_NR_nanosleep 240 -#define TARGET_FREEBSD_NR_ffclock_getcounter 241 -#define TARGET_FREEBSD_NR_ffclock_setestimate 242 -#define TARGET_FREEBSD_NR_ffclock_getestimate 243 -#define TARGET_FREEBSD_NR_clock_nanosleep 244 -#define TARGET_FREEBSD_NR_clock_getcpuclockid2 247 -#define TARGET_FREEBSD_NR_ntp_gettime 248 -#define TARGET_FREEBSD_NR_minherit 250 -#define TARGET_FREEBSD_NR_rfork 251 - /* 252 is obsolete openbsd_poll */ -#define TARGET_FREEBSD_NR_issetugid 253 -#define TARGET_FREEBSD_NR_lchown 254 -#define TARGET_FREEBSD_NR_aio_read 255 -#define TARGET_FREEBSD_NR_aio_write 256 -#define TARGET_FREEBSD_NR_lio_listio 257 -#define TARGET_FREEBSD_NR_freebsd11_getdents 272 -#define TARGET_FREEBSD_NR_lchmod 274 - /* 275 is obsolete netbsd_lchown */ -#define TARGET_FREEBSD_NR_lutimes 276 - /* 277 is obsolete netbsd_msync */ -#define TARGET_FREEBSD_NR_freebsd11_nstat 278 -#define TARGET_FREEBSD_NR_freebsd11_nfstat 279 -#define TARGET_FREEBSD_NR_freebsd11_nlstat 280 -#define TARGET_FREEBSD_NR_preadv 289 -#define TARGET_FREEBSD_NR_pwritev 290 - /* 297 is freebsd4 fhstatfs */ -#define TARGET_FREEBSD_NR_fhopen 298 -#define TARGET_FREEBSD_NR_freebsd11_fhstat 299 -#define TARGET_FREEBSD_NR_modnext 300 -#define TARGET_FREEBSD_NR_modstat 301 -#define TARGET_FREEBSD_NR_modfnext 302 -#define TARGET_FREEBSD_NR_modfind 303 -#define TARGET_FREEBSD_NR_kldload 304 -#define TARGET_FREEBSD_NR_kldunload 305 -#define TARGET_FREEBSD_NR_kldfind 306 -#define TARGET_FREEBSD_NR_kldnext 307 -#define TARGET_FREEBSD_NR_kldstat 308 -#define TARGET_FREEBSD_NR_kldfirstmod 309 -#define TARGET_FREEBSD_NR_getsid 310 -#define TARGET_FREEBSD_NR_setresuid 311 -#define TARGET_FREEBSD_NR_setresgid 312 - /* 313 is obsolete signanosleep */ -#define TARGET_FREEBSD_NR_aio_return 314 -#define TARGET_FREEBSD_NR_aio_suspend 315 -#define TARGET_FREEBSD_NR_aio_cancel 316 -#define TARGET_FREEBSD_NR_aio_error 317 - /* 318 is freebsd6 aio_read */ - /* 319 is freebsd6 aio_write */ - /* 320 is freebsd6 lio_listio */ -#define TARGET_FREEBSD_NR_yield 321 - /* 322 is obsolete thr_sleep */ - /* 323 is obsolete thr_wakeup */ -#define TARGET_FREEBSD_NR_mlockall 324 -#define TARGET_FREEBSD_NR_munlockall 325 -#define TARGET_FREEBSD_NR___getcwd 326 -#define TARGET_FREEBSD_NR_sched_setparam 327 -#define TARGET_FREEBSD_NR_sched_getparam 328 -#define TARGET_FREEBSD_NR_sched_setscheduler 329 -#define TARGET_FREEBSD_NR_sched_getscheduler 330 -#define TARGET_FREEBSD_NR_sched_yield 331 -#define TARGET_FREEBSD_NR_sched_get_priority_max 332 -#define TARGET_FREEBSD_NR_sched_get_priority_min 333 -#define TARGET_FREEBSD_NR_sched_rr_get_interval 334 -#define TARGET_FREEBSD_NR_utrace 335 - /* 336 is freebsd4 sendfile */ -#define TARGET_FREEBSD_NR_kldsym 337 -#define TARGET_FREEBSD_NR_jail 338 -#define TARGET_FREEBSD_NR_nnpfs_syscall 339 -#define TARGET_FREEBSD_NR_sigprocmask 340 -#define TARGET_FREEBSD_NR_sigsuspend 341 - /* 342 is freebsd4 sigaction */ -#define TARGET_FREEBSD_NR_sigpending 343 - /* 344 is freebsd4 sigreturn */ -#define TARGET_FREEBSD_NR_sigtimedwait 345 -#define TARGET_FREEBSD_NR_sigwaitinfo 346 -#define TARGET_FREEBSD_NR___acl_get_file 347 -#define TARGET_FREEBSD_NR___acl_set_file 348 -#define TARGET_FREEBSD_NR___acl_get_fd 349 -#define TARGET_FREEBSD_NR___acl_set_fd 350 -#define TARGET_FREEBSD_NR___acl_delete_file 351 -#define TARGET_FREEBSD_NR___acl_delete_fd 352 -#define TARGET_FREEBSD_NR___acl_aclcheck_file 353 -#define TARGET_FREEBSD_NR___acl_aclcheck_fd 354 -#define TARGET_FREEBSD_NR_extattrctl 355 -#define TARGET_FREEBSD_NR_extattr_set_file 356 -#define TARGET_FREEBSD_NR_extattr_get_file 357 -#define TARGET_FREEBSD_NR_extattr_delete_file 358 -#define TARGET_FREEBSD_NR_aio_waitcomplete 359 -#define TARGET_FREEBSD_NR_getresuid 360 -#define TARGET_FREEBSD_NR_getresgid 361 -#define TARGET_FREEBSD_NR_kqueue 362 -#define TARGET_FREEBSD_NR_freebsd11_kevent 363 - /* 364 is obsolete __cap_get_proc */ - /* 365 is obsolete __cap_set_proc */ - /* 366 is obsolete __cap_get_fd */ - /* 367 is obsolete __cap_get_file */ - /* 368 is obsolete __cap_set_fd */ - /* 369 is obsolete __cap_set_file */ -#define TARGET_FREEBSD_NR_extattr_set_fd 371 -#define TARGET_FREEBSD_NR_extattr_get_fd 372 -#define TARGET_FREEBSD_NR_extattr_delete_fd 373 -#define TARGET_FREEBSD_NR___setugid 374 - /* 375 is obsolete nfsclnt */ -#define TARGET_FREEBSD_NR_eaccess 376 -#define TARGET_FREEBSD_NR_afs3_syscall 377 -#define TARGET_FREEBSD_NR_nmount 378 - /* 379 is obsolete kse_exit */ - /* 380 is obsolete kse_wakeup */ - /* 381 is obsolete kse_create */ - /* 382 is obsolete kse_thr_interrupt */ - /* 383 is obsolete kse_release */ -#define TARGET_FREEBSD_NR___mac_get_proc 384 -#define TARGET_FREEBSD_NR___mac_set_proc 385 -#define TARGET_FREEBSD_NR___mac_get_fd 386 -#define TARGET_FREEBSD_NR___mac_get_file 387 -#define TARGET_FREEBSD_NR___mac_set_fd 388 -#define TARGET_FREEBSD_NR___mac_set_file 389 -#define TARGET_FREEBSD_NR_kenv 390 -#define TARGET_FREEBSD_NR_lchflags 391 -#define TARGET_FREEBSD_NR_uuidgen 392 -#define TARGET_FREEBSD_NR_sendfile 393 -#define TARGET_FREEBSD_NR_mac_syscall 394 -#define TARGET_FREEBSD_NR_freebsd11_getfsstat 395 -#define TARGET_FREEBSD_NR_freebsd11_statfs 396 -#define TARGET_FREEBSD_NR_freebsd11_fstatfs 397 -#define TARGET_FREEBSD_NR_freebsd11_fhstatfs 398 -#define TARGET_FREEBSD_NR_ksem_close 400 -#define TARGET_FREEBSD_NR_ksem_post 401 -#define TARGET_FREEBSD_NR_ksem_wait 402 -#define TARGET_FREEBSD_NR_ksem_trywait 403 -#define TARGET_FREEBSD_NR_ksem_init 404 -#define TARGET_FREEBSD_NR_ksem_open 405 -#define TARGET_FREEBSD_NR_ksem_unlink 406 -#define TARGET_FREEBSD_NR_ksem_getvalue 407 -#define TARGET_FREEBSD_NR_ksem_destroy 408 -#define TARGET_FREEBSD_NR___mac_get_pid 409 -#define TARGET_FREEBSD_NR___mac_get_link 410 -#define TARGET_FREEBSD_NR___mac_set_link 411 -#define TARGET_FREEBSD_NR_extattr_set_link 412 -#define TARGET_FREEBSD_NR_extattr_get_link 413 -#define TARGET_FREEBSD_NR_extattr_delete_link 414 -#define TARGET_FREEBSD_NR___mac_execve 415 -#define TARGET_FREEBSD_NR_sigaction 416 -#define TARGET_FREEBSD_NR_sigreturn 417 -#define TARGET_FREEBSD_NR_getcontext 421 -#define TARGET_FREEBSD_NR_setcontext 422 -#define TARGET_FREEBSD_NR_swapcontext 423 -#define TARGET_FREEBSD_NR_swapoff 424 -#define TARGET_FREEBSD_NR___acl_get_link 425 -#define TARGET_FREEBSD_NR___acl_set_link 426 -#define TARGET_FREEBSD_NR___acl_delete_link 427 -#define TARGET_FREEBSD_NR___acl_aclcheck_link 428 -#define TARGET_FREEBSD_NR_sigwait 429 -#define TARGET_FREEBSD_NR_thr_create 430 -#define TARGET_FREEBSD_NR_thr_exit 431 -#define TARGET_FREEBSD_NR_thr_self 432 -#define TARGET_FREEBSD_NR_thr_kill 433 -#define TARGET_FREEBSD_NR_jail_attach 436 -#define TARGET_FREEBSD_NR_extattr_list_fd 437 -#define TARGET_FREEBSD_NR_extattr_list_file 438 -#define TARGET_FREEBSD_NR_extattr_list_link 439 - /* 440 is obsolete kse_switchin */ -#define TARGET_FREEBSD_NR_ksem_timedwait 441 -#define TARGET_FREEBSD_NR_thr_suspend 442 -#define TARGET_FREEBSD_NR_thr_wake 443 -#define TARGET_FREEBSD_NR_kldunloadf 444 -#define TARGET_FREEBSD_NR_audit 445 -#define TARGET_FREEBSD_NR_auditon 446 -#define TARGET_FREEBSD_NR_getauid 447 -#define TARGET_FREEBSD_NR_setauid 448 -#define TARGET_FREEBSD_NR_getaudit 449 -#define TARGET_FREEBSD_NR_setaudit 450 -#define TARGET_FREEBSD_NR_getaudit_addr 451 -#define TARGET_FREEBSD_NR_setaudit_addr 452 -#define TARGET_FREEBSD_NR_auditctl 453 -#define TARGET_FREEBSD_NR__umtx_op 454 -#define TARGET_FREEBSD_NR_thr_new 455 -#define TARGET_FREEBSD_NR_sigqueue 456 -#define TARGET_FREEBSD_NR_kmq_open 457 -#define TARGET_FREEBSD_NR_kmq_setattr 458 -#define TARGET_FREEBSD_NR_kmq_timedreceive 459 -#define TARGET_FREEBSD_NR_kmq_timedsend 460 -#define TARGET_FREEBSD_NR_kmq_notify 461 -#define TARGET_FREEBSD_NR_kmq_unlink 462 -#define TARGET_FREEBSD_NR_abort2 463 -#define TARGET_FREEBSD_NR_thr_set_name 464 -#define TARGET_FREEBSD_NR_aio_fsync 465 -#define TARGET_FREEBSD_NR_rtprio_thread 466 -#define TARGET_FREEBSD_NR_sctp_peeloff 471 -#define TARGET_FREEBSD_NR_sctp_generic_sendmsg 472 -#define TARGET_FREEBSD_NR_sctp_generic_sendmsg_iov 473 -#define TARGET_FREEBSD_NR_sctp_generic_recvmsg 474 -#define TARGET_FREEBSD_NR_pread 475 -#define TARGET_FREEBSD_NR_pwrite 476 -#define TARGET_FREEBSD_NR_mmap 477 -#define TARGET_FREEBSD_NR_lseek 478 -#define TARGET_FREEBSD_NR_truncate 479 -#define TARGET_FREEBSD_NR_ftruncate 480 -#define TARGET_FREEBSD_NR_thr_kill2 481 -#define TARGET_FREEBSD_NR_freebsd12_shm_open 482 -#define TARGET_FREEBSD_NR_shm_unlink 483 -#define TARGET_FREEBSD_NR_cpuset 484 -#define TARGET_FREEBSD_NR_cpuset_setid 485 -#define TARGET_FREEBSD_NR_cpuset_getid 486 -#define TARGET_FREEBSD_NR_cpuset_getaffinity 487 -#define TARGET_FREEBSD_NR_cpuset_setaffinity 488 -#define TARGET_FREEBSD_NR_faccessat 489 -#define TARGET_FREEBSD_NR_fchmodat 490 -#define TARGET_FREEBSD_NR_fchownat 491 -#define TARGET_FREEBSD_NR_fexecve 492 -#define TARGET_FREEBSD_NR_freebsd11_fstatat 493 -#define TARGET_FREEBSD_NR_futimesat 494 -#define TARGET_FREEBSD_NR_linkat 495 -#define TARGET_FREEBSD_NR_mkdirat 496 -#define TARGET_FREEBSD_NR_mkfifoat 497 -#define TARGET_FREEBSD_NR_freebsd11_mknodat 498 -#define TARGET_FREEBSD_NR_openat 499 -#define TARGET_FREEBSD_NR_readlinkat 500 -#define TARGET_FREEBSD_NR_renameat 501 -#define TARGET_FREEBSD_NR_symlinkat 502 -#define TARGET_FREEBSD_NR_unlinkat 503 -#define TARGET_FREEBSD_NR_posix_openpt 504 -#define TARGET_FREEBSD_NR_gssd_syscall 505 -#define TARGET_FREEBSD_NR_jail_get 506 -#define TARGET_FREEBSD_NR_jail_set 507 -#define TARGET_FREEBSD_NR_jail_remove 508 -#define TARGET_FREEBSD_NR_freebsd12_closefrom 509 -#define TARGET_FREEBSD_NR___semctl 510 -#define TARGET_FREEBSD_NR_msgctl 511 -#define TARGET_FREEBSD_NR_shmctl 512 -#define TARGET_FREEBSD_NR_lpathconf 513 - /* 514 is obsolete cap_new */ -#define TARGET_FREEBSD_NR___cap_rights_get 515 -#define TARGET_FREEBSD_NR_cap_enter 516 -#define TARGET_FREEBSD_NR_cap_getmode 517 -#define TARGET_FREEBSD_NR_pdfork 518 -#define TARGET_FREEBSD_NR_pdkill 519 -#define TARGET_FREEBSD_NR_pdgetpid 520 -#define TARGET_FREEBSD_NR_pselect 522 -#define TARGET_FREEBSD_NR_getloginclass 523 -#define TARGET_FREEBSD_NR_setloginclass 524 -#define TARGET_FREEBSD_NR_rctl_get_racct 525 -#define TARGET_FREEBSD_NR_rctl_get_rules 526 -#define TARGET_FREEBSD_NR_rctl_get_limits 527 -#define TARGET_FREEBSD_NR_rctl_add_rule 528 -#define TARGET_FREEBSD_NR_rctl_remove_rule 529 -#define TARGET_FREEBSD_NR_posix_fallocate 530 -#define TARGET_FREEBSD_NR_posix_fadvise 531 -#define TARGET_FREEBSD_NR_wait6 532 -#define TARGET_FREEBSD_NR_cap_rights_limit 533 -#define TARGET_FREEBSD_NR_cap_ioctls_limit 534 -#define TARGET_FREEBSD_NR_cap_ioctls_get 535 -#define TARGET_FREEBSD_NR_cap_fcntls_limit 536 -#define TARGET_FREEBSD_NR_cap_fcntls_get 537 -#define TARGET_FREEBSD_NR_bindat 538 -#define TARGET_FREEBSD_NR_connectat 539 -#define TARGET_FREEBSD_NR_chflagsat 540 -#define TARGET_FREEBSD_NR_accept4 541 -#define TARGET_FREEBSD_NR_pipe2 542 -#define TARGET_FREEBSD_NR_aio_mlock 543 -#define TARGET_FREEBSD_NR_procctl 544 -#define TARGET_FREEBSD_NR_ppoll 545 -#define TARGET_FREEBSD_NR_futimens 546 -#define TARGET_FREEBSD_NR_utimensat 547 - /* 548 is obsolete numa_getaffinity */ - /* 549 is obsolete numa_setaffinity */ -#define TARGET_FREEBSD_NR_fdatasync 550 -#define TARGET_FREEBSD_NR_fstat 551 -#define TARGET_FREEBSD_NR_fstatat 552 -#define TARGET_FREEBSD_NR_fhstat 553 -#define TARGET_FREEBSD_NR_getdirentries 554 -#define TARGET_FREEBSD_NR_statfs 555 -#define TARGET_FREEBSD_NR_fstatfs 556 -#define TARGET_FREEBSD_NR_getfsstat 557 -#define TARGET_FREEBSD_NR_fhstatfs 558 -#define TARGET_FREEBSD_NR_mknodat 559 -#define TARGET_FREEBSD_NR_kevent 560 -#define TARGET_FREEBSD_NR_cpuset_getdomain 561 -#define TARGET_FREEBSD_NR_cpuset_setdomain 562 -#define TARGET_FREEBSD_NR_getrandom 563 -#define TARGET_FREEBSD_NR_getfhat 564 -#define TARGET_FREEBSD_NR_fhlink 565 -#define TARGET_FREEBSD_NR_fhlinkat 566 -#define TARGET_FREEBSD_NR_fhreadlink 567 -#define TARGET_FREEBSD_NR_funlinkat 568 -#define TARGET_FREEBSD_NR_copy_file_range 569 -#define TARGET_FREEBSD_NR___sysctlbyname 570 -#define TARGET_FREEBSD_NR_shm_open2 571 -#define TARGET_FREEBSD_NR_shm_rename 572 -#define TARGET_FREEBSD_NR_sigfastblock 573 -#define TARGET_FREEBSD_NR___realpathat 574 -#define TARGET_FREEBSD_NR_close_range 575 -#define TARGET_FREEBSD_NR_rpctls_syscall 576 -#define TARGET_FREEBSD_NR_MAXSYSCALL 577 diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 90ec3c048d..81f567cb33 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -13,29 +13,13 @@ =20 #include "errno_defs.h" =20 -#include "freebsd/syscall_nr.h" +#include "os-syscall.h" =20 /* * machine/_types.h * or x86/_types.h */ =20 -/* - * time_t seems to be very inconsistly defined for the different *BSD's... - * - * FreeBSD uses a 64bits time_t except on i386 - * so we have to add a special case here. - * - * On NetBSD time_t is always defined as an int64_t. On OpenBSD time_t - * is always defined as an int. - * - */ -#if (!defined(TARGET_I386)) -typedef int64_t target_time_t; -#else -typedef int32_t target_time_t; -#endif - struct target_iovec { abi_long iov_base; /* Starting address */ abi_long iov_len; /* Number of bytes */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121078; cv=none; d=zohomail.com; s=zohoarc; b=d3OgW1L6SAk5T2C9QMEUBKOd8CyDTtiYmfvsPOZaTI5dt9cn2f8kuA7333/Vmf02vSCs55VQp/2X16VIilQz5lIs9uH8+yfldIR5i3hod3oV6/Eb5BMJIq9Q+CscNwxd8afankimharxKh+qKzjFFFXnX1Ze0S+NKGW+Oaa5a5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121078; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1AyHrG1z3G32na6dyOgtlv711QpW0FiC+Jb7qPaauGQ=; b=TM3XVqf7NVAaEGw2DqNJzGvAZz6+JoY6z6F0FFLLhvPyW878wV05lBOiW3URjtqfqdjr4X0c4RoXrnG6lGm4Ske8EQOzbK1nU85fpprH+wR+oJZ0NX6rD3v9mHaEYUwIK4iymCSvSD2fRmFS9Tb83E/Xjn8Xvgg9Vm0ZGiDvpjY= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17781210783671.8404421151410588; Wed, 6 May 2026 19:31:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoVz-0007ab-Lq; Wed, 06 May 2026 22:31:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0007Tm-7u for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVT-0000Vc-Ly for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:36 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-7d55b97f358so274104a34.3 for ; Wed, 06 May 2026 19:30:27 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121026; x=1778725826; darn=nongnu.org; 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=1AyHrG1z3G32na6dyOgtlv711QpW0FiC+Jb7qPaauGQ=; b=nEtuF4AavZsGWN3dcq2w+2rQU1Cn890pIRrS0wGg8cd6Vd2KgBLQSsRefwabTua9GG igx9xDZdIOsV3S5j6Oh+j9a/u3T19nNZ1Sw8FwwnoPYSaP942HA2Xiok+KVtIARjoGqg Q9QDJDrs0KKGBMO1m3rebjllLrjnOrgRb+ZARNQiQARVPCH267qfToOs8Kb2hvZ6A6lC 9YEyTvihvA7/p1Mw4ZGRWVQOF0Q0dvwi/cQ6eE7evB387VER7W37qY0GAGKk70iHlX+t omGkhQ1nN2QhvPes0LsBVumB9XZn4XskaK+dWLbp2SFdCc9+2fYF+H+V9YjoHiMfnK23 300Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121026; x=1778725826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1AyHrG1z3G32na6dyOgtlv711QpW0FiC+Jb7qPaauGQ=; b=UejlDhyzFSN4m9sxZD/24xE+O2RZ7U8vK7Z5PMPkhRVVdJzu4JbvYPGUCLxDaY6Mxb Gcf9Rng/xiwvfQqexMEEyOo4Sj/wNllUwxj5OjF2Kph9816iXDwwtO4Cr4EkZt/+0vgM oS+Oz0AXTuZopsEq3NcTtTgSWUknlx8icE56MABu4pcNnieJfdCAV7zJMarIROqXUbNe Z7h+7hIrJ+q4uhA7GSgBkFOPOTTD+cHzB0lZG+sCQw1TWLA4aDfaFq6iuA25RLa/C3iU aEtH9FYn9LIDXMn98+oHYQmi1GmAuuWxJuRsSoDqUCzl+/28HKj8FjICOecHDAeB1n4v iTRw== X-Gm-Message-State: AOJu0Yxxtrz6wGcCIrNOP6jgGojdXsTDmv5pm/PdDFM1XSr5WbYswhBZ 3Wd2ghPpFkyghfPQ8rdZJP0YJuZ9rKVjVSzf2UOhi7fUWfJcIawjuOVhB39iTLuKEd5AtbAos2G W2bNnTkQ= X-Gm-Gg: AeBDietTYVGzpMUQhcnPwujTHP91Y+KzZm/txOZcX38ybz6KovNpEtEu34VOkt3Oi5y D0zit8WidIVvNzSE//sjVfDIG8jT1RHX+AmExFe/XrCiSWGeKXOE0LtczhQwxSQvoItb/JC3wj9 e7owbWXIwElAL4hLDiR/EGIR+Xu7iPWJ2t+ylM7dualZc9Lv2Tyzh35Z/oFaPHxnv3uY2MZV9CP gunFqqUqqFCHncWw47C7NmYfiIndlLNw4EV8wH4mFOtVPm3M6tR6VBYfgo7ttkygtfwFYAr9lCg 6KZ5sGn/lhiGNGm+Xl36QHlpZwFl8gKk6TN3btFTNKLR1lwT9CEnzgygZQfLa6QqZpWdx7FX4ls 5a6CIIfhjpYmXpB+DRS1AVmwGKtmTed23EKJmuG7/KrjpqWAJ7C6Su7B6ZX5+jrUnraqaUWiUC7 QCwAqVMlkifXboZrhx/4Sp X-Received: by 2002:a05:6830:44aa:b0:7db:a184:2b35 with SMTP id 46e09a7af769-7e1def0c8f1mr3541477a34.8.1778121026182; Wed, 06 May 2026 19:30:26 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 06/25] bsd-user: Copy linux-user/thunk.c to bsd-user Date: Wed, 6 May 2026 20:28:08 -0600 Message-ID: <20260507022827.44499-7-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::336; envelope-from=imp@bsdimp.com; helo=mail-ot1-x336.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121079363158500 Content-Type: text/plain; charset="utf-8" bsd-user's blitz branch has used this file verbatim for a while. Copy it verbatim, but update to the new QEMU standards. Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/meson.build | 1 + bsd-user/thunk.c | 470 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 471 insertions(+) create mode 100644 bsd-user/thunk.c diff --git a/bsd-user/meson.build b/bsd-user/meson.build index 00428fc2f8..9cc5c6c459 100644 --- a/bsd-user/meson.build +++ b/bsd-user/meson.build @@ -17,6 +17,7 @@ bsd_user_ss.add(files( 'plugin-api.c', 'signal.c', 'strace.c', + 'thunk.c', 'uaccess.c', )) =20 diff --git a/bsd-user/thunk.c b/bsd-user/thunk.c new file mode 100644 index 0000000000..3c89ae3ab8 --- /dev/null +++ b/bsd-user/thunk.c @@ -0,0 +1,470 @@ +/* + * Generic thunking code to convert data between host and target CPU + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "qemu/osdep.h" +#include "qemu/log.h" + +#include "qemu.h" +#include "user/thunk.h" + +//#define DEBUG + +static unsigned int max_struct_entries; +StructEntry *struct_entries; + +static const argtype *thunk_type_next_ptr(const argtype *type_ptr); + +static inline const argtype *thunk_type_next(const argtype *type_ptr) +{ + int type; + + type =3D *type_ptr++; + switch(type) { + case TYPE_CHAR: + case TYPE_SHORT: + case TYPE_INT: + case TYPE_LONGLONG: + case TYPE_ULONGLONG: + case TYPE_LONG: + case TYPE_ULONG: + case TYPE_PTRVOID: + case TYPE_OLDDEVT: + return type_ptr; + case TYPE_PTR: + return thunk_type_next_ptr(type_ptr); + case TYPE_ARRAY: + return thunk_type_next_ptr(type_ptr + 1); + case TYPE_STRUCT: + return type_ptr + 1; + default: + return NULL; + } +} + +static const argtype *thunk_type_next_ptr(const argtype *type_ptr) +{ + return thunk_type_next(type_ptr); +} + +void thunk_register_struct(int id, const char *name, const argtype *types) +{ + const argtype *type_ptr; + StructEntry *se; + int nb_fields, offset, max_align, align, size, i, j; + + assert(id < max_struct_entries); + + /* first we count the number of fields */ + type_ptr =3D types; + nb_fields =3D 0; + while (*type_ptr !=3D TYPE_NULL) { + type_ptr =3D thunk_type_next(type_ptr); + nb_fields++; + } + assert(nb_fields > 0); + se =3D struct_entries + id; + se->field_types =3D types; + se->nb_fields =3D nb_fields; + se->name =3D name; +#ifdef DEBUG + printf("struct %s: id=3D%d nb_fields=3D%d\n", + se->name, id, se->nb_fields); +#endif + /* now we can alloc the data */ + + for (i =3D 0; i < ARRAY_SIZE(se->field_offsets); i++) { + offset =3D 0; + max_align =3D 1; + se->field_offsets[i] =3D g_new(int, nb_fields); + type_ptr =3D se->field_types; + for(j =3D 0;j < nb_fields; j++) { + size =3D thunk_type_size(type_ptr, i); + align =3D thunk_type_align(type_ptr, i); + offset =3D (offset + align - 1) & ~(align - 1); + se->field_offsets[i][j] =3D offset; + offset +=3D size; + if (align > max_align) + max_align =3D align; + type_ptr =3D thunk_type_next(type_ptr); + } + offset =3D (offset + max_align - 1) & ~(max_align - 1); + se->size[i] =3D offset; + se->align[i] =3D max_align; +#ifdef DEBUG + printf("%s: size=3D%d align=3D%d\n", + i =3D=3D THUNK_HOST ? "host" : "target", offset, max_align); +#endif + } +} + +void thunk_register_struct_direct(int id, const char *name, + const StructEntry *se1) +{ + StructEntry *se; + + assert(id < max_struct_entries); + se =3D struct_entries + id; + *se =3D *se1; + se->name =3D name; +} + + +/* now we can define the main conversion functions */ +const argtype *thunk_convert(void *dst, const void *src, + const argtype *type_ptr, int to_host) +{ + int type; + + type =3D *type_ptr++; + switch(type) { + case TYPE_CHAR: + *(uint8_t *)dst =3D *(uint8_t *)src; + break; + case TYPE_SHORT: + *(uint16_t *)dst =3D tswap16(*(uint16_t *)src); + break; + case TYPE_INT: + *(uint32_t *)dst =3D tswap32(*(uint32_t *)src); + break; + case TYPE_LONGLONG: + case TYPE_ULONGLONG: + *(uint64_t *)dst =3D tswap64(*(uint64_t *)src); + break; +#if HOST_LONG_BITS =3D=3D 32 && TARGET_ABI_BITS =3D=3D 32 + case TYPE_LONG: + case TYPE_ULONG: + case TYPE_PTRVOID: + *(uint32_t *)dst =3D tswap32(*(uint32_t *)src); + break; +#elif HOST_LONG_BITS =3D=3D 64 && TARGET_ABI_BITS =3D=3D 32 + case TYPE_LONG: + case TYPE_ULONG: + case TYPE_PTRVOID: + if (to_host) { + if (type =3D=3D TYPE_LONG) { + /* sign extension */ + *(uint64_t *)dst =3D (int32_t)tswap32(*(uint32_t *)src); + } else { + *(uint64_t *)dst =3D tswap32(*(uint32_t *)src); + } + } else { + *(uint32_t *)dst =3D tswap32(*(uint64_t *)src & 0xffffffff); + } + break; +#elif HOST_LONG_BITS =3D=3D 64 && TARGET_ABI_BITS =3D=3D 64 + case TYPE_LONG: + case TYPE_ULONG: + case TYPE_PTRVOID: + *(uint64_t *)dst =3D tswap64(*(uint64_t *)src); + break; +#elif HOST_LONG_BITS =3D=3D 32 && TARGET_ABI_BITS =3D=3D 64 + case TYPE_LONG: + case TYPE_ULONG: + case TYPE_PTRVOID: + if (to_host) { + *(uint32_t *)dst =3D tswap64(*(uint64_t *)src); + } else { + if (type =3D=3D TYPE_LONG) { + /* sign extension */ + *(uint64_t *)dst =3D tswap64(*(int32_t *)src); + } else { + *(uint64_t *)dst =3D tswap64(*(uint32_t *)src); + } + } + break; +#else +#warning unsupported conversion +#endif + case TYPE_OLDDEVT: + { + uint64_t val =3D 0; + switch (thunk_type_size(type_ptr - 1, !to_host)) { + case 2: + val =3D *(uint16_t *)src; + break; + case 4: + val =3D *(uint32_t *)src; + break; + case 8: + val =3D *(uint64_t *)src; + break; + } + switch (thunk_type_size(type_ptr - 1, to_host)) { + case 2: + *(uint16_t *)dst =3D tswap16(val); + break; + case 4: + *(uint32_t *)dst =3D tswap32(val); + break; + case 8: + *(uint64_t *)dst =3D tswap64(val); + break; + } + break; + } + case TYPE_ARRAY: + { + int array_length, i, dst_size, src_size; + const uint8_t *s; + uint8_t *d; + + array_length =3D *type_ptr++; + dst_size =3D thunk_type_size(type_ptr, to_host); + src_size =3D thunk_type_size(type_ptr, 1 - to_host); + d =3D dst; + s =3D src; + for(i =3D 0;i < array_length; i++) { + thunk_convert(d, s, type_ptr, to_host); + d +=3D dst_size; + s +=3D src_size; + } + type_ptr =3D thunk_type_next(type_ptr); + } + break; + case TYPE_STRUCT: + { + int i; + const StructEntry *se; + const uint8_t *s; + uint8_t *d; + const argtype *field_types; + const int *dst_offsets, *src_offsets; + + assert(*type_ptr < max_struct_entries); + se =3D struct_entries + *type_ptr++; + if (se->convert[0] !=3D NULL) { + /* specific conversion is needed */ + (*se->convert[to_host])(dst, src); + } else { + /* standard struct conversion */ + field_types =3D se->field_types; + dst_offsets =3D se->field_offsets[to_host]; + src_offsets =3D se->field_offsets[1 - to_host]; + d =3D dst; + s =3D src; + for(i =3D 0;i < se->nb_fields; i++) { + field_types =3D thunk_convert(d + dst_offsets[i], + s + src_offsets[i], + field_types, to_host); + } + } + } + break; + default: + fprintf(stderr, "Invalid type 0x%x\n", type); + break; + } + return type_ptr; +} + +const argtype *thunk_print(void *arg, const argtype *type_ptr) +{ + int type; + + type =3D *type_ptr++; + + switch (type) { + case TYPE_CHAR: + qemu_log("%c", *(uint8_t *)arg); + break; + case TYPE_SHORT: + qemu_log("%" PRId16, tswap16(*(uint16_t *)arg)); + break; + case TYPE_INT: + qemu_log("%" PRId32, tswap32(*(uint32_t *)arg)); + break; + case TYPE_LONGLONG: + qemu_log("%" PRId64, tswap64(*(uint64_t *)arg)); + break; + case TYPE_ULONGLONG: + qemu_log("%" PRIu64, tswap64(*(uint64_t *)arg)); + break; +#if HOST_LONG_BITS =3D=3D 32 && TARGET_ABI_BITS =3D=3D 32 + case TYPE_PTRVOID: + qemu_log("0x%" PRIx32, tswap32(*(uint32_t *)arg)); + break; + case TYPE_LONG: + qemu_log("%" PRId32, tswap32(*(uint32_t *)arg)); + break; + case TYPE_ULONG: + qemu_log("%" PRIu32, tswap32(*(uint32_t *)arg)); + break; +#elif HOST_LONG_BITS =3D=3D 64 && TARGET_ABI_BITS =3D=3D 32 + case TYPE_PTRVOID: + qemu_log("0x%" PRIx32, tswap32(*(uint64_t *)arg & 0xffffffff)); + break; + case TYPE_LONG: + qemu_log("%" PRId32, tswap32(*(uint64_t *)arg & 0xffffffff)); + break; + case TYPE_ULONG: + qemu_log("%" PRIu32, tswap32(*(uint64_t *)arg & 0xffffffff)); + break; +#elif HOST_LONG_BITS =3D=3D 64 && TARGET_ABI_BITS =3D=3D 64 + case TYPE_PTRVOID: + qemu_log("0x%" PRIx64, tswap64(*(uint64_t *)arg)); + break; + case TYPE_LONG: + qemu_log("%" PRId64, tswap64(*(uint64_t *)arg)); + break; + case TYPE_ULONG: + qemu_log("%" PRIu64, tswap64(*(uint64_t *)arg)); + break; +#else + case TYPE_PTRVOID: + qemu_log("0x%" PRIx64, tswap64(*(uint64_t *)arg)); + break; + case TYPE_LONG: + qemu_log("%" PRId64, tswap64(*(uint64_t *)arg)); + break; + case TYPE_ULONG: + qemu_log("%" PRIu64, tswap64(*(uint64_t *)arg)); + break; +#endif + case TYPE_OLDDEVT: + { + uint64_t val =3D 0; + switch (thunk_type_size(type_ptr - 1, 1)) { + case 2: + val =3D *(uint16_t *)arg; + break; + case 4: + val =3D *(uint32_t *)arg; + break; + case 8: + val =3D *(uint64_t *)arg; + break; + } + switch (thunk_type_size(type_ptr - 1, 0)) { + case 2: + qemu_log("%" PRIu16, tswap16(val)); + break; + case 4: + qemu_log("%" PRIu32, tswap32(val)); + break; + case 8: + qemu_log("%" PRIu64, tswap64(val)); + break; + } + } + break; + case TYPE_ARRAY: + { + int i, array_length, arg_size; + uint8_t *a; + int is_string =3D 0; + + array_length =3D *type_ptr++; + arg_size =3D thunk_type_size(type_ptr, 0); + a =3D arg; + + if (*type_ptr =3D=3D TYPE_CHAR) { + qemu_log("\""); + is_string =3D 1; + } else { + qemu_log("["); + } + + for (i =3D 0; i < array_length; i++) { + if (i > 0 && !is_string) { + qemu_log(","); + } + thunk_print(a, type_ptr); + a +=3D arg_size; + } + + if (is_string) { + qemu_log("\""); + } else { + qemu_log("]"); + } + + type_ptr =3D thunk_type_next(type_ptr); + } + break; + case TYPE_STRUCT: + { + int i; + const StructEntry *se; + uint8_t *a; + const argtype *field_types; + const int *arg_offsets; + + se =3D struct_entries + *type_ptr++; + + if (se->print !=3D NULL) { + se->print(arg); + } else { + a =3D arg; + + field_types =3D se->field_types; + arg_offsets =3D se->field_offsets[0]; + + qemu_log("{"); + for (i =3D 0; i < se->nb_fields; i++) { + if (i > 0) { + qemu_log(","); + } + field_types =3D thunk_print(a + arg_offsets[i], field_= types); + } + qemu_log("}"); + } + } + break; + default: + g_assert_not_reached(); + } + return type_ptr; +} + +/* from em86 */ + +/* Utility function: Table-driven functions to translate bitmasks + * between host and target formats + */ +unsigned int target_to_host_bitmask_len(unsigned int target_mask, + const bitmask_transtbl *tbl, + size_t len) +{ + unsigned int host_mask =3D 0; + + for (size_t i =3D 0; i < len; ++i) { + if ((target_mask & tbl[i].target_mask) =3D=3D tbl[i].target_bits) { + host_mask |=3D tbl[i].host_bits; + } + } + return host_mask; +} + +unsigned int host_to_target_bitmask_len(unsigned int host_mask, + const bitmask_transtbl *tbl, + size_t len) +{ + unsigned int target_mask =3D 0; + + for (size_t i =3D 0; i < len; ++i) { + if ((host_mask & tbl[i].host_mask) =3D=3D tbl[i].host_bits) { + target_mask |=3D tbl[i].target_bits; + } + } + return target_mask; +} + +int thunk_type_size_array(const argtype *type_ptr, int is_host) +{ + return thunk_type_size(type_ptr, is_host); +} + +int thunk_type_align_array(const argtype *type_ptr, int is_host) +{ + return thunk_type_align(type_ptr, is_host); +} + +void thunk_init(unsigned int max_structs) +{ + max_struct_entries =3D max_structs; + struct_entries =3D g_new0(StructEntry, max_structs); +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121081; cv=none; d=zohomail.com; s=zohoarc; b=Tkhk2FPOFuONKEU9U+YUX8496XBdPQWYTyYx9FzJpItFfVpEpXIwqTi4NTY9NLSljdN/rqJeewvKxNQXa9SYYQ6pQ4L7lK/0KE+GJjhMuWLI3mQviGaAxX/CgCy+xvHC1q/VQiNgU13N22wRONVOALvE9kHEKbbRUFHIjBfKYQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121081; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Vib50DBJzehDTQwGhRLm3cUJrd276SOY6qdTRikBukU=; b=LRMIUd0ZTM76fh6Umas06jBdEAfr4cSu5CjlY/0FDxCthym935issX4JcnNARSHHWMGiKVcB3cMH+BJOZuiOjHtcxZ3WVVqCa8gbGC0B9G57MTkuD5aBnKFJqqysyYk9u99JGlDZI9IVfD5yIrR7Sj/UXoU0QAch6vKBmNibJzI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121081871917.8837721552316; Wed, 6 May 2026 19:31:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoW9-0007e4-VL; Wed, 06 May 2026 22:31:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVX-0007Ta-AA for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:38 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVT-0000Vg-Lm for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:35 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-7de4e6c5a30so411973a34.0 for ; Wed, 06 May 2026 19:30:28 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121027; x=1778725827; darn=nongnu.org; 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=Vib50DBJzehDTQwGhRLm3cUJrd276SOY6qdTRikBukU=; b=ejMRiwGMGWF4fiK1jmXBHhs2Ska/P68zWGd0kgNasRSQdxisMb02NtDpPfxXQ/0FQH 6sSKgIYGuzNJBKl4or005bQIGTZPFv8bdb+HR5/KH5SjrGnlwfTgOTu+fsY0XvBxFwLm Z1N7ePeyPh9daXtRVa37I9DSjYJOUq9Ar4yHzoD/FcUgZr1DI/rm2MovJipSw0EFoPFe Zn/ExUzlHq7vSCEFMzrMRWKm2529eAFjnj+7GFRVeFSZe4iEuFKK/JznXq8AeRvl4+cq iEiE7o2TbOgUpxE7HyswFJs2RqqIC+3+lJheyz3N09Rj4HteJUEfyCd1zPXeqVfINgXe GiCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121027; x=1778725827; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Vib50DBJzehDTQwGhRLm3cUJrd276SOY6qdTRikBukU=; b=k78102zyLfXokNV5gmBCHfmUiEPs/QWyaTRpUvIy5rpVK8gZM1qNs78LwJqoRHAWXi WPPO36RXJwFlRIK0xqnC4ecB2HAXSlHfMg08033pgHdQxEPzGGU1fthIGvqqzLwaCHQI XVrovqk4uklPjme1tXRrs5x9sow+KGFV/tam4cGN5sX7mRxrm0Np/AX94k0/fy0uKYdt jSEWXGH8zPBI/+yztCVXwzZ/sm7pONHrkIjd09iBrmBZ5sHX72O58cm1PAqEM8qtXj3/ 8z00khCSXKXzP9aoau9ETAMes469zwu32wciTlkYT/roJT5FpZoecoT3tzRZCh3VmR8A 3YGw== X-Gm-Message-State: AOJu0Yy7xOuxKljU0579B4pfvJujWxJrRM6U+oCMAJ8MUzrVzCFh9tNx z46fmBkyZlR0co5qLQHQzNtgEmscUreMpK+xrxBwmkdZCNOJrYZG1h6LgKBU6AV/CwIUWK+3ys0 dnUGsZdw= X-Gm-Gg: AeBDiesbrIJo4B7h6yLMePSJJ+6e7Eq5qr6+ddvPLCvwN3Kt+Gajnb+0KsVEGSdaE+I d0iX4R2NmydD8h7iQtF6kqi+oG1K7Q0vFzYqVHtQs2Ek+OKR8a9AvqozwPFEfLyV34F7kmqLn1B vtO2kRD9TUC4wyTVStYoKqvioVbwEMt17zWI2OK6kRZSiqqsdE5u0AygP43LYgQIpONjcKkBR5T +gPUP8uk9at/FS7Wr421Rop7SLm9SHfzul5IIODSxckXwlyJAkEkNsO8gWHBo1vihK7Eh8L5On4 oXnCYWIllUAxXPNKAsa7q0NoPzkVzk1XFH4422WUFzzeLChHpY+8VbbPbXq2qBURJhu+kZjbHh5 ONYM4WVHWlvKMfS2wVQiMSiwp16UhuHKX6ZNFyyfHsT2HDsc34L0tB+FmA7D3XSOrxKHyXuOU0w FDqHXOWyAteRnQjrbkTkhg X-Received: by 2002:a05:6830:600c:b0:7d9:b58e:55ed with SMTP id 46e09a7af769-7e1df137a49mr3886109a34.25.1778121027356; Wed, 06 May 2026 19:30:27 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 07/25] bsd-user: ioctl: add common definitions Date: Wed, 6 May 2026 20:28:09 -0600 Message-ID: <20260507022827.44499-8-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32d; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32d.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121083389158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Modeled on sys/ioccom.h. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-ioccom.h | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-ioccom.h diff --git a/bsd-user/freebsd/os-ioctl-ioccom.h b/bsd-user/freebsd/os-ioctl= -ioccom.h new file mode 100644 index 0000000000..3bb9ef2710 --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-ioccom.h @@ -0,0 +1,43 @@ +/* + * FreeBSD ioccom definitions for ioctl(2) emulation + * + * Copyright (c) 2013 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef BSD_USER_FREEBSD_OS_IOCTL_IOCCOM_H +#define BSD_USER_FREEBSD_OS_IOCTL_IOCCOM_H + +/* + * Ioctl's have the command encoded in the lower word, and the size of + * any in or out parameters in the upper word. The high 3 bits of the + * upper word are used to encode the in/out status of the parameter. + */ +/* number of bits for ioctl size */ +#define TARGET_IOCPARM_SHIFT 13 + +/* parameter length mask */ +#define TARGET_IOCPARM_MASK ((1 << TARGET_IOCPARM_SHIFT) - 1) + +#define TARGET_IOCPARM_LEN(x) (((x) >> 16) & TARGET_IOCPARM_MASK) +#define TARGET_IOCBASECMD(x) ((x) & ~(TARGET_IOCPARM_MASK << 16)) +#define TARGET_IOCGROUP(x) (((x) >> 8) & 0xff) + +#define TARGET_IOCPARM_MAX (1 << TARGET_IOCPARM_SHIFT) /* max size of ioc= tl */ +#define TARGET_IOC_VOID 0x20000000 /* no parameters */ +#define TARGET_IOC_OUT 0x40000000 /* copy out parameters */ +#define TARGET_IOC_IN 0x80000000 /* copy in parameters */ +#define TARGET_IOC_INOUT (TARGET_IOC_IN | TARGET_IOC_OUT) +#define TARGET_IOC_DIRMASK (TARGET_IOC_VOID | TARGET_IOC_OUT | TARGET_IOC= _IN) + +#define TARGET_IOC(inout, group, num, len) ((abi_ulong) \ + ((inout) | (((len) & TARGET_IOCPARM_MASK) << 16) | ((group) << 8) \ + | (num))) +#define TARGET_IO(g, n) TARGET_IOC(TARGET_IOC_VOID, (g), (n), 0) +#define TARGET_IOWINT(g, n) TARGET_IOC(TARGET_IOC_VOID, (g), (n), siz= eof(int)) +#define TARGET_IOR(g, n, t) TARGET_IOC(TARGET_IOC_OUT, (g), (n), sizeof(= t)) +#define TARGET_IOW(g, n, t) TARGET_IOC(TARGET_IOC_IN, (g), (n), sizeof(= t)) +/* this should be _IORW, but stdio got there first */ +#define TARGET_IOWR(g, n, t) TARGET_IOC(TARGET_IOC_INOUT, (g), (n), siz= eof(t)) + +#endif /* BSD_USER_FREEBSD_OS_IOCTL_IOCCOM_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121113; cv=none; d=zohomail.com; s=zohoarc; b=i8YlXmsgV+CMbkbAJaSP92ZLJqStbO7t7EPoUQ741E+S2F9mmZkESp/8S6Npm62vEvn8QFm43ASSJzKtouUwiZ/Xl4Koh+Ex/9un++2iV+7wsLUtEHJXTd3bRmk8MAWTeVj0jnP7EROq+zImOvhbEZS0j5sAg1tisdfxcye5/6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121113; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2JdwHoXDCW8Wq7JvGLWEIsGDzWVd88t0Rzzs+mMIslM=; b=UMrdBcyCO2LX/1U0UML2xKRdJKv1KeukrLKtr3VujVnHkUhVTR/YcEIKTaTwy67ZPk3Xt0ruuO8vW1stGhLtsWFERR5S1Z+OEPfE+95PPQiCBJ9+Y7luYZCvwqGsnjhb5jWTQ4wA7ragzBCbLKBuNEtSblLWFBAPx+Y59YjYnhU= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121113006520.4804023015636; Wed, 6 May 2026 19:31:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWS-0008CU-Ew; Wed, 06 May 2026 22:31:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVX-0007TZ-6u for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:38 -0400 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVT-0000Vo-Ko for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:34 -0400 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7dcd17e19b6so216039a34.1 for ; Wed, 06 May 2026 19:30:29 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121028; x=1778725828; darn=nongnu.org; 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=2JdwHoXDCW8Wq7JvGLWEIsGDzWVd88t0Rzzs+mMIslM=; b=bHc1rRRy1w9HuJPW9o+AZidLrdmivnNbu7etTfQkpHUVYR1l5PeqO8yS5NyQ2/mpW7 mZ/WmflbtUULmO0alrNci1px9EDAoojubc35QMoGUtNqanrm9z9BV4BJ+NDyVu895Uqu Pe8rSFTjv7/TYgDzpEDZVKFMJLq91RXpunNugeUA0CZ/CGIt9hERIRpG2ycmLzN+DVgV C8ZIBo2VdDhhQZGximHYR/DFlkihD0J12YtyOxHOyYsiTn3VK6Yn0OmXQI673h6gKb+I 8GgC1lJbBnIBp2+amw8XSic63TTeJbRxyQacayglVTOtG4qk11XCsisO4y/ourBcLGWm jUbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121028; x=1778725828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2JdwHoXDCW8Wq7JvGLWEIsGDzWVd88t0Rzzs+mMIslM=; b=aBx2NfzVMSzCWp5+XQ9BuuENZ8+uB++iseWXCk3dsP5C0FwUQHWu//O8tVBqD9jIl6 FlasvsBeU5YNxyClWRyrYZP5IqBLpSIHFOsOSnwfjRMGku0h0mfQbiNMSApvEVqL8zSi ttXA5O3ekgcLeHG+E/IG/6449Sl9M4JZGSQ3KOG65Pj8K7GjXllfbIdrWQZNsiFqL588 gRlsOUKwvjpo1j5uS/B8VMngt0sppNqlUI3I0w7u1znIuqP14ue57XY5xjzEWsa62dkw QFIubqMfB/3h5F3Q5uXiP3cLDILAJuz3T3P9uFWHkxUho/9Dc1ciU6+DcJ/Z++HetKYk 67VA== X-Gm-Message-State: AOJu0Yy4xJfCZgZz1MMRHHXJv12oip+4Wp+JvA/WgCjGwlHrrz8HEeBD MM71PBjpIbnRyVZy5tSiEp0I41Gn3Iyqska6mCHPzxTv9izA11TV3Fd7oBHiAz9fGpfdYMkNXek ZogIQAlM= X-Gm-Gg: AeBDieuqhiWCAuSSRtjWxrWFr1n7vd+/17H02IppYLk1g+29qS4qE0Hc5EkMvZ+yBfv bgjAFtUSBm3IFAflx92CXwOEUv+lw6ocBIAx8uATC7LiJ4LCRaAS++XOmnVUB8WMC+98WruWwbt 1Zgsp3flZZ/f6ehtpGbohxsckzbvxPNwgfWib+6hW2aOd5EZqv5znUe7VHH6a1rsOPTWrSIy2/O IF/VrgyKmqeDQQSkgLauWDIcFBNK0px8zhXSGRO3KGrLgM4CjO+VaFxKA1yiut4eQaxuMrodaG/ i1Y+/ZYn80ylIKQvNdp47eiG3/gFzdywKsBUJR4ZUpjKU54Hzo0jeN04ocJfDC8ihC2daTqFxw9 lng0PBx15iVg0VOmPKSEuhdEbsPFulvPr5bDSB6rFY+UMaB6v4xJu0Gm4oRkIk94vWjHB5Vawri rNpphSsZCpqcAWXUkPFOk2 X-Received: by 2002:a05:6830:3592:b0:7db:b5c9:2d87 with SMTP id 46e09a7af769-7e1def36698mr3658068a34.11.1778121028239; Wed, 06 May 2026 19:30:28 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 08/25] bsd-user: Add FreeBSD tty ioctl definitions Date: Wed, 6 May 2026 20:28:10 -0600 Message-ID: <20260507022827.44499-9-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32c; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32c.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121115477154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-ttycom.h with terminal control ioctl definitions including TARGET_TIOCGETA, TARGET_TIOCSETA, window size ioctls, and the target_termios structure for terminal I/O control. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-ttycom.h | 239 +++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-ttycom.h diff --git a/bsd-user/freebsd/os-ioctl-ttycom.h b/bsd-user/freebsd/os-ioctl= -ttycom.h new file mode 100644 index 0000000000..d4af9f2e4d --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-ttycom.h @@ -0,0 +1,239 @@ +/* + * FreeBSD ttycom definitions for ioctl(2) emulation + * + * Copyright (c) 2013 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef BSD_USER_FREEBSD_OS_IOCTL_TTYCOM_H +#define BSD_USER_FREEBSD_OS_IOCTL_TTYCOM_H + +#include "os-ioctl-ioccom.h" + +/* From sys/ttycom.h and sys/_termios.h */ + +#define TARGET_VEOF 0 /* ICANON */ +#define TARGET_VEOL 1 /* ICANON */ +#define TARGET_VEOL2 2 /* ICANON together with IEXTEN */ +#define TARGET_VERASE 3 /* ICANON */ +#define TARGET_VWERASE 4 /* ICANON together with IEXTEN */ +#define TARGET_VKILL 5 /* ICANON */ +#define TARGET_VREPRINT 6 /* ICANON together with IEXTEN */ +#define TARGET_VERASE2 7 /* ICANON */ +#define TARGET_VINTR 8 /* ISIG */ +#define TARGET_VQUIT 9 /* ISIG */ +#define TARGET_VSUSP 10 /* ISIG */ +#define TARGET_VDSUSP 11 /* ISIG together with IEXTEN */ +#define TARGET_VSTART 12 /* IXON, IXOFF */ +#define TARGET_VSTOP 13 /* IXON, IXOFF */ +#define TARGET_VLNEXT 14 /* IEXTEN */ +#define TARGET_VDISCARD 15 /* IEXTEN */ +#define TARGET_VMIN 16 /* !ICANON */ +#define TARGET_VTIME 17 /* !ICANON */ +#define TARGET_VSTATUS 18 /* ICANON together with IEXTEN */ +/* 19 spare 2 */ +#define TARGET_NCCS 20 + +/* + * Input flags - software input processing + */ +#define TARGET_IGNBRK 0x00000001 /* ignore BREAK condition */ +#define TARGET_BRKINT 0x00000002 /* map BREAK to SIGINTR */ +#define TARGET_IGNPAR 0x00000004 /* ignore (discard) parity errors */ +#define TARGET_PARMRK 0x00000008 /* mark parity and framing errors */ +#define TARGET_INPCK 0x00000010 /* enable checking of parity errors */ +#define TARGET_ISTRIP 0x00000020 /* strip 8th bit off chars */ +#define TARGET_INLCR 0x00000040 /* map NL into CR */ +#define TARGET_IGNCR 0x00000080 /* ignore CR */ +#define TARGET_ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */ +#define TARGET_IXON 0x00000200 /* enable output flow control */ +#define TARGET_IXOFF 0x00000400 /* enable input flow control */ +#define TARGET_IXANY 0x00000800 /* any char will restart after stop */ +#define TARGET_IMAXBEL 0x00002000 /* ring bell on input queue full */ +#define TARGET_IUTF8 0x00004000 /* assume input is utf-8 encoded */ + +/* + * Output flags - software output processing + */ +#define TARGET_OPOST 0x00000001 /* enable following output processing = */ +#define TARGET_ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ +#define TARGET_TABDLY 0x00000004 /* tab delay mask */ +#define TARGET_TAB0 0x00000000 /* no tab delay and expansion */ +#define TARGET_TAB3 0x00000004 /* expand tabs to spaces */ +#define TARGET_ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ +#define TARGET_OCRNL 0x00000010 /* map CR to NL on output */ +#define TARGET_ONOCR 0x00000020 /* no CR output at column 0 */ +#define TARGET_ONLRET 0x00000040 /* NL performs CR function */ + +/* + * Control flags - hardware control of terminal + */ +#define TARGET_CIGNORE 0x00000001 /* ignore control flags */ +#define TARGET_CSIZE 0x00000300 /* character size mask */ +#define TARGET_CS5 0x00000000 /* 5 bits (pseudo) */ +#define TARGET_CS6 0x00000100 /* 6 bits */ +#define TARGET_CS7 0x00000200 /* 7 bits */ +#define TARGET_CS8 0x00000300 /* 8 bits */ +#define TARGET_CSTOPB 0x00000400 /* send 2 stop bits */ +#define TARGET_CREAD 0x00000800 /* enable receiver */ +#define TARGET_PARENB 0x00001000 /* parity enable */ +#define TARGET_PARODD 0x00002000 /* odd parity, else even */ +#define TARGET_HUPCL 0x00004000 /* hang up on last close */ +#define TARGET_CLOCAL 0x00008000 /* ignore modem status lines */ +#define TARGET_CCTS_OFLOW 0x00010000 /* CTS flow control of output */ +#define TARGET_CRTSCTS (TARGET_CCTS_OFLOW | TARGET_CRTS_IFLOW) +#define TARGET_CRTS_IFLOW 0x00020000 /* RTS flow control of input */ +#define TARGET_CDTR_IFLOW 0x00040000 /* DTR flow control of input */ +#define TARGET_CDSR_OFLOW 0x00080000 /* DSR flow control of output */ +#define TARGET_CCAR_OFLOW 0x00100000 /* DCD flow control of output */ +#define TARGET_CNO_RTSDTR 0x00200000 /* Do not assert RTS or DTR automa= tically */ + +/* + * "Local" flags - dumping ground for other state + */ +#define TARGET_ECHOKE 0x00000001 /* visual erase for line kill */ +#define TARGET_ECHOE 0x00000002 /* visually erase chars */ +#define TARGET_ECHOK 0x00000004 /* echo NL after line kill */ +#define TARGET_ECHO 0x00000008 /* enable echoing */ +#define TARGET_ECHONL 0x00000010 /* echo NL even if ECHO is off */ +#define TARGET_ECHOPRT 0x00000020 /* visual erase mode for hardcopy */ +#define TARGET_ECHOCTL 0x00000040 /* echo control chars as ^(Char) */ +#define TARGET_ISIG 0x00000080 /* enable signals INTR, QUIT, [D]SUSP */ +#define TARGET_ICANON 0x00000100 /* canonicalize input lines */ +#define TARGET_ALTWERASE 0x00000200 /* use alternate WERASE algorithm */ +#define TARGET_IEXTEN 0x00000400 /* enable DISCARD and LNEXT */ +#define TARGET_EXTPROC 0x00000800 /* external processing */ +#define TARGET_TOSTOP 0x00400000 /* stop background jobs from output */ +#define TARGET_FLUSHO 0x00800000 /* output being flushed (state) */ +#define TARGET_NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */ +#define TARGET_PENDIN 0x20000000 /* XXX retype pending input (state) */ +#define TARGET_NOFLSH 0x80000000 /* don't flush after interrupt */ + +struct target_termios { + uint32_t c_iflag; /* input flags */ + uint32_t c_oflag; /* output flags */ + uint32_t c_cflag; /* control flags */ + uint32_t c_lflag; /* local flags */ + uint8_t c_cc[TARGET_NCCS]; /* control chars */ + uint32_t c_ispeed; /* input speed */ + uint32_t c_ospeed; /* output speed */ +}; + + +struct target_winsize { + uint16_t ws_row; /* rows, in characters */ + uint16_t ws_col; /* columns, in characters */ + uint16_t ws_xpixel; /* horizontal size, pixels */ + uint16_t ws_ypixel; /* vertical size, pixels */ +}; + + /* 0-2 compat */ + /* 3-7 unused */ + /* 8-10 compat */ + /* 11-12 unused */ +#define TARGET_TIOCEXCL TARGET_IO('t', 13) /* set exclusive use of tty */ +#define TARGET_TIOCNXCL TARGET_IO('t', 14) /* reset exclusive use of tty = */ +#define TARGET_TIOCGPTN TARGET_IOR('t', 15, int) /* Get pts number. */ +#define TARGET_TIOCFLUSH TARGET_IOW('t', 16, int) /* flush buffers */ + /* 17-18 compat */ +/* get termios struct */ +#define TARGET_TIOCGETA TARGET_IOR('t', 19, struct target_termios) +/* set termios struct */ +#define TARGET_TIOCSETA TARGET_IOW('t', 20, struct target_termios) +/* drain output, set */ +#define TARGET_TIOCSETAW TARGET_IOW('t', 21, struct target_termios) +/* drn out, fls in, set */ +#define TARGET_TIOCSETAF TARGET_IOW('t', 22, struct target_termios) + /* 23-25 unused */ +#define TARGET_TIOCGETD TARGET_IOR('t', 26, int) /* get line discipline */ +#define TARGET_TIOCSETD TARGET_IOW('t', 27, int) /* set line discipline */ +#define TARGET_TIOCPTMASTER TARGET_IO('t', 28) /* pts master validation */ + /* 29-85 unused */ +/* get ttywait timeout */ +#define TARGET_TIOCGDRAINWAIT TARGET_IOR('t', 86, int) +/* set ttywait timeout */ +#define TARGET_TIOCSDRAINWAIT TARGET_IOW('t', 87, int) + /* 88 unused */ + /* 89-91 conflicts: tun and tap */ +/* enable/get timestamp of last input event */ +#define TARGET_TIOCTIMESTAMP TARGET_IOR('t', 89, struct target_timeval) +/* modem: get wait on close */ +#define TARGET_TIOCMGDTRWAIT TARGET_IOR('t', 90, int) +/* modem: set wait on close */ +#define TARGET_TIOCMSDTRWAIT TARGET_IOW('t', 91, int) + /* 92-93 tun and tap */ + /* 94-97 conflicts: tun and tap */ +/* wait till output drained */ +#define TARGET_TIOCDRAIN TARGET_IO('t', 94) + /* pty: generate signal */ +#define TARGET_TIOCSIG TARGET_IOWINT('t', 95) +/* pty: external processing */ +#define TARGET_TIOCEXT TARGET_IOW('t', 96, int) +/* become controlling tty */ +#define TARGET_TIOCSCTTY TARGET_IO('t', 97) +/* become virtual console */ +#define TARGET_TIOCCONS TARGET_IOW('t', 98, int) +/* get session id */ +#define TARGET_TIOCGSID TARGET_IOR('t', 99, int) + /* 100 unused */ +/* simulate ^T status message */ +#define TARGET_TIOCSTAT TARGET_IO('t', 101) + /* pty: set/clr usr cntl mode */ +#define TARGET_TIOCUCNTL TARGET_IOW('t', 102, int) +/* usr cntl op "n" */ +#define TARGET_TIOCCMD(n) TARGET_IO('u', n) +/* set window size */ +#define TARGET_TIOCSWINSZ TARGET_IOW('t', 103, struct target_winsize) +/* get window size */ +#define TARGET_TIOCGWINSZ TARGET_IOR('t', 104, struct target_winsize) + /* 105 unused */ +/* get all modem bits */ +#define TARGET_TIOCMGET TARGET_IOR('t', 106, int) +#define TARGET_TIOCM_LE 0001 /* line enable */ +#define TARGET_TIOCM_DTR 0002 /* data terminal ready */ +#define TARGET_TIOCM_RTS 0004 /* request to send */ +#define TARGET_TIOCM_ST 0010 /* secondary transmit */ +#define TARGET_TIOCM_SR 0020 /* secondary receive */ +#define TARGET_TIOCM_CTS 0040 /* clear to send */ +#define TARGET_TIOCM_DCD 0100 /* data carrier detect */ +#define TARGET_TIOCM_RI 0200 /* ring indicate */ +#define TARGET_TIOCM_DSR 0400 /* data set ready */ +#define TARGET_TIOCM_CD TARGET_TIOCM_DCD +#define TARGET_TIOCM_CAR TARGET_TIOCM_DCD +#define TARGET_TIOCM_RNG TARGET_TIOCM_RI +#define TARGET_TIOCMBIC TARGET_IOW('t', 107, int) /* bic modem bits */ +#define TARGET_TIOCMBIS TARGET_IOW('t', 108, int) /* bis modem bits */ +#define TARGET_TIOCMSET TARGET_IOW('t', 109, int) /* set all modem bits */ +/* start output, like ^Q */ +#define TARGET_TIOCSTART TARGET_IO('t', 110) +/* stop output, like ^S */ +#define TARGET_TIOCSTOP TARGET_IO('t', 111) +/* pty: set/clear packet mode */ +#define TARGET_TIOCPKT TARGET_IOW('t', 112, int) +#define TARGET_TIOCPKT_DATA 0x00 /* data packet */ +#define TARGET_TIOCPKT_FLUSHREAD 0x01 /* flush packet */ +#define TARGET_TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ +#define TARGET_TIOCPKT_STOP 0x04 /* stop output */ +#define TARGET_TIOCPKT_START 0x08 /* start output */ +#define TARGET_TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ +#define TARGET_TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ +#define TARGET_TIOCPKT_IOCTL 0x40 /* state change of pty dri= ver */ +#define TARGET_TIOCNOTTY TARGET_IO('t', 113) /* void tty association */ +#define TARGET_TIOCSTI TARGET_IOW('t', 114, char) /* simulate terminal in= put */ +#define TARGET_TIOCOUTQ TARGET_IOR('t', 115, int) /* output queue size */ + /* 116-117 compat */ +#define TARGET_TIOCSPGRP TARGET_IOW('t', 118, int) /* set pgrp of tty */ +#define TARGET_TIOCGPGRP TARGET_IOR('t', 119, int) /* get pgrp of tty */ +#define TARGET_TIOCCDTR TARGET_IO('t', 120) /* clear data terminal ready = */ +#define TARGET_TIOCSDTR TARGET_IO('t', 121) /* set data terminal ready */ +#define TARGET_TIOCCBRK TARGET_IO('t', 122) /* clear break bit */ +#define TARGET_TIOCSBRK TARGET_IO('t', 123) /* set break bit */ + /* 124-127 compat */ + +#define TARGET_TTYDISC 0 /* termios tty line discipline */ +#define TARGET_SLIPDISC 4 /* serial IP discipline */ +#define TARGET_PPPDISC 5 /* PPP discipline */ +#define TARGET_NETGRAPHDISC 6 /* Netgraph tty node discipline */ +#define TARGET_H4DISC 7 /* Netgraph Bluetooth H4 discipline */ + +#endif /* BSD_USER_FREEBSD_OS_IOCTL_TTYCOM_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121086; cv=none; d=zohomail.com; s=zohoarc; b=SlYF8DPwwuiyjDvUCzo01CUq6A9eCdYxi9q9ew+HvPYPRe9xzcPi3OEhifhgmkxiTdXfvvqVkRxGqIY1y4JrAq3muLANqLLTNsWJuuyfEwirYO5XRGn3xaXNbAcQuuxxWwBvfN9QUEcL1B1H6Uru5kCdjLyfe0a+nX/pQPJP1+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121086; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DqwbwVXSnkNJYwUgPRis0N7klAzS5K0nBAmWeh9H1GE=; b=Ifvqs8tCbM1UHip7mHc+A9JgcfGERBi1qjhStTPdX6y51FS2t3c6WUdogn7j4gApVPFcO0Z3AQf0EN9yXL+aU+Z5EU9Ui9oBoOTGLNLiNRTaFfrxJnDeAc0KIxRrfhcw8wlAhi5fLaroSG2VMss3oVqGrQvFcGwKJ7msaRXSh34= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121086542187.85617634749235; Wed, 6 May 2026 19:31:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoVy-0007aC-15; Wed, 06 May 2026 22:31:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVW-0007T5-7I for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:34 -0400 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVT-0000Vs-Kw for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:33 -0400 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-7d4be94eeacso417558a34.2 for ; Wed, 06 May 2026 19:30:30 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121029; x=1778725829; darn=nongnu.org; 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=DqwbwVXSnkNJYwUgPRis0N7klAzS5K0nBAmWeh9H1GE=; b=mcZVXUuXn1SxlfsysWBIwWPy2QRDnBStbLc0y3ESG58cKeH341kaaXy1g05Rsbz1l3 RMvnuiF1von3uwbG9rHGPU/x/Hh6rdBd1+OlIoK8oKtfJq20iYcjhfTqus1PfxN+ZGdQ bcUmcgWiAqBZ7OZ4dluix9JC7V7Za9SYuHQu2YuLVSjhaMaWoiQXhVMHtO6JrlhFo9Tr PSoZhLbfcAN7N8A2FLNx09Lx/Ye+J2lALcJ7l7mhPgSxPD+weEr7USBJHgiiQlW71ZU6 thcu7eqHOe2aek1dyV/hmRhPHMr5jOjyp3CyNXejSl1iU9a9qcCjzjE5nkgy4zzIj8e9 oG4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121029; x=1778725829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DqwbwVXSnkNJYwUgPRis0N7klAzS5K0nBAmWeh9H1GE=; b=jZLjRALo7DEWVklujHXIk0lLT2XeIIn8XAGl0eRhouEUrWr8bKaTMplbGzhdB4+En8 iHg4i9xTao2IGRQOnSRWMgRBgSSklYAycKzVDztydIr5OtSIGv+rd1FiKhDxn1VRRK0G Autnb6lhZLje1E5WkvKWuZew8IpP+eWSrQ2tM8FA5iW3CzXhd1H192VPCoudRjL7UJaU 37zjz3xrTgMm8JtXPXGRcX7iw5mEwPaFC4gRnIpzUnSDxeNxlak2ODSQq8kHQVAfr8kI DOSqMP3204jbgVIEm7hQf6apNJbphv62ARiUXRtoDc96Vuq/fF6u79JSzzLOkAdkFxbj WFDQ== X-Gm-Message-State: AOJu0YyCbQ1Q4Kc23oZnOTzAN8BggNOoF/Eou2nFUQ3bgz6+tE7OhhJt HZgyF33Tqhinvq9CXXsr3eUX9lVP2zxUzrX945qQLGFUnEemKwpDBU6jXzkp7Ojs0p9TACzrQhJ EwUMO0n8= X-Gm-Gg: AeBDieuUqxJx+y1xxVEP7J2sG2LPCiyVUNL6WEtgBYSFtB8lSjjJyVx02fBTFxov9CP 2Q3cAj8cCFxqNGQW38wf8gER9aGl4/Pc7AVrEbBqk5jnMusDCdHJ1B8F/AZKqJ4sCVFxT13KSt6 o62KTEzkFlEzj1kZd1EKZ1rGKAKgXDWUs3sGL6g+6qAFY5qATscbDeh8c4o65VaiK9r28D8yh14 lXeGyjk0TwqwhL84pTQbWjMr05kY/p7MOGzFg5tnC8WRVCRn5v0dsErvsbl5bp+bwF4FBTY0Sfx Wn6F2nREA0OD+AuYg/+PcRDGFQyoDeWOK/7FVGgkOzCOdzqQJ39Me9rIty0PI6cY3WJanOdnvJ5 xeh2pf0nvLRNFLKaB7rp0LNa+9Ia1zx7QPNMg928qmvD0cB63Md3vbOLf1sN74sPnNEXjJumnnf 8OoD4lCGYoHx5tCkXH9yyrfJ/aTPNV5W0= X-Received: by 2002:a05:6830:6d48:b0:7dc:d0cc:922 with SMTP id 46e09a7af769-7e1df194678mr3520151a34.27.1778121029637; Wed, 06 May 2026 19:30:29 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 09/25] bsd-user: Add FreeBSD file I/O ioctl definitions Date: Wed, 6 May 2026 20:28:11 -0600 Message-ID: <20260507022827.44499-10-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::335; envelope-from=imp@bsdimp.com; helo=mail-ot1-x335.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121087360158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-filio.h with file I/O control ioctl definitions including FIONREAD, FIONBIO, FIOASYNC, and FIOSETOWN for file descriptor control. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-filio.h | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-filio.h diff --git a/bsd-user/freebsd/os-ioctl-filio.h b/bsd-user/freebsd/os-ioctl-= filio.h new file mode 100644 index 0000000000..79e8f0b83d --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-filio.h @@ -0,0 +1,34 @@ +/* + * FreeBSD filio definitions for ioctl(2) emulation + * + * Copyright (c) 2013 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef BSD_USER_FREEBSD_OS_IOCTL_FILIO_H +#define BSD_USER_FREEBSD_OS_IOCTL_FILIO_H + +/* see sys/filio.h */ +#define TARGET_FIOCLEX TARGET_IO('f', 1) +#define TARGET_FIONCLEX TARGET_IO('f', 2) +#define TARGET_FIONREAD TARGET_IOR('f', 127, int) +#define TARGET_FIONBIO TARGET_IOW('f', 126, int) +#define TARGET_FIOASYNC TARGET_IOW('f', 125, int) +#define TARGET_FIOSETOWN TARGET_IOW('f', 124, int) +#define TARGET_FIOGETOWN TARGET_IOR('f', 123, int) +#define TARGET_FIODTYPE TARGET_IOR('f', 122, int) +#define TARGET_FIOGETLBA TARGET_IOR('f', 121, int) + +struct target_fiodgname_arg { + int32_t len; + abi_ulong buf; +}; + +#define TARGET_FIODGNAME TARGET_IOW('f', 120, \ + struct target_fiodgname_arg) +#define TARGET_FIONWRITE TARGET_IOR('f', 119, int) +#define TARGET_FIONSPACE TARGET_IOR('f', 118, int) +#define TARGET_FIOSEEKDATA TARGET_IOWR('f', 97, off_t) +#define TARGET_FIOSEEKHOLE TARGET_IOWR('f', 98, off_t) + +#endif /* BSD_USER_FREEBSD_OS_IOCTL_FILIO_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121122; cv=none; d=zohomail.com; s=zohoarc; b=T1wqQ8G0uLbATRpq8rpK3idMXAig0oM0nOrzkH2jB6Ea9ru858p+U0ACvXKBf0vX9GbofFxhzKRubmYv+y3UF8t//78anDsW11BwlUA+ME8qcdqEC+Gbz2Wu5hz45AG/CFgWsvwc5l6agVPzeSsED/zJhgB1vgiUV2s4WDnI5aM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121122; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HruOPtNX7hnIWPn24gtKSGxrywCEy0L6f5iPKD3PBNo=; b=TJEuM10mTWW7ljxjbjbvCUFGSRTEUR+Df5yubZOB4TxLHueGANWeAAE603MEBWljdNLxqdbiwUE5q9ID4n1gcAPYal6RZGrSaFFmKMXTBjSpJUs+vWBWj/hgT/U6d41Mg5bQPCsS6uRaEfiRoVncuwVho8PqrXnOk3jJjXypgYk= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121122008787.5795830090923; Wed, 6 May 2026 19:32:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWD-0007h8-HD; Wed, 06 May 2026 22:31:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0007Tl-7k for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVU-0000W2-D2 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:36 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7dea20cf21aso354728a34.1 for ; Wed, 06 May 2026 19:30:32 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121031; x=1778725831; darn=nongnu.org; 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=HruOPtNX7hnIWPn24gtKSGxrywCEy0L6f5iPKD3PBNo=; b=lt+SqR/6FQCBZcbExZqHA3XEdzpeieFtl/GZYphaogH/3cgVaQbAhGzHt5eOFAG0J/ zpL/LPmaOTP8MkAsTFZOQCHv2zliK31IsgcIFvqbhnTPzwRsgUd+o6mO4Lx7IraLigQJ pksRzR8OnVsQgFIL8V/WHKbe0bJneI31ACt8YMidAzAqCG2uYdhhilcsa2jrVtJjMj4v 4PzxWv16uo4oERTzhWIAbCt/yUJKbY9gXQVmXKl5hDOaQS0w18YfxXodJDon5Xm1f9rd 2/OMTrhDuacwOQHYKCu118b/SJbFijeraPJaWlHsnuvzn5g5MkNlYHcUx4a83DyLrDd7 VZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121031; x=1778725831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HruOPtNX7hnIWPn24gtKSGxrywCEy0L6f5iPKD3PBNo=; b=TAhzd7uReqrg0ebFqhmCrRoMIS6qprY/aQUPHKfRjFKWk90YfQX87W7WtpKeIA2iLr ZxpfrB0bIQWPkr2F22sh7A76mR7MpYL0KrhqelqRpk52MAUbbGHZ3ayy12bsxYGb0Vpy Jjf/s4kn5s0rEwcF/Exznbi79TOWvrkabtSZ500muTbeqSwuubBwLFZGNweY9cnKjb/v YsxhubTcIpq6KX4np3NT8h/lnwKrwFutC7F7G5zDaExNG8a09oiWK50AeaoqM7ThGKiT E5oVRU4uYUaRrQar7hf+5Eapm/SwDt7G5I9Lbfxm7legU7K66R/PrrFWJSG5/Cbaxb/B 3V1g== X-Gm-Message-State: AOJu0Yw/vkmpbBe2hFZada0BTZdVIMyvz0JR5APyuzoafToaExouTSI9 fpJpHsnjV9i9Y3thP/5eDJkiVaYHluPxgr2kRYqeoS/97a+1GnwcS5nMmHlSAwYQBGeJR/gfTP5 mK/3rNy4= X-Gm-Gg: AeBDiesqynPlW+r8N1t7I9MPjr97iPfZX/8UA+GQec4P4ltAQHaaMG08+v0pCS7hmth MRzo7HS8TaeVwYKYpZRJNJaBWCt7KwHxOSGBkcfX+M0KKu+bv15nCylCGJziIMHMm/vRPAJhVFE fGmysLc7iwJoYjh/7Axk9uLe25bGogGwc1V9ZXWPIjhJdgsJhRljYN2hx3xBPsQ6fjgv7OlO4DW OXhH4OgOApauREXtb0UKhUcba4//DsjoYodPNtxkLpuRIJlnySrisELJjgjcgCVHLDLMY4JdnM6 CyM5gwzdNqeKR+92eIziZDMGEBtun1L7C1KWkU3ldpKj2mZOV1syFmgHpDdfh0yxUbyvkYkNSfE EZHkQ2Yexjd0hKPVRrxhjLw/O5DQuTE9Ihg7yMdNnKnTnQG/7PzUOwfJOUNiv7byCRVa03Rto+X 6uc1IleGxWU4MfB/OmGK1x X-Received: by 2002:a05:6830:378e:b0:7de:49c0:a752 with SMTP id 46e09a7af769-7e1df26c2d2mr3582360a34.27.1778121030870; Wed, 06 May 2026 19:30:30 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 10/25] bsd-user: Add FreeBSD socket ioctl definitions Date: Wed, 6 May 2026 20:28:12 -0600 Message-ID: <20260507022827.44499-11-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32b; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32b.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121123732154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-sockio.h with network socket and interface control ioctl definitions including SIOCGIFADDR, SIOCSIFADDR, SIOCGIFCONF, and related network interface ioctls with target_ structure definitions. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-sockio.h | 246 +++++++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-sockio.h diff --git a/bsd-user/freebsd/os-ioctl-sockio.h b/bsd-user/freebsd/os-ioctl= -sockio.h new file mode 100644 index 0000000000..5c1a619400 --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-sockio.h @@ -0,0 +1,246 @@ +/* + * FreeBSD sockio.h definitions for ioctl(2) emulation + * + * Copyright (c) 2015 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef OS_IOCTL_SOCKIO_H +#define OS_IOCTL_SOCKIO_H + +/* See sys/sockio.h */ +#define TARGET_SIOCSHIWAT TARGET_IOW('s', 0, int32_t) +#define TARGET_SIOCGHIWAT TARGET_IOR('s', 1, int32_t) +#define TARGET_SIOCSLOWAT TARGET_IOW('s', 2, int32_t) +#define TARGET_SIOCGLOWAT TARGET_IOR('s', 3, int32_t) +#define TARGET_SIOCATMARK TARGET_IOR('s', 7, int32_t) +#define TARGET_SIOCSPGRP TARGET_IOW('s', 8, int32_t) +#define TARGET_SIOCGPGRP TARGET_IOR('s', 9, int32_t) + +/* See net/if.h */ +struct target_ifreq_buffer { + abi_ulong length; + abi_ulong buffer; +}; + +struct target_ifreq_nv_req { + abi_uint buf_length; /* Total size of buffer */ + abi_uint length; /* Length of the filled part */ + abi_ulong buffer; /* Buffer itself, containing packed nv */ +}; + +#define TARGET_IFNAMSIZ 16 + +struct target_ifreq { + char ifr_name[TARGET_IFNAMSIZ]; + union { + struct target_sockaddr ifru_addr; + struct target_sockaddr ifru_dstaddr; + struct target_sockaddr ifru_broadaddr; + struct target_ifreq_buffer ifru_buffer; + abi_short ifru_flags[2]; + abi_short ifru_index; + abi_int ifru_jid; + abi_int ifru_metric; + abi_int ifru_mtu; + abi_int ifru_phys; + abi_int ifru_media; + abi_ulong ifru_data; + abi_int ifru_cap[2]; + uint32_t ifru_fib; + uint8_t ifru_vlan_pcp; + struct target_ifreq_nv_req ifru_nv; + } ifr_ifru; +}; + + +#define TARGET_SIOCSIFADDR TARGET_IOW('i', 12, struct target_ifreq) +#define TARGET_SIOCGIFADDR TARGET_IOWR('i', 33, struct target_ifreq) +#define TARGET_SIOCSIFDSTADDR TARGET_IOW('i', 14, struct target_ifreq) +#define TARGET_SIOCGIFDSTADDR TARGET_IOWR('i', 34, struct target_ifreq) +#define TARGET_SIOCSIFFLAGS TARGET_IOW('i', 16, struct target_ifreq) +#define TARGET_SIOCGIFFLAGS TARGET_IOWR('i', 17, struct target_ifreq) +#define TARGET_SIOCGIFBRDADDR TARGET_IOWR('i', 35, struct target_ifreq) +#define TARGET_SIOCSIFBRDADDR TARGET_IOW('i', 19, struct target_ifreq) +#define TARGET_SIOCGIFNETMASK TARGET_IOWR('i', 37, struct target_ifreq) +#define TARGET_SIOCSIFNETMASK TARGET_IOW('i', 22, struct target_ifreq) +#define TARGET_SIOCGIFMETRIC TARGET_IOWR('i', 23, struct target_ifreq) +#define TARGET_SIOCSIFMETRIC TARGET_IOW('i', 24, struct target_ifreq) +#define TARGET_SIOCDIFADDR TARGET_IOW('i', 25, struct target_ifreq) +#define TARGET_SIOCSIFCAP TARGET_IOW('i', 30, struct target_ifreq) +#define TARGET_SIOCGIFCAP TARGET_IOWR('i', 31, struct target_ifreq) +#define TARGET_SIOCGIFINDEX TARGET_IOWR('i', 32, struct target_ifreq) +#define TARGET_SIOCGIFMAC TARGET_IOWR('i', 38, struct target_ifreq) +#define TARGET_SIOCSIFMAC TARGET_IOW('i', 39, struct target_ifreq) +#define TARGET_SIOCSIFNAME TARGET_IOW('i', 40, struct target_ifreq) +#define TARGET_SIOCSIFDESCR TARGET_IOW('i', 41, struct target_ifreq) +#define TARGET_SIOCGIFDESCR TARGET_IOWR('i', 42, struct target_ifreq) +#define TARGET_SIOCADDMULTI TARGET_IOW('i', 49, struct target_ifreq) +#define TARGET_SIOCDELMULTI TARGET_IOW('i', 50, struct target_ifreq) +#define TARGET_SIOCGIFMTU TARGET_IOWR('i', 51, struct target_ifreq) +#define TARGET_SIOCSIFMTU TARGET_IOW('i', 52, struct target_ifreq) +#define TARGET_SIOCGIFPHYS TARGET_IOWR('i', 53, struct target_ifreq) +#define TARGET_SIOCSIFPHYS TARGET_IOW('i', 54, struct target_ifreq) +#define TARGET_SIOCSIFMEDIA TARGET_IOWR('i', 55, struct target_ifreq) +#define TARGET_SIOCSIFGENERIC TARGET_IOW('i', 57, struct target_ifreq) +#define TARGET_SIOCGIFGENERIC TARGET_IOWR('i', 58, struct target_ifreq) +#define TARGET_SIOCSIFLLADDR TARGET_IOW('i', 60, struct target_ifreq) +#define TARGET_SIOCGIFPSRCADDR TARGET_IOWR('i', 71, struct target_ifreq) +#define TARGET_SIOCGIFPDSTADDR TARGET_IOWR('i', 72, struct target_ifreq) +#define TARGET_SIOCDIFPHYADDR TARGET_IOW('i', 73, struct target_ifreq) +#define TARGET_SIOCGPRIVATE_0 TARGET_IOWR('i', 80, struct target_ifreq) +#define TARGET_SIOCGPRIVATE_1 TARGET_IOWR('i', 81, struct target_ifreq) +#define TARGET_SIOCSIFVNET TARGET_IOWR('i', 90, struct target_ifreq) +#define TARGET_SIOCSIFRVNET TARGET_IOWR('i', 91, struct target_ifreq) +#define TARGET_SIOCGIFFIB TARGET_IOWR('i', 92, struct target_ifreq) +#define TARGET_SIOCSIFFIB TARGET_IOW('i', 93, struct target_ifreq) +#define TARGET_SIOCGTUNFIB TARGET_IOWR('i', 94, struct target_ifreq) +#define TARGET_SIOCIFCREATE TARGET_IOWR('i', 122, struct target_ifreq) +#define TARGET_SIOCIFCREATE2 TARGET_IOWR('i', 124, struct target_ifreq) +#define TARGET_SIOCIFDESTROY TARGET_IOW('i', 121, struct target_ifreq) + +/* net/if_gre.h */ +#define TARGET_GREGKEY TARGET_IOWR('i', 107, struct target_ifreq) +#define TARGET_GREGOPTS TARGET_IOWR('i', 109, struct target_ifreq) + +/* net/if_gif.h */ +#define TARGET_GIFGOPTS TARGET_IOWR('i', 150, struct target_ifreq) + +/* netinet/ip_carp.h */ +#define TARGET_SIOCGVH TARGET_IOWR('i', 246, struct target_ifreq) + +/* net/if_pfsync.h */ +#define TARGET_SIOCGETPFSYNC TARGET_IOWR('i', 248, struct target_ifreq) + + +/* See net/if.h */ +struct target_ifconf { + int32_t ifc_len; + union { + abi_ulong ifcu_buf; + abi_ulong ifcu_req; + } ifc_ifcu; +}; + +#define TARGET_SIOCGIFCONF TARGET_IOWR('i', 36, struct target_ifconf) + +/* See net/if.h */ +struct target_ifdrv { + char ifd_name[TARGET_IFNAMSIZ]; + abi_ulong ifd_cmd; + abi_ulong ifd_len; + abi_ulong ifd_data; +}; + +#define TARGET_SIOCSDRVSPEC TARGET_IOW('i', 123, struct target_ifdrv) +#define TARGET_SIOCGDRVSPEC TARGET_IOWR('i', 123, struct target_ifdrv) + +/* See net/if.h */ +struct target_ifg_req { + union { + char ifgrqu_group[TARGET_IFNAMSIZ]; + char ifgrqu_member[TARGET_IFNAMSIZ]; + } ifgrq_ifgrqu; +}; + +struct target_ifgroupreq { + char ifgr_name[TARGET_IFNAMSIZ]; + uint32_t ifgr_len; + union { + char ifgru_group[TARGET_IFNAMSIZ]; + abi_ulong ifgru_groups; + } ifgr_ifgru; +}; + +#define TARGET_SIOCGIFGROUP TARGET_IOWR('i', 136, struct target_ifgroup= req) + +struct target_ifmediareq { + char ifm_name[TARGET_IFNAMSIZ]; + int32_t ifm_current; + int32_t ifm_mask; + int32_t ifm_status; + int32_t ifm_active; + int32_t ifm_count; + abi_ulong ifm_ulist; +}; + +#define TARGET_SIOCGIFMEDIA TARGET_IOWR('i', 56, struct target_ifmediareq) +#define TARGET_SIOCGIFXMEDIA TARGET_IOWR('i', 139, struct target_ifmediar= eq) + +#define TARGET_IFSTATMAX 800 +struct target_ifstat { + char ifs_name[TARGET_IFNAMSIZ]; + char ascii[TARGET_IFSTATMAX + 1]; +}; + +#define TARGET_SIOCGIFSTATUS TARGET_IOWR('i', 59, struct target_ifstat) + +/* net80211/ieee80211_ioctl.h */ +struct target_ieee80211req { + char i_name[TARGET_IFNAMSIZ]; + uint16_t i_type; + int16_t i_val; + uint16_t i_len; + abi_ulong i_data; +}; + +#define TARGET_SIOCG80211 TARGET_IOWR('i', 235, struct target_ieee80211req) + +/* net/if_lagg.h */ +struct target_lacp_opreq { + uint16_t actor_prio; + uint8_t actor_mac[ETHER_ADDR_LEN]; + uint16_t actor_key; + uint16_t actor_portprio; + uint16_t actor_portno; + uint8_t actor_state; + uint16_t partner_prio; + uint8_t partner_mac[ETHER_ADDR_LEN]; + uint16_t partner_key; + uint16_t partner_portprio; + uint16_t partner_portno; + uint8_t partner_state; +}; + +struct target_lagg_reqport { + char rp_ifname[TARGET_IFNAMSIZ]; + char rp_portname[TARGET_IFNAMSIZ]; + u_int32_t rp_prio; + u_int32_t rp_flags; + union { + struct target_lacp_opreq rpsc_lacp; + } rp_psc; +}; +#define TARGET_SIOCGLAGGPORT TARGET_IOWR('i', 140, struct target_lagg_reqp= ort) + +struct target_lagg_reqall { + char ra_ifname[TARGET_IFNAMSIZ]; + abi_uint ra_proto; + + abi_ulong ra_size; + abi_ulong ra_port; + abi_int ra_ports; + union { + struct target_lacp_opreq rpsc_lacp; + } ra_psc; +}; +#define TARGET_SIOCGLAGG TARGET_IOWR('i', 143, struct target_lagg_reqall) + +struct target_lagg_reqflags { + char rf_ifname[TARGET_IFNAMSIZ]; + uint32_t rf_flags; +}; +#define TARGET_SIOCGLAGGFLAGS TARGET_IOWR('i', 145, struct target_lagg_req= flags) + +struct target_lagg_reqopts { + char ro_ifname[TARGET_IFNAMSIZ]; + abi_int ro_opts; + abi_uint ro_count; + abi_uint ro_active; + abi_uint ro_flapping; + abi_int ro_flowid_shift; + uint32_t ro_bkt; +}; +#define TARGET_SIOCGLAGGOPTS TARGET_IOWR('i', 152, struct target_lagg_reqo= pts) + +#endif /* OS_IOCTL_SOCKIO_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121138; cv=none; d=zohomail.com; s=zohoarc; b=Jdy8WNKqeat114hYc0wj+rXIntF65E6r21oS4qntRvNAr9BNuRPnNMzNSYxw25kfihNj8l2Kc57Hn2WiURrf6mcfsetn9qEy/c5cg74Z9To3iLIBdevPKKDIx7lTBV+j/jnuDGM9G5MVS1ncOtGBf7vsj030CAEti7yzz0wLLVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121138; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9yMf4lyjKsv7lWurkUiyx9lzTlfXrhvijIaiDc6Lwn0=; b=KD5W8f6CmavcwN0c+r2ka5OYacWrj/KUWToToC38dI3B7egDh/2rum6w7R256hoL+jOQ20/18n294ylaj3RpnmaU13H2RJSkCeJlf1vKc3nk8PkQfwoGjnyMCAJm/VwILQsfXHGaCCN2hEVtOsGjTW415aKB5qoLxL/+LdF3gfE= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121138585497.454337137681; Wed, 6 May 2026 19:32:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWK-0007vF-Uh; Wed, 06 May 2026 22:31:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0007Tp-Fr for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVV-0000Wt-Gh for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:37 -0400 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7de7dc85b74so331680a34.2 for ; Wed, 06 May 2026 19:30:33 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121032; x=1778725832; darn=nongnu.org; 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=9yMf4lyjKsv7lWurkUiyx9lzTlfXrhvijIaiDc6Lwn0=; b=EAGsDBezp0qaC7VWjl5+z93anpnht8Gt1xyc0slpSFfvuq/2nWUo2Sbz0uJTE/gKN8 TX3bLcIX25P5kg8L+OKtB9UpcN5GlNe5xXT7heHlU8Io0tA67S6n1/n6pVzkIr3m+Cxs iHzw14xbfgklM9jEHdLCXjGtHitwllgkMpW3MdYWioi4CXJ0VB8qp+jOwoNIk6+xCzjm FT8fOJ23XJMwK1qy8LJQxxz2dTS/R91X6uu74PRHQUX7496PxjRkc4RkUAaL9e1rVK5i VQQ85+zl9UTQsHYmfRlcHEVqdTpGHnkdrmxUvgYcTLn+oLfg/6NVbnDpwuzzPz24SAjC bBUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121032; x=1778725832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9yMf4lyjKsv7lWurkUiyx9lzTlfXrhvijIaiDc6Lwn0=; b=tMv9K7X75bqWJ4xY+vwTDr1Dd7QFqcq7rhAy63a7s4trPh/6jk/c2zFsZDKwPDD6Nc MTRV+4iCBC5xn/Uo5qfZ4QcAiXkBeVfb1LTxzr3pq+UjLEHdGXbC7RyZIGWC662wIPqG 6KeFYJSM/iJa5W8Cm+k0KqMorF2nGbXIUKSnhcXj5BTyVyuFrEcS2BiaNnvHTYfDSIqo +APVuOGwtNxqbYX7MDbrS+Bj+mKYSuOXjic8xT1IBjd+0Z3bYSGtG8m8zYTYItJ6D0a8 8BusL/16NWVWxOCA3vdMkTXwhfQizwPnAAD/X8Ezawz++n77ncieCTwz3478WmetePjz 0tPQ== X-Gm-Message-State: AOJu0YwIVvdjyYEUc3pwjVad8kzZ2gxko2g6REiV/GmF60ecPvvg0S0B GGqL8uQ3/xMcDD1egjIjlXEv6kPkE6+5AITLffglxy4dzZs7biHDB0vsRKWDq0MbuomST/WkQCv BbbZkR0k= X-Gm-Gg: AeBDievJ87AsGGR2njPrtQGjl4zham6uTq7kqRYG097ZXFtA2UN9DO6+v5Yz+U1Xr/l AxVQ5Gweze+DcdFJUQ+TBHnHBg6FWT6Dojjcbm/3FMHA5VDZbfVYCIteEXn3W4oGqFoh3UdXsmT 3aWy+CtkWv2EfaujTdcTNHAyYPGYx8r1YuM2y2/ARDF3bmNyAZdqrFo9LW6cYHyFfTzU78RUnFc lLqUSCe+pY4p5hdpAU50l0I45hl65YNF1j+SdZ4BKeXWj16zm9SM02zRyu8Jd9e9VfLF05WEi2J MDnKH4MY9nA7lGqTxdkbdXPzc1+gY9/EooG1Rx50abgfZBlwAL6YfZoqszbD+1dcE37gbRSKPVD 4BUNP2X+Ye7KlmJhxKb4bnUyBNZYmQmMCnRQ5MAsgGrPq/bG5jGwfS9pr1/KImz8OHH1wdQKfgT rGIsZ+QAcb9X8CSK+3a7HZ X-Received: by 2002:a05:6830:390b:b0:7dc:d0cc:91b with SMTP id 46e09a7af769-7e1df1cdc20mr3710614a34.26.1778121032090; Wed, 06 May 2026 19:30:32 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 11/25] bsd-user: Add FreeBSD cryptodev ioctl definitions Date: Wed, 6 May 2026 20:28:13 -0600 Message-ID: <20260507022827.44499-12-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::332; envelope-from=imp@bsdimp.com; helo=mail-ot1-x332.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121139785154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-cryptodev.h with /dev/crypto ioctl definitions including CIOCGSESSION, CIOCCRYPT, and related cryptographic device control ioctls. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-cryptodev.h | 84 +++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-cryptodev.h diff --git a/bsd-user/freebsd/os-ioctl-cryptodev.h b/bsd-user/freebsd/os-io= ctl-cryptodev.h new file mode 100644 index 0000000000..b81112150f --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-cryptodev.h @@ -0,0 +1,84 @@ +/* + * FreeBSD cryptodev definitions for ioctl(2) emulation + * + * Copyright (c) 2014 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef BSD_USER_FREEBSD_OS_IOCTL_CRYPTODEV_H +#define BSD_USER_FREEBSD_OS_IOCTL_CRYPTODEV_H + +/* see opencrypto/cryptodev.h */ + +struct target_session_op { + u_int32_t cipher; + u_int32_t mac; + + u_int32_t keylen; + abi_ulong key; + int32_t mackeylen; + abi_ulong mackey; + + u_int32_t ses; +}; + + +struct target_session2_op { + u_int32_t cipher; + u_int32_t mac; + + u_int32_t keylen; + abi_ulong key; + int32_t mackeylen; + abi_ulong mackey; + + u_int32_t ses; + int32_t crid; + abi_int ivlen; + abi_int maclen; + abi_int pad[2]; +}; + +struct target_crypt_op { + uint32_t ses; + uint16_t op; /* i.e. COP_ENCRYPT */ +#define TARGET_COP_ENCRYPT 1 +#define TARGET_COP_DECRYPT 2 + uint16_t flags; +#define TARGET_COP_F_CIPHER_FIRST 0x0001 /* Cipher before MAC. */ +#define TARGET_COP_F_BATCH 0x0008 /* Batch op if possible */ + abi_uint len; + abi_ulong src; /* become iov[] inside kernel */ + abi_ulong dst; + abi_ulong mac; /* must be big enough for chosen MAC */ + abi_ulong iv; +}; + +/* op and flags the same as crypt_op */ +struct target_crypt_aead { + uint32_t ses; + uint16_t op; /* i.e. COP_ENCRYPT */ + uint16_t flags; + abi_uint len; + abi_uint aadlen; + abi_uint ivlen; + abi_ulong src; /* become iov[] inside kernel */ + abi_ulong dst; + abi_ulong aad; /* additional authenticated data */ + abi_ulong tag; /* must fit for chosen TAG length */ + abi_ulong iv; +}; + +struct target_crypt_find_op { + abi_int crid; + char name[32]; +}; + +#define TARGET_CIOCGSESSION TARGET_IOWR('c', 101, struct target_sessio= n_op) +#define TARGET_CIOCFSESSION TARGET_IOW('c', 102, u_int32_t) +#define TARGET_CIOCCRYPT TARGET_IOWR('c', 103, struct target_crypt_= op) +#define TARGET_CIOCGSESSION2 TARGET_IOWR('c', 106, struct target_sessio= n2_op) +#define TARGET_CIOCFINDDEV TARGET_IOWR('c', 108, struct target_crypt_= find_op) +#define TARGET_CIOCCRYPTAEAD TARGET_IOWR('c', 109, struct target_crypt_= aead) + +#endif /* BSD_USER_FREEBSD_OS_IOCTL_CRYPTODEV_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121134; cv=none; d=zohomail.com; s=zohoarc; b=bSX6jNUg1xtj2U38QeZd+wmHsnmyzsJKTQ82moOeMhmRG/CxIttYMDrAXsYiGz77tgPttbPJmOBBJ/HK9eGvE732uHn0p73PtKvpOuavvr6ukqYrQoBc976/UF0s/oKoOuk7uSUOPRP86upXsSv/VpSditvEtTOvI3NlPDs9FHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121134; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W14kYHCQHomYoHQxZOwNdRoUVzbIwGboLu86edRaDh4=; b=EughouV4mvvlYcnD1wuKxZSwkkHzUrRUkO2hG8j2o6lwmqID4pEuG6Cl+smWTp40eY4AtmTLqND9mLJ+F0NWX1R6IfHU89Y0lZJ5o8Tr6AaH3+/IYsyq4cmsGpOY8X72VQeOMC4FXJOr7J4lDZKHtyzXJVP75XLhXbi8tKMPkSE= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121134824864.6808731784679; Wed, 6 May 2026 19:32:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWF-0007ji-AG; Wed, 06 May 2026 22:31:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0007To-F8 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVW-0000XA-LB for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:37 -0400 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-7dcdd23fcdfso223993a34.3 for ; Wed, 06 May 2026 19:30:34 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121033; x=1778725833; darn=nongnu.org; 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=W14kYHCQHomYoHQxZOwNdRoUVzbIwGboLu86edRaDh4=; b=KgTcgb2Ji3hNNLQ8xVvVu8h+QtgZoZl2nVMALkdfAsev403KH9SMpryMXRiar5XznI KHpNAHNOPNzwpXRIQB1j1Tg3hmY5KMfiVdpOYNTnR+Sxj7cVMoeVBMCnj81GhjQbZdyF waiUlk2npWgETBqa73SJdqrzc7NkTyGe13kZJ8tnNl6pv/1dLC5FiJv1m+iWS5aQlSsY mjUMo5dcBbvFuaPpSPpkJnRd4MOfOZgllDbww5PJMfr/8BYZemYU5AZfqo73gLmOxvwW stui9M5n7INiqErQ5pSd6CtTiSAnsR9JKsHfotxw3Bjz2HYjAfmhawNTXvPU8hePm2U/ GTcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121033; x=1778725833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=W14kYHCQHomYoHQxZOwNdRoUVzbIwGboLu86edRaDh4=; b=G8fWm2p1mLSBF0D/K/rJCjINoXuW+zPyK5a5Nei0UCmkL4Aqe2PThulD1eArn7U4J1 OEW+/FcaKCENTCvhmN9Lj+urVpANi1VsCEcVyrZbNU45Ar9D9pEexveusoXN/bkCtK9M 6GO8ihac23P/b8VP0kMhCSWLbCZ4WJIV9tLbWRwGEoajtBHE4r3j2GbseA53WqUjKFzV 1fzNCiksoKm+p8sj5+4Yt0w7Tjvrh3Q/1xep89SlCmSkvmMGzQl5VNXw9uZbnQwsK8o2 +fRGziD94CQfjzKiGNQO5QBTVChfZPVZymogb28oSK0KCVKYKJOGB7t0otViAxeiyrUZ 7HkQ== X-Gm-Message-State: AOJu0YzxSXwky81hCaWu0yyWDTxlrfupL5H6IabRMknf+5ulZpKHUYmP tttNGi0VxabR5EqWColY1vswmK1r6SsRl3szVRk8p6HAWCMOa9t3om5HI8ipnNgkOtnmqAlSjcU zj7QaLvU= X-Gm-Gg: AeBDievNpd62Vlhc4yv9GXLxDm2S3VjEqVcv4Scj3lRa3NtsdlDqc1P8/nkCHiIhRnC utJB0usxc2IMjhCmghWWeHZOUTaPCcsz7Bk/1xuVgy6ikcpzSgFnd3Cm1JHhqFDA7mNFaNlRKcb O5LWgpIOd/iyVcCuactZZbUYveqr51JWxNQWNPvOApeEr6TCiCJlatXADNdg68nS/IvTVWEI9+r sOj5ZJMjqBoKyw66N34JQS+0tump8vkLz1ykHL5lNkwBD4HNPNOqkNpXuZ6tMidmHZrIxSUDK0Z ZKFewxK2LCd3IZ01VANomXF1EJCbEZ530/QPSHZpYS0wXT2RKcLFekAo2wYdq1P5j3z7rAt+flo cArSjadYhR6Ck5lt/aheZhY4UYg4hYUvbjGYac5B5N96hcwrlojA8wInlRwK6Uy6B7fVvywfOmN 7va7aVKEPda1wal2UdqJ7d X-Received: by 2002:a05:6830:2116:b0:7dc:da80:42b8 with SMTP id 46e09a7af769-7e1defc88c6mr3618008a34.18.1778121033041; Wed, 06 May 2026 19:30:33 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 12/25] bsd-user: Add FreeBSD disk ioctl definitions Date: Wed, 6 May 2026 20:28:14 -0600 Message-ID: <20260507022827.44499-13-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::329; envelope-from=imp@bsdimp.com; helo=mail-ot1-x329.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121135719154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-disk.h with disk and storage device ioctl definitions including DIOCGMEDIASIZE, DIOCGSECTORSIZE, and related disk management ioctls. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-disk.h | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-disk.h diff --git a/bsd-user/freebsd/os-ioctl-disk.h b/bsd-user/freebsd/os-ioctl-d= isk.h new file mode 100644 index 0000000000..8f4dddc7eb --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-disk.h @@ -0,0 +1,52 @@ +/* + * FreeBSD disk.h definitions for ioctl(2) emulation + * + * Copyright (c) 2015 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef OS_IOCTL_DISK_H +#define OS_IOCTL_DISK_H + +/* See sys/disk.h */ + +#define TARGET_MAXPATHLEN 1024 + +#define TARGET_DIOCGSECTORSIZE TARGET_IOR('d', 128, uint32_t) +#define TARGET_DIOCGMEDIASIZE TARGET_IOR('d', 129, int64_t) +#define TARGET_DIOCGFWSECTORS TARGET_IOR('d', 130, uint32_t) +#define TARGET_DIOCGFWHEADS TARGET_IOR('d', 131, uint32_t) +#define TARGET_DIOCGFLUSH TARGET_IO('d', 135) +#define TARGET_DIOCGDELETE TARGET_IOW('d', 136, int64_t[2]) +#define TARGET_DISK_IDENT_SIZE 256 +#define TARGET_DIOCGIDENT TARGET_IOR('d', 137, \ + char[TARGET_DISK_IDENT_SIZE]) +#define TARGET_DIOCGPROVIDERNAME TARGET_IOR('d', 138, \ + char[TARGET_MAXPATHLEN]) +#define TARGET_DIOCGSTRIPESIZE TARGET_IOR('d', 139, int64_t) +#define TARGET_DIOCGSTRIPEOFFSET TARGET_IOR('d', 140, int64_t) +#define TARGET_DIOCGPHYSPATH TARGET_IOR('d', 141, \ + char[TARGET_MAXPATHLEN]) + +struct target_diocgattr_arg { + char name[64]; + abi_int len; + union { + char str[TARGET_DISK_IDENT_SIZE]; + int64_t off; /* Want abioff, but this will do */ + abi_int i; + abi_short u16; + } value; +}; + +#define TARGET_DIOCGATTR TARGET_IOWR('d', 142, struct target_diocgattr_= arg) + +/* Unsupported, target_disk_zone_args is complicated */ +/* #define DIOCZONECMD _IOWR('d', 143, struct target_disk_zone_args) */ + +/* Enable/Disable the device for kernel core dumps. */ +/* #define DIOCSKERNELDUMP _IOW('d', 145, struct diocskerneldump_arg) */ +/* Get current kernel netdump configuration details for a given index. */ +/* #define DIOCGKERNELDUMP _IOWR('d', 146, struct diocskerneldump_arg) */ + +#endif /* OS_IOCTL_DISK_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121118; cv=none; d=zohomail.com; s=zohoarc; b=ieIeKFcnICQC3aDNBxPtsI4OIymE9qCEWAXl6Gy212apSatgFiHKqJPoHjIh44oja4R45aZNOYjPmgqVO0fFhYaUAfiBzY9DlChxLQHYUvuLFpq2geVnlkTv340WwU2Z2fNjjFAze5KTL2RVSv8zV5Kmg8qfb/on+sWj1dB0GIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121118; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D3u0FxYSV8ioorvbJiF5UQtlkvJS2lMH4tRonZlbtlE=; b=Ne+Xd/nlX9AVNGtHStFBVy6UFvQK4tkm7d3N0zKtsbU1/QhoeVW5hLzCsVrV9uvWEFA3UGsgY2GRBVoo1tK8f6nfXyh3RRBmr62T8upziv2O+QIrofmNsGFoRkHeUveMhgl4M8utSz1btNk2IOmhfuSMZwmqEoJAg+mPpUWqnh0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121118370218.3694270212536; Wed, 6 May 2026 19:31:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWO-0008AZ-P1; Wed, 06 May 2026 22:31:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVa-0007Tw-P6 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVX-0000XT-Qe for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:38 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-479ef2b78f3so247045b6e.2 for ; Wed, 06 May 2026 19:30:35 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121034; x=1778725834; darn=nongnu.org; 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=D3u0FxYSV8ioorvbJiF5UQtlkvJS2lMH4tRonZlbtlE=; b=sZYLcKgiNO6MRvdmb5R7TdAQjbHtt68xGi8SkHUn+RUE195voWuEFqPH9oFWEwXIa7 FCoLvXPpBe8I7O7b2DapiOEVi177QfS3egm7mD61Ra+wVbj2+dQOHDSiSxNQ8YkjfJ06 +Iiqfq60g7UZhN5fznMzAxTQSd88S6onubcXBsEj35oFNFXfB5cEQLoZkTh0wQm7bQib M4+Hd2yyGg7ej/BZb6rq8zDtqBvkOSe3U2fXIuF+e6Z3A/40+rfRTu1qFIzS2i7AfbcH ETu9qOlLQI6gJ/TyJZyQLmcHxPuh62vjIMZ9/e8mdCB96D5Hl4nhYotjLEqJlTY6M0S+ BKfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121034; x=1778725834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D3u0FxYSV8ioorvbJiF5UQtlkvJS2lMH4tRonZlbtlE=; b=Ux10m0Aqywxt70ZruaT4a9hdSm/yF6+mm87eY5GAXUhNRwjSNx+hbLjnUwfPRG9Hvh oRB0P8oAnK5G2sSd5bJQe3I1w6Owk4Fvz67w6nhxDzk4oOvPlpffaK7d6zuPOrELqqtW gPMMJdO1WXN9MPrgwfZK9CikVgEd1kPRtWDkGiRefh+At8grtMNVSrJJGwKyUYmR8TuO RBDuSlJ0IPvv6tssZXI7OqZs81SPHPm1a7VI8vQ7jfirusCHrkiAtXeaAg5U6/HvJl7B ik5xXbVbpXqGj3+7wL+okGhUHVzF0l9D38pnWzHLBSuk4O5BhjaZiehQzhqMKtBfcOOx oKrA== X-Gm-Message-State: AOJu0YxA6XG8f3+jc1Yg5PUCNdhv2/6WF1sGP5oCwk6wc9w9AvRIS/ql Ii63gw3JyTMzm/5E74sIoZ97UkTyXHQZEXCH7GG3EjeizCPzfndVLiIVrOUuVMf4FJjYNIaR19/ 2G6hBi1Y= X-Gm-Gg: AeBDievwLhLdLz7Vh24dKOrXzcac7PMXTCjWBkt68c96EogWK9tSez8Z3FVb9jn3vsS QdhcmJOSquFYoTH72RdLmkre6LefxmBlsaWh9qyrLg8p7vCspe7dcQLHwda7AgMMcI2n5TOuClC jq4bxvhMJxW9DTGRUtPZlpONcb3e1b8XX48ton70jehrInpFIqQGu4kuYo8OJB8V2ugCmY1RGSs cWa6frFazyo6i/l8z2IdArPYjjyoN6tbzFxdAf8YLkhOzjuXA5ou9vTaDTFaAhdlMhX+HDZiT3B qecHgGV/KgR+ttjWoYeKqCda+dUADzq+fc/uQYLh8zfbUz3WAwjceg2tU3Y3xBzx5kocpXTofIc AHWjw4rGm2f3cxPnjeFmdV4/ExmygOyVEuZgk4xeyZFANXCfBrqcxQoFUAB+NQY+15ZXJt2RJEM 2oHMfa1hmJVqtjsY0p2tVkOVPcq6e6CtM= X-Received: by 2002:a05:6808:3a17:b0:479:ead7:2a5a with SMTP id 5614622812f47-480420d7c0cmr4101733b6e.11.1778121033949; Wed, 06 May 2026 19:30:33 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 13/25] bsd-user: Add FreeBSD IPv6 ioctl definitions Date: Wed, 6 May 2026 20:28:15 -0600 Message-ID: <20260507022827.44499-14-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::22d; envelope-from=imp@bsdimp.com; helo=mail-oi1-x22d.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121119553154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-in6_var.h with IPv6 network interface ioctl definitions including SIOCAIFADDR_IN6, SIOCDIFADDR_IN6, and related IPv6 configuration ioctls with target_in6_* structure definitions. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-in6_var.h | 226 ++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-in6_var.h diff --git a/bsd-user/freebsd/os-ioctl-in6_var.h b/bsd-user/freebsd/os-ioct= l-in6_var.h new file mode 100644 index 0000000000..82f0514c7b --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-in6_var.h @@ -0,0 +1,226 @@ +/* + * FreeBSD in6 definitions for ioctl(2) emulation + * + * Copyright (c) 2014-2015 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef BSD_USER_FREEBSD_OS_IOCTL_IN6_VAR_H +#define BSD_USER_FREEBSD_OS_IOCTL_IN6_VAR_H + +#include "os-ioctl-sockio.h" + +/* + * see netinet6/in6_var.h + * and see netinet/in6.h + * XXX target_in6_addr and target_sockaddr_in6 should maybe go + * somewhere else. + */ +struct target_in6_addr { + union { + uint8_t __u6_addr8[16]; + uint16_t __u6_addr16[8]; + uint32_t __u6_addr32[4]; + } __u6_addr; +}; + +struct target_sockaddr_in6 { + uint8_t sin6_len; + uint8_t sin6_family; + uint16_t sin6_port; + uint32_t sin6_flowinfo; + struct target_in6_addr sin6_addr; + uint32_t sin6_scope_id; +}; + +struct target_in6_addrlifetime { + target_time_t ia6t_expire; + target_time_t ia6t_preferred; + u_int32_t ia6t_vltime; + u_int32_t ia6t_pltime; +}; + +struct target_in6_ifstat { + uint64_t ifs6_in_receive; + uint64_t ifs6_in_hdrerr; + uint64_t ifs6_in_toobig; + uint64_t ifs6_in_noroute; + uint64_t ifs6_in_addrerr; + uint64_t ifs6_in_protounknown; + + uint64_t ifs6_in_truncated; + uint64_t ifs6_in_discard; + + uint64_t ifs6_in_deliver; + + uint64_t ifs6_out_forward; + + uint64_t ifs6_out_request; + + uint64_t ifs6_out_discard; + uint64_t ifs6_out_fragok; + uint64_t ifs6_out_fragfail; + uint64_t ifs6_out_fragcreat; + + uint64_t ifs6_reass_reqd; + + uint64_t ifs6_reass_ok; + + uint64_t ifs6_reass_fail; + + uint64_t ifs6_in_mcast; + uint64_t ifs6_out_mcast; +}; + +struct target_icmp6_ifstat { + uint64_t ifs6_in_msg; + uint64_t ifs6_in_error; + uint64_t ifs6_in_dstunreach; + uint64_t ifs6_in_adminprohib; + uint64_t ifs6_in_timeexceed; + uint64_t ifs6_in_paramprob; + uint64_t ifs6_in_pkttoobig; + uint64_t ifs6_in_echo; + uint64_t ifs6_in_echoreply; + uint64_t ifs6_in_routersolicit; + uint64_t ifs6_in_routeradvert; + uint64_t ifs6_in_neighborsolicit; + uint64_t ifs6_in_neighboradvert; + uint64_t ifs6_in_redirect; + uint64_t ifs6_in_mldquery; + uint64_t ifs6_in_mldreport; + uint64_t ifs6_in_mlddone; + + uint64_t ifs6_out_msg; + uint64_t ifs6_out_error; + uint64_t ifs6_out_dstunreach; + uint64_t ifs6_out_adminprohib; + uint64_t ifs6_out_timeexceed; + uint64_t ifs6_out_paramprob; + uint64_t ifs6_out_pkttoobig; + uint64_t ifs6_out_echo; + uint64_t ifs6_out_echoreply; + uint64_t ifs6_out_routersolicit; + uint64_t ifs6_out_routeradvert; + uint64_t ifs6_out_neighborsolicit; + uint64_t ifs6_out_neighboradvert; + uint64_t ifs6_out_redirect; + uint64_t ifs6_out_mldquery; + uint64_t ifs6_out_mldreport; + uint64_t ifs6_out_mlddone; +}; + +struct target_in6_ifreq { + char ifr_name[TARGET_IFNAMSIZ]; + union { + struct target_sockaddr_in6 ifru_addr; + struct target_sockaddr_in6 ifru_dstaddr; + abi_int ifru_flags; + abi_int ifru_flags6; + abi_int ifru_metric; + abi_ulong ifru_data; + struct target_in6_addrlifetime ifru_lifetime; + struct target_in6_ifstat ifru_stat; + struct target_icmp6_ifstat ifru_icmp6stat; + u_int32_t ifru_scope_id[16]; + } ifr_ifru; +}; + +/* netinet6/nd6.h */ +struct target_nd_ifinfo { + uint32_t linkmtu; + uint32_t maxmtu; + uint32_t basereachable; + uint32_t reachable; + uint32_t retrans; + uint32_t flags; + int32_t recalctm; + uint8_t chlim; + uint8_t initialized; + uint8_t randomseed0[8]; + uint8_t randomseed1[8]; + uint8_t randomid[8]; +}; + +/* netinet6/nd6.h */ +struct target_in6_ndireq { + char ifname[TARGET_IFNAMSIZ]; + struct target_nd_ifinfo ndi; +}; + +struct target_in6_ndifreq { + char ifname[TARGET_IFNAMSIZ]; + abi_ulong ifindex; +}; + + +#define TARGET_SIOCGIFDSTADDR_IN6 TARGET_IOWR('i', 34, struct target_in6_i= freq) +#define TARGET_SIOCGIFNETMASK_IN6 TARGET_IOWR('i', 37, struct target_in6_i= freq) + +#define TARGET_SIOCDIFADDR_IN6 TARGET_IOW('i', 25, struct target_in6_ifreq) +#ifdef notyet +#define TARGET_OSIOCAIFADDR_IN6 TARGET_IOW('i', 26, struct target_oin6_ali= asreq) +#define TARGET_SIOCAIFADDR_IN6 TARGET_IOW('i', 27, struct target_in6_alias= req) + +#define TARGET_SIOCSIFPHYADDR_IN6 TARGET_IOW('i', 70, \ + struct target_in6_aliasreq) +#endif +#define TARGET_SIOCGIFPSRCADDR_IN6 TARGET_IOWR('i', 71, struct target_in6_= ifreq) +#define TARGET_SIOCGIFPDSTADDR_IN6 TARGET_IOWR('i', 72, struct target_in6_= ifreq) + +#define TARGET_SIOCGIFAFLAG_IN6 TARGET_IOWR('i', 73, struct target_in6_ifr= eq) + +#ifdef notyet +#define TARGET_SIOCGDRLST_IN6 TARGET_IOWR('i', 74, struct target_in6_drlis= t) +#endif + +#define TARGET_SIOCGIFINFO_IN6 TARGET_IOWR('i', 108, struct target_in6_ndi= req) +#define TARGET_SIOCSIFINFO_IN6 TARGET_IOWR('i', 109, struct target_in6_ndi= req) + +#define TARGET_SIOCSNDFLUSH_IN6 TARGET_IOWR('i', 77, struct target_in6_ifr= eq) +#ifdef notyet +#define TARGET_SIOCGNBRINFO_IN6 TARGET_IOWR('i', 78, struct target_in6_nbr= info) +#endif +#define TARGET_SIOCSPFXFLUSH_IN6 TARGET_IOWR('i', 79, struct target_in6_if= req) +#define TARGET_SIOCSRTRFLUSH_IN6 TARGET_IOWR('i', 80, struct target_in6_if= req) + +#define TARGET_SIOCGIFALIFETIME_IN6 TARGET_IOWR('i', 81, \ + struct target_in6_ifreq) +#define TARGET_SIOCGIFSTAT_IN6 TARGET_IOWR('i', 83, struct target_in6_ifre= q) +#define TARGET_SIOCGIFSTAT_ICMP6 TARGET_IOWR('i', 84, struct target_in6_if= req) + +#define TARGET_SIOCSDEFIFACE_IN6 TARGET_IOWR('i', 85, struct target_in6_nd= ifreq) +#define TARGET_SIOCGDEFIFACE_IN6 TARGET_IOWR('i', 86, struct target_in6_nd= ifreq) + +#define TARGET_SIOCSIFINFO_FLAGS TARGET_IOWR('i', 87, struct target_in6_nd= ireq) + +#define TARGET_SIOCSSCOPE6 TARGET_IOW('i', 88, struct target_in6_ifreq) +#define TARGET_SIOCGSCOPE6 TARGET_IOWR('i', 89, struct target_in6_ifreq) +#define TARGET_SIOCGSCOPE6DEF TARGET_IOWR('i', 90, struct target_in6_ifreq) + +#ifdef notyet +#define TARGET_SIOCSIFPREFIX_IN6 TARGET_IOW('i', 100, \ + struct target_in6_prefixreq) +#define TARGET_SIOCGIFPREFIX_IN6 TARGET_IOWR('i', 101, \ + struct target_in6_prefixreq) +#define TARGET_SIOCDIFPREFIX_IN6 TARGET_IOW('i', 102, \ + struct target_in6_prefixreq) +#define TARGET_SIOCAIFPREFIX_IN6 TARGET_IOW('i', 103, \ + struct target_in6_rrenumreq) +#define TARGET_SIOCCIFPREFIX_IN6 TARGET_IOW('i', 104, \ + struct target_in6_rrenumreq) +#define TARGET_SIOCSGIFPREFIX_IN6 TARGET_IOW('i', 105, \ + struct target_in6_rrenumreq) + +#define TARGET_SIOCGETSGCNT_IN6 TARGET_IOWR('u', 106, \ + struct target_sioc_sg_req6) +#define TARGET_SIOCGETMIFCNT_IN6 TARGET_IOWR('u', 107, \ + struct target_sioc_mif_req6) + +#define TARGET_SIOCAADDRCTL_POLICY TARGET_IOW('u', 108, \ + struct target_in6_addrpolicy) +#define TARGET_SIOCDADDRCTL_POLICY TARGET_IOW('u', 109, \ + struct target_in6_addrpolicy) +#endif + +#endif /* BSD_USER_FREEBSD_OS_IOCTL_IN6_VAR_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121155; cv=none; d=zohomail.com; s=zohoarc; b=iQKUjN0BC1TVTCEmcSLQWLKw1S8/WBm3zWiX5zd/ptuqVi1bpP2xJ+jXfwW3zqD+xc7HKoQdtz83DatImD7fGVLkaIpxDdbB6rPAq8mXlPT75I5f8STPhwssmAiiwfOZngCokFxx/ZnWNwyuyPqVxSxznQWSlspper1SDNXrWpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121155; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5XaSml2dtAsMaM0n+gsWmiN67y1iciKC5NnWPliXUBY=; b=Ye5yDbSDErS+EnVOQ74i4KGc5lVwhHN3AL7n0/KZOz2DSMNlnISQcEbf5I5uzpVCN4ZSO+LtRwKUeo3bHIGkFgDbcrVL7YAlNeGiug/ea1cD17oVr/mGv1xhm/vaMFGz+MeqGe6vqeZFdPP0MsAu0T4MUp9n3NszfgClmEsXn/0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121155110843.0557683008636; Wed, 6 May 2026 19:32:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWt-0001Zs-2s; Wed, 06 May 2026 22:31:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVa-0007Tv-NF for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0000Xp-0W for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:38 -0400 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-7dea20cf21aso354757a34.1 for ; Wed, 06 May 2026 19:30:36 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121035; x=1778725835; darn=nongnu.org; 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=5XaSml2dtAsMaM0n+gsWmiN67y1iciKC5NnWPliXUBY=; b=ylF7AvOKNgBqNVvMvh40UdTA/aHTylj3QIFioKLCK4UlxQj8hlbeF0IibqkFJBK4fP NYzpHckTHtbe+a5GI/IoqwXuHu797ZJjLxtpdlyo8qsa1GlelNgMXgLciS2qNNrpKgHV YxPVTzXjzSQh6ufWB4Xc8MHbIOPcC7smb/B0WK0IDFiwNmPAHVfZmIGQnQ7FqDgH8+kl eL/kxnjGwhAieC6OjFT5/8nuG7rFNdTBJCFbwCUhoQLyDBVPhhfeSdIiDs8ODG9jcjSo yXL4/6wsDpdqcgbQ+XB+jtv8g+J9a9mipzCar5jS68Cy/qL8TAXN1zlEpBpwQE1BsjNn muQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121035; x=1778725835; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5XaSml2dtAsMaM0n+gsWmiN67y1iciKC5NnWPliXUBY=; b=N0130v7wAeK7jPpB3lTvcS70tk95XTOLRuJ/4ud2dPns0k/QbK61+fPKKfKu93wTcn 6iTAtcSgZRbW4w95LLhPRkkwMqWh305V0+rKoqLYCSvG4rTNVSrtzqbQXuWgowE1m89U ZfUY9N8eOL5qV0PNiFmQoD5+xnqC541a6NlsfJ8zacMaadMA0dqdIzRj5Ku2BeGvGHdJ WFfR/O/j7JBULqXu3mEUTmJaXRwo/IuFpIBmLJPLalFIkRhKQdz90pnzLOuhyucBgTAw UreD4b6oN46w4IFKeJmom0Gbukc6DsIUqlLHnQ+KfnSYOsVCbN8VgMVdZzz9UOpoS54A a0Jg== X-Gm-Message-State: AOJu0YwYyHXLA0ydP3Aya6RzSw7iBjBV31t0I4vikSgM3vwJ8Qmg9pUQ 3/8jglOCLc1RftllSBToONbmwGQheYuPMlDvpF5vjNAjaGq6hMpweLA16jDDxMbx2U9+2bO31tp T7zYtT8M= X-Gm-Gg: AeBDievnQkj4dm4hLRQ0Mn8fLCubx6KInljlZab0DFqsAPT6DvA8A4tc8cCScp3f0s3 4vow7nWvwQ25qYy1Fipr5es8eqyCeFknmlhhno4f1tMpdsScmttBSNlXyLGH23akMpz6/JlB8pe ieWTUX7iXIeJPye9hHYAL86CiQ7b0Szb/iXnnaR5ErxEICLOi5lW3sxJggJAiXMDd8RZEXjzXg7 dkOQD8aLY+vzciCbFKLdyJGyvr3FCFtLHJUnIbjQTBr1MNQvvVDLPxDEgS9vrihhwyvecZEAqyB cHJ9ir7B/BXcYhldpjjK6M7WlGtt1GiSW6dJcSJv3jOKJJojsTmNwQT3bh6USZ8bsnBN4TV+N6i tkUwdpsbM3luQ+IhBtbO7f6gFiTY/A7QfViwpJVOJpJd77vp9SzjqcNIVLuswGDHn5VCeDZwK4l 3LrRKGhkWLZ3oagZcSVblCdv2shuhcsKw= X-Received: by 2002:a05:6830:608c:b0:7d7:fd71:f2e4 with SMTP id 46e09a7af769-7e1df0d2a5cmr3641414a34.14.1778121034935; Wed, 06 May 2026 19:30:34 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 14/25] bsd-user: Add FreeBSD ioctl type definitions Date: Wed, 6 May 2026 20:28:16 -0600 Message-ID: <20260507022827.44499-15-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::334; envelope-from=imp@bsdimp.com; helo=mail-ot1-x334.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, UPPERCASE_50_75=0.008 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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121156072154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-types.h with STRUCT macro definitions for ioctl type registration. This header uses multiple inclusion with different STRUCT macro definitions to generate both enums and type definitions. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-types.h | 109 ++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-types.h diff --git a/bsd-user/freebsd/os-ioctl-types.h b/bsd-user/freebsd/os-ioctl-= types.h new file mode 100644 index 0000000000..496d1e991b --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-types.h @@ -0,0 +1,109 @@ +/* + * FreeBSD file related system call shims and definitions + * + * Copyright (c) 2013-2015 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +STRUCT_SPECIAL(termios) + +STRUCT(winsize, + TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT) + +STRUCT(fiodgname_arg, + TYPE_INT, TYPE_PTRVOID) + +STRUCT(ifconf, + TYPE_INT, TYPE_PTRVOID) + +STRUCT(sockaddr, + TYPE_SHORT, MK_ARRAY(TYPE_CHAR, 14)) + +STRUCT(_ifreq_buffer, + TYPE_PTRVOID, TYPE_PTRVOID) + +STRUCT(ifreq_char, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_CHAR) + +STRUCT(ifreq_short, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), MK_ARRAY(TYPE_SHORT, 2)) + +STRUCT(ifreq_int, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT) + +STRUCT(ifreq_ptr, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_PTRVOID) + +STRUCT(ifreq_cap, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), MK_ARRAY(TYPE_INT, 2)) + +STRUCT(ifreq_sockaddr, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), MK_STRUCT(STRUCT_sockaddr)) + +STRUCT(ifreq_buf, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), MK_STRUCT(STRUCT__ifreq_buffer)) + +STRUCT(ifdrv, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_PTRVOID, TYPE_PTRVOID, + TYPE_PTRVOID) + +STRUCT(ifgroupreq_ptr, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT, TYPE_PTRVOID) + +STRUCT(ifmediareq, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT, TYPE_INT, TYPE_INT, + TYPE_INT, TYPE_INT, TYPE_PTRVOID) + +STRUCT(ifstat, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), + MK_ARRAY(TYPE_CHAR, TARGET_IFSTATMAX + 1)) + +STRUCT(ieee80211req, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_SHORT, TYPE_SHORT, TYPE_SHO= RT, + TYPE_PTRVOID) + +STRUCT(lagg_reqport_lacp_opreq, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), MK_ARRAY(TYPE_CHAR, TARGET_IFNAM= SIZ), + TYPE_INT, TYPE_INT, + /* struct lacp_opreq */ + TYPE_SHORT, MK_ARRAY(TYPE_CHAR, ETHER_ADDR_LEN), TYPE_SHORT, TYPE_SHOR= T, + TYPE_SHORT, TYPE_CHAR, TYPE_SHORT, MK_ARRAY(TYPE_CHAR, ETHER_ADDR_LEN), + TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_CHAR) + +STRUCT(lagg_reqall_lacp_opreq, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT, TYPE_PTRVOID, TYPE_PTR= VOID, + TYPE_INT, + /* struct lacp_opreq */ + TYPE_SHORT, MK_ARRAY(TYPE_CHAR, ETHER_ADDR_LEN), TYPE_SHORT, TYPE_SHOR= T, + TYPE_SHORT, TYPE_CHAR, TYPE_SHORT, MK_ARRAY(TYPE_CHAR, ETHER_ADDR_LEN), + TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_CHAR) + +STRUCT(lagg_reqflags, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT) + +STRUCT(lagg_reqopts, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT, TYPE_INT, TYPE_INT, + TYPE_INT, TYPE_INT, TYPE_INT) + +STRUCT(in6_ifreq_int, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_INT) + +STRUCT(in6_ifreq_ptr, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_PTRVOID) + +STRUCT(in6_ifreq_sockaddr_in6, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), + /* struct sockaddr_in6 */ + TYPE_CHAR, TYPE_CHAR, TYPE_SHORT, TYPE_INT, MK_ARRAY(TYPE_CHAR, 16), + TYPE_INT) + +STRUCT(in6_ndireq, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), + /* struct nd_ifinfo */ + TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, + TYPE_CHAR, TYPE_CHAR, MK_ARRAY(TYPE_CHAR, 8), MK_ARRAY(TYPE_CHAR, 8), + MK_ARRAY(TYPE_CHAR, 8)) + +STRUCT(in6_ndifreq, + MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), TYPE_PTRVOID) --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121161; cv=none; d=zohomail.com; s=zohoarc; b=mlMdwqw3mtY3BTgELRqG/p/i/DBQ+UGH2NvAWizQJsNIs3NJMESSEb9M4utCSCf9ewJw64q5/GQZStCb+h7Xqa75W1Ru2GOfWcmVEz3ZVp1xQwpPxbRr3vsRwig4Fecz7dOIy1ecOYTPABGpScFBf+GQLIszKtdAXynsxUDgSM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121161; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BYyYxQHuQ+EIvqcxSP+nEzWUdVWHC00GlU/UPZ5RCnw=; b=DoEhkF/ZIMEnjtF4Mz8GMcPxcjZuFzeJckPZpwnlLf8fDzw2tDG6k9xp1breA4ljvX/HwcKF1zUjiIxbEbNvgqsXZ/FYCzBRunn5btk/AlZ3lXpjuZOhw1XymPKtyNXKnEITtkiAnss6kWGbv7q5CsH05hL7o8JNG/ysuWbsjU4= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121161835234.4978263075991; Wed, 6 May 2026 19:32:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWO-00088H-DD; Wed, 06 May 2026 22:31:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVb-0007Ty-3k for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVZ-0000Y0-Dp for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:38 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-7dcdd1b492eso311507a34.1 for ; Wed, 06 May 2026 19:30:37 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121036; x=1778725836; darn=nongnu.org; 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=BYyYxQHuQ+EIvqcxSP+nEzWUdVWHC00GlU/UPZ5RCnw=; b=snU7xqMKzf41daK1neZQAJ2jqk93dW6BlTw7qrps5P0fvozARGt4a4r4cwn0J//QG8 i5yM70ol2nmFiRz6iGAXqn0b/KEKHul5P5e9JCSpmAtS1GQa1DIyOtCHK3Ci7qQlUipm amfRPMXsDrUkbQXk/qVDSW5TDhiFRiktWCpT0rvrnYAwzd1mLfAvyLUZL3Kmf2DcDM7Y EBoZSj+zWsafHAynIAF89rMxCo1LoYfmWo5vaerBANbA+2IfsO8RyYnp0uM4LqVoEGi/ 42vCXEgARn0jv1q30fXhQ/b3uLjliGalmMAEMnY9iDkGlmThaFD89gXqJOR0zpAbKsrQ tbJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121036; x=1778725836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BYyYxQHuQ+EIvqcxSP+nEzWUdVWHC00GlU/UPZ5RCnw=; b=eC8fFCKjWrxEr+5x04kZ35dBq7EkfwOHkHcybwo6eT7oUbKXNC4iFDrbMsV7QVGYN9 UqjQ1uJom2nZHjmLctG79GJPEo74OhAF1n7BAeVUnkvSbwuyYEuikrFZ2Z9cJYqEVS5X iBvCU3mBux8BLYyYh7K+ZP0BEMDuQnO+9oOq+kbP2koicgVIVZbxyKY5eznWyFHXgwvi yQU9v0lTrpcX+NJB2GLVdRm/KDPEjlvJpZRQXi46nNZVhk/+KM8G69UW0vn4/U+C6Vbb 2EvCZXKBPsFh9qaf79aMFO2J0h7pkl3BY9UfzXGr11K8Uq2fijFuwbXquR33QWZbCuMY LYXA== X-Gm-Message-State: AOJu0Ywj8FnmpmSaUfbh1Hl4z6DszYNHtnnZGuPIVsusWRTm6kXbgEb4 1dPzfVtElEgxx0JuayAyekQ399TMWm8/+hwAm8RA66W8nhviZD6fqbOIUMmJsEgG8eu/vDim2tP DvN8Xnl8= X-Gm-Gg: AeBDieu2bipQcWz+EbpnhZkMWqZBOE2CvCCdxMpCZ2apVbGbZEm+qgZBbEK3j7M2tAT pF7bXtWQ/owQKpQVDVWwXWJ0WrbA2Rl9WKK+0V/WsMViI14Yz1qb4dDF8lQ65QZyMGuVSpyT551 j1O9ligyYfuC2q7W5sJvasKxvzTjHKT5lFJRLGGLkm6FM+tjsK145CX6WHROp4UY8eB+le9qoxw qJdN58QtI9MYuvHgHI1tLgKnm7BvfrzjWe1k37gsfD2+DWX1G0x8NZrf798bGi/1pe8CiML4IRd M2M6jZfEfiLh+XfnvO++IJ+CEpTDZTIadVwEE3J8T0vZIKbYahp4Y3iQwNsu/1rUqF7GzI7qLGf cLPWa1jcNIWTp7sqPqO9hU1THq9WXyVdbB2dWQycGBgSAywBtuCgpXNehRsaAWKjg6DC1I37EUG VkaOF08ElwtTPQikAsd/QWwX8+tWqmZmg= X-Received: by 2002:a05:6830:6101:b0:7db:f286:18ee with SMTP id 46e09a7af769-7e1fcbf7eb0mr780701a34.4.1778121036173; Wed, 06 May 2026 19:30:36 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Alexander Kabaev , Pierrick Bouvier Subject: [PULL 15/25] bsd-user: Add FreeBSD ioctl command table Date: Wed, 6 May 2026 20:28:17 -0600 Message-ID: <20260507022827.44499-16-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::336; envelope-from=imp@bsdimp.com; helo=mail-ot1-x336.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, UPPERCASE_50_75=0.008 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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121163687158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add os-ioctl-cmds.h containing the complete ioctl command table mapping TARGET_* ioctl commands to their handlers. Uses IOCTL and IOCTL_SPECIAL macros for table generation. Signed-off-by: Stacey Son Signed-off-by: Alexander Kabaev Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-ioctl-cmds.h | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 bsd-user/freebsd/os-ioctl-cmds.h diff --git a/bsd-user/freebsd/os-ioctl-cmds.h b/bsd-user/freebsd/os-ioctl-c= mds.h new file mode 100644 index 0000000000..5f138fb3b0 --- /dev/null +++ b/bsd-user/freebsd/os-ioctl-cmds.h @@ -0,0 +1,149 @@ +/* + * FreeBSD file related system call shims and definitions + * + * Copyright (c) 2014 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +/* sys/ttycom.h tty(4) */ +IOCTL(TIOCSETD, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCGETD, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(TIOCSBRK, IOC_, TYPE_NULL) +IOCTL(TIOCCBRK, IOC_, TYPE_NULL) +IOCTL(TIOCSDTR, IOC_, TYPE_NULL) +IOCTL(TIOCCDTR, IOC_, TYPE_NULL) +IOCTL(TIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(TIOCSPGRP, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCGETA, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios))) +IOCTL(TIOCSETA, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios))) +IOCTL(TIOCSETAW, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios))) +IOCTL(TIOCSETAF, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios))) +IOCTL(TIOCPTMASTER, IOC_, TYPE_NULL) +IOCTL(TIOCOUTQ, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(TIOCSTI, IOC_W, MK_PTR(TYPE_CHAR)) +IOCTL(TIOCNOTTY, IOC_, TYPE_NULL) +IOCTL(TIOCSTOP, IOC_, TYPE_NULL) +IOCTL(TIOCSTART, IOC_, TYPE_NULL) +IOCTL(TIOCPKT, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCSCTTY, IOC_, TYPE_NULL) +IOCTL(TIOCDRAIN, IOC_, TYPE_NULL) +IOCTL(TIOCEXCL, IOC_, TYPE_NULL) +IOCTL(TIOCNXCL, IOC_, TYPE_NULL) +IOCTL(TIOCFLUSH, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCGWINSZ, IOC_R, MK_PTR(MK_STRUCT(STRUCT_winsize))) +IOCTL(TIOCSWINSZ, IOC_W, MK_PTR(MK_STRUCT(STRUCT_winsize))) +IOCTL(TIOCCONS, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCMSET, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCMGET, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(TIOCMBIS, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(TIOCMBIC, IOC_W, MK_PTR(TYPE_INT)) + +/* sys/filio.h */ +IOCTL(FIOCLEX, IOC_, TYPE_NULL) +IOCTL(FIONCLEX, IOC_, TYPE_NULL) +IOCTL(FIONREAD, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(FIONBIO, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(FIOASYNC, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(FIOSETOWN, IOC_W, MK_PTR(TYPE_INT)) +IOCTL(FIOGETOWN, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(FIODTYPE, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(FIOGETLBA, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(FIODGNAME, IOC_W, MK_PTR(MK_STRUCT(STRUCT_fiodgname_arg))) +IOCTL(FIONWRITE, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(FIONSPACE, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(FIOSEEKDATA, IOC_RW, MK_PTR(TYPE_ULONG)) +IOCTL(FIOSEEKHOLE, IOC_RW, MK_PTR(TYPE_ULONG)) + +/* crypto/cryptodev.h */ +IOCTL_SPECIAL(CIOCGSESSION, IOC_RW, do_ioctl_unsupported, TYPE_INT) + +/* netinet6/in6_var.h */ +IOCTL_SPECIAL(SIOCGIFAFLAG_IN6, IOC_RW, do_ioctl_in6_ifreq_sockaddr_int, + MK_PTR(MK_STRUCT(STRUCT_in6_ifreq_int))) +IOCTL_SPECIAL(SIOCGIFALIFETIME_IN6, IOC_RW, do_ioctl_in6_ifreq_sockaddr_in= t, + MK_PTR(MK_STRUCT(STRUCT_in6_ifreq_int))) +IOCTL(SIOCGIFPSRCADDR_IN6, IOC_RW, + MK_PTR(MK_STRUCT(STRUCT_in6_ifreq_sockaddr_in6))) +IOCTL(SIOCGIFINFO_IN6, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_in6_ndireq))) +IOCTL(SIOCGDEFIFACE_IN6, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_in6_ndifre= q))) + +/* sys/disk.h */ +IOCTL(DIOCGSECTORSIZE, IOC_R, MK_PTR(TYPE_INT)) +IOCTL(DIOCGMEDIASIZE, IOC_R, MK_PTR(TYPE_LONGLONG)) + +/* sys/sockio.h */ +IOCTL_SPECIAL(SIOCGIFMAC, IOC_RW, do_ioctl_unsupported, + MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) + +IOCTL(SIOCGIFCONF, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_ifconf))) + +IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_short))) +IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_short))) + +IOCTL(SIOCGIFMETRIC, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +IOCTL(SIOCSIFMETRIC, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +IOCTL(SIOCGIFMTU, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +IOCTL(SIOCSIFMTU, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +IOCTL(SIOCGIFFIB, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +#ifdef SIOCGTUNFIB +IOCTL(SIOCGTUNFIB, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_int))) +#endif + +IOCTL(SIOCGIFCAP, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_cap))) + +IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCSIFADDR, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCGIFBRDADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockadd= r))) +IOCTL(SIOCSIFBRDADDR, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCGIFDSTADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockadd= r))) +IOCTL(SIOCSIFDSTADDR, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCGIFNETMASK, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockadd= r))) +IOCTL(SIOCSIFNETMASK, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) +IOCTL(SIOCGIFPSRCADDR, IOC_W | IOC_R, + MK_PTR(MK_STRUCT(STRUCT_ifreq_sockaddr))) + +IOCTL(SIOCGIFGENERIC, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_ptr))) + +IOCTL(SIOCGIFDESCR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_buf))) + +IOCTL(SIOCGDRVSPEC, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifdrv))) + +IOCTL(SIOCGIFGROUP, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifgroupreq_ptr)= )) + +IOCTL(SIOCGIFMEDIA, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifmediareq))) +#ifdef SIOCGIFXMEDIA +IOCTL(SIOCGIFXMEDIA, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifmediareq))) +#endif + +IOCTL(SIOCGIFSTATUS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifstat))) + +/* net/if_gre.h */ +IOCTL(GREGKEY, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_ptr))) +#ifdef GREGOPTS +IOCTL(GREGOPTS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_ptr))) +#endif + +/* net/if_gif.h */ +IOCTL(GIFGOPTS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_ptr))) + +/* net/if_pfsync.h */ +#ifdef SIOCGETPFSYNC +IOCTL(SIOCGETPFSYNC, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ifreq_ptr))) +#endif + +/* net80211/ieee80211_ioctl.h */ +IOCTL(SIOCG80211, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_ieee80211req))) + +/* net/if_lagg.h */ +IOCTL(SIOCGLAGGPORT, IOC_W | IOC_R, + MK_PTR(MK_STRUCT(STRUCT_lagg_reqport_lacp_opreq))) +IOCTL(SIOCGLAGG, IOC_W | IOC_R, + MK_PTR(MK_STRUCT(STRUCT_lagg_reqall_lacp_opreq))) +IOCTL(SIOCGLAGGFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_lagg_reqflags= ))) +#ifdef SIOCGLAGGOPTS +IOCTL(SIOCGLAGGOPTS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_lagg_reqopts))) +#endif --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121093; cv=none; d=zohomail.com; s=zohoarc; b=JY65twBitfOG/97WaPv5TmmFs0uWKJ1epysj9VGkwbY/uFo1O/cUEZkKeR0jNWABNKnbP1oYoJdv0n1FdnybXA4J9OJtAQO8+YA+toaQtNG38xzE5ScIRk9E+BaAHlYI4cVFnUEGza6jprPZlQFtdJgCk1jGelgFt0beNcY8na8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121093; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fjLAaxyHsT0TSUBZY3ZQm0quejVhCnFXvIzmgKnvhDc=; b=krVC2TRh4QuUf/bixUxkNGGOX6zHpnJDCAzyx/6XoM7B5L4xstucLuTqA3XQh2K5LyF4UnJRC2Fe0sgMrPVbhP45UPIm1pOX/c+/94cZIsgVvuzUl5vfOXOwatQXr6TC+tqcRgVe37MOezHbAum80KJ8ZMF49n/9sOGtZeALl0s= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121093582187.62301230831986; Wed, 6 May 2026 19:31:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoVz-0007ac-M1; Wed, 06 May 2026 22:31:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVc-0007U2-3w for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:42 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVa-0000Ya-OD for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:39 -0400 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-7dea1272943so232403a34.0 for ; Wed, 06 May 2026 19:30:38 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121037; x=1778725837; darn=nongnu.org; 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=fjLAaxyHsT0TSUBZY3ZQm0quejVhCnFXvIzmgKnvhDc=; b=iXl7gwjp6wbd/ou9MtU3uV7RYh9gDfu7Ke7UeugRx3TW/XahsPDyC0JlHGpsfhkBJb hX0JRv3XWkZnxkQpWYFvvuQh4Hn6PzQUWh0NPKm4G1dG0RgcS1odgnkz9tdkBPWOW0S/ WbJoYkF6rvBJf5kBHu5fywSBkPG67j1mXBGLiwbAN/IC0HK9wiMVSFBvEgsdOv9VMAGg BuaMuTwTA7ukmAaVkSaeUgG2wECNr+yERrXhlIy4Lbo46dvmQWVEa9OfhfEmYr5+R19U RY+TqnTu0aVPtWA+Dtk+dBNM5pqRivf6HE7pR2hrb4Ri9rMS+nYps4uAr1ZoXly4Aj/D AH3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121037; x=1778725837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fjLAaxyHsT0TSUBZY3ZQm0quejVhCnFXvIzmgKnvhDc=; b=TZdRv2lyb01qLj/wtdB85npTQhFSVsOwKQMzqW/Jxz3IGqXcids8Rrzg6wYS/0IN+1 qCGbZM5R8VRKbaMpPwy0qLHkYRbH5S4Q9x7TDEMDCZLcLLxdYNWSNI8cDkRoIvcgxSlx 4yNYDtI72j950GTXtKFcjW8j/USbO8YRwT1APNbQVcO03xcZMiLA+nMntoz6eo7LVBVN T34vRwAAtrcDBHz4swm4BWWavNzlbE4cGow6v43BtxHkSR/d3tuyhGkw6FgEzz1qsZQD EfEV/NJkGaYuOEJCmOkRoQtzu/PF+mFdsiOATLdim6UOduS+h1Jzhb1zuGR8Utnl8k8u o79g== X-Gm-Message-State: AOJu0YwwwaP4OWExDY6+QCMskb4C86ahUKqwA+JDxHSsNsxk5V/UGqPQ zQ9GLJl8DqMr12EEOc4+PTP3YN3w/VzDVsIsqchl+2RJnzkc0VVuTN9M/PYWVwtfCQ5M7bq/Fjp ZPCRYkvU= X-Gm-Gg: AeBDieu558F/cigwAQAcxwp7eXKVFtcIm4ttKe1odOaCLI+r/bRN8PAMnbpZyq3L4aO tc4u9ScZLStIKk2TTeflbobc9Y9B7vf+gFaae7BpdKKPvFHneNcuOL2tMFj1NOISL+exBS9HqKQ VSlpCQVQ4+UlRQLRlng/IJ47dEHucKb6uPhUt6ZbEwhIGAaNXgdarrrlO6JSQHs7ELMpBbTEdvB mTQyII91IMpapjl/gNmJsXn5WVxYt4pLcz+6y1r3Bb+tN6jNltOwtFAYTHAW8qZC62enU+OfRG2 5i2znQRArAerlcV/RvYlPD1r5X8+thwblhCWZeRJuQ4CEsVp+RprdO/HLgv6WPS8LegzMEmAGLR ypch4QFlYdthaX9tUH21XbvBdH7JtDZG7TFDH+IFDbD/E2HSYkQlFS/FtDmwt10bIi2WTar/M8d QP3ok5QNFYODF3hf4Je4YA X-Received: by 2002:a05:6830:488e:b0:7dc:e336:c828 with SMTP id 46e09a7af769-7e1deea5b89mr3935049a34.10.1778121037432; Wed, 06 May 2026 19:30:37 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 16/25] bsd-user: Add bsd-ioctl.h header Date: Wed, 6 May 2026 20:28:18 -0600 Message-ID: <20260507022827.44499-17-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::333; envelope-from=imp@bsdimp.com; helo=mail-ot1-x333.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121095164154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add bsd-ioctl.h header declaring the public ioctl emulation API: do_bsd_ioctl() for processing ioctl system calls and init_bsd_ioctl() for initialization. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bsd-user/bsd-ioctl.h diff --git a/bsd-user/bsd-ioctl.h b/bsd-user/bsd-ioctl.h new file mode 100644 index 0000000000..bf9bb72bc9 --- /dev/null +++ b/bsd-user/bsd-ioctl.h @@ -0,0 +1,14 @@ +/* + * ioctl system call definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef BSD_IOCTL_H +#define BSD_IOCTL_H + +abi_long do_bsd_ioctl(int fd, abi_long cmd, abi_long arg); +void init_bsd_ioctl(void); + +#endif /* BSD_IOCTL_H */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121148; cv=none; d=zohomail.com; s=zohoarc; b=Lmvaux0XAXbbwovVDjtLY6FBuCsbVUWXIf4IVswYCglfPVWP4nEvAfdqbiv0OckfmsWXrw6e6p5XhvSCkswPT4txHNdgxamVBORYzblNcCPWYUlgAT+rZnovhvq0P38fqM2UNvYlIp8Z3dMdYekj/MClECw1TaQ4J/GSZgdTOG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121148; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4gIyjcjDwEGY+mpVVIiM9bd7yEozKdmCDd7sqT0gqEs=; b=EceI/0DevksWo5DrQLZSSp0LgKujnSYgC1ly1k/ey4MGkhXU0DMk+tIkDgHLqu4wCDqw4+F7yhxIYnhbCjf008tPj1uXvF2jfR6ZXXlFF4+4ag+vVTrzwozZmgKRNRDE//SmjhxVTlZp8j64+eFYwv1RG0QTrFd3YOmctTbD3SU= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121148276778.659329571841; Wed, 6 May 2026 19:32:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWc-00009q-TY; Wed, 06 May 2026 22:31:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVe-0007UH-6e for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:43 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVc-0000Yv-0Y for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:41 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7dea20cf21aso354782a34.1 for ; Wed, 06 May 2026 19:30:39 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121038; x=1778725838; darn=nongnu.org; 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=4gIyjcjDwEGY+mpVVIiM9bd7yEozKdmCDd7sqT0gqEs=; b=DfpKVel8bbaJOBBXWC5qPknw23BI71SN+LIHKXoXhfHqg21PXv1sZTuf5vW719mPz+ ZkiclCAD3MYFk23+NedJQXtju4+gE0Ki4ylS0V1+32XjeUVDccKkecJwzGypFC0VsprV nruqW+vEH9ElDt4y1n88J45a6sMgNE+Ygz7E5iV2/SJFO8OxOwYWNEU3kbRhB7uK61qd iKNJkKRZrPokU803+IlqRo9JE7dfbnuDlTbICf+0+X5vtA1443Qr+qi6D2mUFBxyVJ7z zOXRdHdBsi7Fdw5CMBaHVuXM/AN4rdRNlnazwvO4LkPmmZdMwPaNAQXRy3VaE9X1/HCF 9LaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121038; x=1778725838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4gIyjcjDwEGY+mpVVIiM9bd7yEozKdmCDd7sqT0gqEs=; b=FXWdWWmWwd21Cu7kty4mWHurDNUWxtfRPOxyUKmi7nY/e16GtkUF6wzHda8YHCfspe nvzm+Vk/jwvVlg2l0lMxkhqrzym+zVG7rtCbULCmvQ0hf0WHSgp+pk/VtLb39zCyhKMV bWr+NlugEXrwmsamWkwIUGCXyzSqysIsljOdB9T7EcS84MNE8sFHk8e56Al0f1wv2qsv Tq7uY5kk4bs3IB/hb2hn1S4abMSOQYUfIt4iooFCTxsdRZFsUsDYCMl8/mD6naVVpWGc E6SxgIqs/AlEhx8NklFxpf9WHC8OP6BI10AplJtM0wWzD3Lv0N3r20dgfHP0X+QMj9jf k2cw== X-Gm-Message-State: AOJu0Yy7+ZTfYkzbarPe6SJge6rLRferFlnFKQWl+R7ZOmd4zQtj2ikI BccWtsUGzucU7562ZOfEWfMVN2GncYWXLAaJ0I2ZhPsS6ozWhP/BqEo79oraG6fgflaX4XBcK5A TgegKvOg= X-Gm-Gg: AeBDies+yJyYU9rDWoMpmvlD2LkI03HKC3GmqsTiRQ25oTOwKa8lpaVpJ9XK++LxUOW iscznWqQHrFH1fYuMMmwd9jRGVhjeyTjcmWQK8da7O+awBFgfeu593vOYk6KLNNL9VFxmr1zd9z 4YyhWDWi+so88CYGx9ledHBlqIS/rHmSse0sW5g9AZXScPreu6dsLAPMgf6Um2dXZXpUdgM9I3L oHPkOhoE3e5a7LiEa1rRIlsBgoMhUhDjWnXn/jaulrUTT7c2mweCQMuvoki9SqX8RNkQuqiPOHJ BwL+ZOkLXGKL51lysX0rQVffsYvbFo/gQDD/YwPgIVtWlO8zwIRaY1+0qh/PcuonoBFs3+D8MtN 0MeyNJu11ErXCs9v/opWq/DNnY9AYams9Nn8RlMukygLjl5jZsvHJFNZ2hLu09kab3QYfRSd2jR GkpVZYsywQKGMUkb9tG+cZ X-Received: by 2002:a05:6830:378e:b0:7dc:cbaa:d730 with SMTP id 46e09a7af769-7e1def3deabmr3727687a34.8.1778121038660; Wed, 06 May 2026 19:30:38 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 17/25] bsd-user: Add target_sockaddr and safe_ioctl to syscall_defs.h Date: Wed, 6 May 2026 20:28:19 -0600 Message-ID: <20260507022827.44499-18-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32b; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32b.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121149545158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add struct target_sockaddr and target_in_addr definitions for socket address handling and safe_ioctl macro for safe ioctl system calls. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 81f567cb33..0612be8bbb 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -537,6 +537,20 @@ type safe_##name(type1 arg1, type2 arg2, type3 arg3, t= ype4 arg4, \ return safe_syscall(SYS_##name, arg1, arg2, arg3, arg4, arg5, arg6); \ } =20 +/* + * sys/socket.h + */ +struct target_sockaddr { + uint8_t sa_len; + uint8_t sa_family; + uint8_t sa_data[14]; +} QEMU_PACKED; + +struct target_in_addr { + uint32_t s_addr; /* big endian */ +}; + +#define safe_ioctl(...) safe_syscall(SYS_ioctl, __VA_ARGS__) #define safe_fcntl(...) safe_syscall(SYS_fcntl, __VA_ARGS__) =20 /* So far all target and host bitmasks are the same */ --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121136; cv=none; d=zohomail.com; s=zohoarc; b=JTgeAUizZTBVxvyLRv32iNy4P/J0BJjj9WfDtyYL5ryz4LjrDBxF8yYTpLMyFn5OjkrVW98VW5fD7Ax3FInhsSDL9UpxudbKHscl4mF0n5j53pJfbn+cnmydXX0PXeq/kWfj4Px7gf+445tiawt4DMrhK3uiOVgxsX/C7kOoyo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121136; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aDLgHPbMW3HTfiXvqW+3o1mH9wo3oWIvOAWn56wDd8c=; b=P/BIn3QV7EnG+APTjGTcUDHg/vjFhA87ccZeCtZiTQVzgeD/auw+NUKjsrDVAZKqGcFA1sDPBT2DgZpcl77zcq7ArXvm0qsnSDnt1OST3tf/BwM8TmXmd7rDSbOlApQerYEoh5dmv6yFudSLNFu1gj0wFLiHBlcHxJCFHikk/eE= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121136574672.9390201226238; Wed, 6 May 2026 19:32:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWa-0008SW-6P; Wed, 06 May 2026 22:31:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVg-0007Vt-6V for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:46 -0400 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVd-0000Z6-VT for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:43 -0400 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7dcd9061b1aso316584a34.2 for ; Wed, 06 May 2026 19:30:40 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121040; x=1778725840; darn=nongnu.org; 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=aDLgHPbMW3HTfiXvqW+3o1mH9wo3oWIvOAWn56wDd8c=; b=mhwc9GRzQlVkoGpDlFmplVCtf1AaeQ65nkMkDM59JGDtpqf5ezak0Fr5yWe5p3hNha AXyj5N1DNGOrWZHU6xPyA+eaGaJNg+L86q2u2DsT+9f7aSDcMElTb9P9XdhAHLSOHKtN m8ICzDuR0yoxh1BElZENwHGN3YwQ6TW0YE6eXmo4ZzuIoPl9gpCKe4KwVy716gTciqV2 Gq1e3uLNZPFT/BpDLzRXg7thNu8ZPb6T9vy0T9q/L5DjXzNabOIozOQ7j+KAzDNHDDUY Tn4HzhYZBc/rTWA7dSzmY/L/A/QkSE90f0Ql0DMFItHzGcazTTnoKtGh3WrfCNl1LTjT RZPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121040; x=1778725840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aDLgHPbMW3HTfiXvqW+3o1mH9wo3oWIvOAWn56wDd8c=; b=Yp1Wp68YuZjCdGScogkSPMN2U88FCczqAED/v7cls3R2nqeceobe7CGjgHTVBwmCxC WrCRXVemaqF1HF0fIMEn0mv7iA3N6gZO16+y1K2UBAff0Kr+1O/sSBEvzOAJ2ZnwPMMB 9DLdf7+EuCrOKqXwIbSMCoWf3u8Cc+ijkF9SYWVSb9DcIHzkkZU1HyAXT7gvfoU1iVqX 3YWRr+Wc7cM5+Zn6R7PxaywtsDYSdEa3TM+Pn0dUPEBLd08VIS4Q5aMuBRNT2NY5DKUZ Ota2RfKxzWa6LKfM1KC/jqQNLjAmt2PcTpJMXhNhUiK2veHB2IG/hiOImg8m7+Lp1OnX i3SQ== X-Gm-Message-State: AOJu0YxNKD/4HMiWfbImdH5xrdTsdQyYBkyZT5sZqswnEQ40ikh/zCA8 h9Q/aRBXH1neuInuH2VmFHPS2C1diAxGFIjfMRYggEDi7VRRe6Amj8AfjaL8H0V/ogSBxU+fVly QxU0tvAc= X-Gm-Gg: AeBDies+6h4n1G71QINynaMmQi1WvyGG7nlAaxcIH9IsdN5Kb7xHbBHVrsJH2DVqsqq 3P3Mp0gBpASDKyXSi+ZqT/ptv0SKnED8SjVtmnXBYwgyyx7/z6LDSENRpkx55pmuugi5Qe7+iP/ FU/wWdLYE0mjg+BTmLrNQ5hhU5x1U2SbyY8PIzxHkakoG/TYcZSRsgM93HFwZpnZvYcyQqlxtRB g2JjIs0Dck1X2SaZqhObVSmgGe1/15+SMkTwRSRa7RU7+J7VUWu+5TdQolKzuLX6wvewDtTU0bQ x0DNJ7WGSVfJjlLfnoLXruGlBJuQK4cG72B2330ov0AfdeWe/9vEZMSuN5PDJFs+m3QXUYP+OI6 bvif2tCot17mtSUOmunifM6uL/o3DLbfnKrShkBMFhYoWlSjQUKtf7dys0z2h+TMO0KHpT4DP8J DD2FpmqWZ8FsX+Q6pZEcvNQWlxOLXvr5M= X-Received: by 2002:a05:6830:6588:b0:7d7:e3b9:58d6 with SMTP id 46e09a7af769-7e1df1ba521mr3272505a34.22.1778121039727; Wed, 06 May 2026 19:30:39 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Sean Bruno , Kyle Evans , Pierrick Bouvier Subject: [PULL 18/25] bsd-user: Add bsd-ioctl.c infrastructure and termios conversion Date: Wed, 6 May 2026 20:28:20 -0600 Message-ID: <20260507022827.44499-19-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::331; envelope-from=imp@bsdimp.com; helo=mail-ot1-x331.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121137685158500 From: Stacey Son Add initial bsd-ioctl.c file with termios conversion functions, structure type definitions, and ioctl table infrastructure. Includes target_to_host_termios and host_to_target_termios for terminal I/O control conversion, along with the ioctl dispatch table framework. Style complains about STRUCT and STRUCT_SPECIAL defines: =E2=97=8F checkpatch.pl: 197: ERROR: Macros with complex values should be= enclosed in parenthesis =E2=97=8F checkpatch.pl: 198: ERROR: Macros with complex values should be= enclosed in parenthesis but that's fine. We are doing weird things with macros, and it's fine. We can't put parens or do while (0) around these since they are table building macros for files that are included multiple times. Signed-off-by: Stacey Son Signed-off-by: Sean Bruno Signed-off-by: Kyle Evans Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 219 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 bsd-user/bsd-ioctl.c diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c new file mode 100644 index 0000000000..94110d4ad5 --- /dev/null +++ b/bsd-user/bsd-ioctl.c @@ -0,0 +1,219 @@ +/* + * BSD ioctl(2) emulation + * + * Copyright (c) 2013-2015 Stacey D. Son + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "qemu/osdep.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "qemu.h" + +#include "syscall_defs.h" +#include "bsd-ioctl.h" +#include "os-ioctl-cryptodev.h" +#include "os-ioctl-filio.h" +#include "os-ioctl-in6_var.h" +#include "os-ioctl-sockio.h" +#include "os-ioctl-ttycom.h" +#include "os-ioctl-disk.h" + +static void target_to_host_termios(void *dst, const void *src) +{ + struct termios *host =3D dst; + const struct target_termios *target =3D src; + + host->c_iflag =3D target_to_host_bitmask(tswap32(target->c_iflag), ifl= ag_tbl); + host->c_oflag =3D target_to_host_bitmask(tswap32(target->c_oflag), ofl= ag_tbl); + host->c_cflag =3D target_to_host_bitmask(tswap32(target->c_cflag), cfl= ag_tbl); + host->c_lflag =3D target_to_host_bitmask(tswap32(target->c_lflag), lfl= ag_tbl); + + memset(host->c_cc, 0, sizeof(host->c_cc)); + host->c_cc[VEOF] =3D target->c_cc[TARGET_VEOF]; + host->c_cc[VEOL] =3D target->c_cc[TARGET_VEOL]; +#ifdef VEOL2 + host->c_cc[VEOL2] =3D target->c_cc[TARGET_VEOL2]; +#endif + host->c_cc[VERASE] =3D target->c_cc[TARGET_VERASE]; +#ifdef VWERASE + host->c_cc[VWERASE] =3D target->c_cc[TARGET_VWERASE]; +#endif + host->c_cc[VKILL] =3D target->c_cc[TARGET_VKILL]; +#ifdef VREPRINT + host->c_cc[VREPRINT] =3D target->c_cc[TARGET_VREPRINT]; +#endif +#ifdef VERASE2 + host->c_cc[VERASE2] =3D target->c_cc[TARGET_VERASE2]; +#endif + host->c_cc[VINTR] =3D target->c_cc[TARGET_VINTR]; + host->c_cc[VQUIT] =3D target->c_cc[TARGET_VQUIT]; + host->c_cc[VSUSP] =3D target->c_cc[TARGET_VSUSP]; +#ifdef VDSUSP + host->c_cc[VDSUSP] =3D target->c_cc[TARGET_VDSUSP]; +#endif + host->c_cc[VSTART] =3D target->c_cc[TARGET_VSTART]; + host->c_cc[VSTOP] =3D target->c_cc[TARGET_VSTOP]; +#ifdef VLNEXT + host->c_cc[VLNEXT] =3D target->c_cc[TARGET_VLNEXT]; +#endif +#ifdef VDISCARD + host->c_cc[VDISCARD] =3D target->c_cc[TARGET_VDISCARD]; +#endif + host->c_cc[VMIN] =3D target->c_cc[TARGET_VMIN]; + host->c_cc[VTIME] =3D target->c_cc[TARGET_VTIME]; +#ifdef VSTATUS + host->c_cc[VSTATUS] =3D target->c_cc[TARGET_VSTATUS]; +#endif + + host->c_ispeed =3D tswap32(target->c_ispeed); + host->c_ospeed =3D tswap32(target->c_ospeed); +} + +static void host_to_target_termios(void *dst, const void *src) +{ + struct target_termios *target =3D dst; + const struct termios *host =3D src; + + target->c_iflag =3D tswap32(host_to_target_bitmask(host->c_iflag, ifla= g_tbl)); + target->c_oflag =3D tswap32(host_to_target_bitmask(host->c_oflag, ofla= g_tbl)); + target->c_cflag =3D tswap32(host_to_target_bitmask(host->c_cflag, cfla= g_tbl)); + target->c_lflag =3D tswap32(host_to_target_bitmask(host->c_lflag, lfla= g_tbl)); + + memset(target->c_cc, 0, sizeof(target->c_cc)); + target->c_cc[TARGET_VEOF] =3D host->c_cc[VEOF]; + target->c_cc[TARGET_VEOL] =3D host->c_cc[VEOL]; +#ifdef VEOL2 + target->c_cc[TARGET_VEOL2] =3D host->c_cc[VEOL2]; +#endif + target->c_cc[TARGET_VERASE] =3D host->c_cc[VERASE]; +#ifdef VWERASE + target->c_cc[TARGET_VWERASE] =3D host->c_cc[VWERASE]; +#endif + target->c_cc[TARGET_VKILL] =3D host->c_cc[VKILL]; +#ifdef VREPRINT + target->c_cc[TARGET_VREPRINT] =3D host->c_cc[VREPRINT]; +#endif +#ifdef VERASE2 + target->c_cc[TARGET_VERASE2] =3D host->c_cc[VERASE2]; +#endif + target->c_cc[TARGET_VINTR] =3D host->c_cc[VINTR]; + target->c_cc[TARGET_VQUIT] =3D host->c_cc[VQUIT]; + target->c_cc[TARGET_VSUSP] =3D host->c_cc[VSUSP]; +#ifdef VDSUSP + target->c_cc[TARGET_VDSUSP] =3D host->c_cc[VDSUSP]; +#endif + target->c_cc[TARGET_VSTART] =3D host->c_cc[VSTART]; + target->c_cc[TARGET_VSTOP] =3D host->c_cc[VSTOP]; +#ifdef VLNEXT + target->c_cc[TARGET_VLNEXT] =3D host->c_cc[VLNEXT]; +#endif +#ifdef VDISCARD + target->c_cc[TARGET_VDISCARD] =3D host->c_cc[VDISCARD]; +#endif + target->c_cc[TARGET_VMIN] =3D host->c_cc[VMIN]; + target->c_cc[TARGET_VTIME] =3D host->c_cc[VTIME]; +#ifdef VSTATUS + target->c_cc[TARGET_VSTATUS] =3D host->c_cc[VSTATUS]; +#endif + + target->c_ispeed =3D tswap32(host->c_ispeed); + target->c_ospeed =3D tswap32(host->c_ospeed); +} + +static const StructEntry struct_termios_def =3D { + .convert =3D { host_to_target_termios, target_to_host_termios }, + .size =3D { sizeof(struct target_termios), sizeof(struct termios) }, + .align =3D { __alignof__(struct target_termios), + __alignof__(struct termios) }, +}; + +/* ioctl structure type definitions */ +#define STRUCT(name, ...) STRUCT_ ## name, +#define STRUCT_SPECIAL(name) STRUCT_ ## name, +enum { +#include "os-ioctl-types.h" +STRUCT_MAX +}; +#undef STRUCT +#undef STRUCT_SPECIAL + +#define STRUCT(name, ...) \ + static const argtype struct_ ## name ## _def[] =3D { __VA_ARGS__, TYPE= _NULL }; +#define STRUCT_SPECIAL(name) +#include "os-ioctl-types.h" +#undef STRUCT +#undef STRUCT_SPECIAL + + +struct IOCTLEntry; + +typedef abi_long do_ioctl_fn(const struct IOCTLEntry *ie, uint8_t *buf_tem= p, + int fd, abi_long cmd, abi_long arg); + +struct IOCTLEntry { + unsigned int target_cmd; + unsigned int host_cmd; + const char *name; + int access; + do_ioctl_fn *do_ioctl; + const argtype arg_type[5]; +}; +typedef struct IOCTLEntry IOCTLEntry; + +#define MAX_STRUCT_SIZE 4096 + +static abi_long do_ioctl_unsupported(__unused const IOCTLEntry *ie, + __unused uint8_t *buf_temp, + __unused int fd, __unused abi_long cm= d, + __unused abi_long arg); + +static abi_long do_ioctl_in6_ifreq_sockaddr_int(const IOCTLEntry *ie, + uint8_t *buf_temp, int fd, abi_long cmd, abi_long arg); + +static IOCTLEntry ioctl_entries[] =3D { +#define IOC_ 0x0000 +#define IOC_R 0x0001 +#define IOC_W 0x0002 +#define IOC_RW (IOC_R | IOC_W) +#define IOCTL(cmd, access, ...) \ + { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } }, +#define IOCTL_SPECIAL(cmd, access, dofn, ...) \ + { TARGET_ ## cmd, cmd, #cmd, access, dofn, { __VA_ARGS__ } }, +#define IOCTL_SPECIAL_UNIMPL(cmd, access, dofn, ...) \ + { TARGET_ ## cmd, 0, #cmd, access, dofn, { __VA_ARGS__ } }, +#include "os-ioctl-cmds.h" + { 0, 0 }, +}; --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121165; cv=none; d=zohomail.com; s=zohoarc; b=AZ5PIv9K1SJSLeEv6vzEKE3kTcTd1FTwV8HN7wTZjiHze648QI5rVBmBkrGpE9lxqLCexCter7LNwOT0LDwYkvpM7xPL3NALvPxuHxt848yq9ZPK54BcCn9wONT9010Dar/Kl8u6erwpRxWe46fJkTIEpFmGuYP1uCV55HryIB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121165; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WC0vAoB2JrxhCnH6uJJk5wBT6sf05K3174sq655JkzM=; b=YfBJmIV3saRPPHDKo2NiVN+ecalrqr3a/Jd8CZ7FLSgKWnqbFNhnLQdrXM25OZVrxTUjYORudiC+Qj3YvgAbeLG0Nrm6SS0Zs+9116MtF1Sz4mvwI7cW1N8HMdbkyNW6VlrovnyrA/ArMs/U1gtwfBOLCuHYVugTIrUh4ZRp3QI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121165768388.7729667417052; Wed, 6 May 2026 19:32:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWa-000054-He; Wed, 06 May 2026 22:31:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVl-0007Wg-PG for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:54 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVf-0000ZE-TC for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:46 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7d4be94eeacso417700a34.2 for ; Wed, 06 May 2026 19:30:42 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121041; x=1778725841; darn=nongnu.org; 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=WC0vAoB2JrxhCnH6uJJk5wBT6sf05K3174sq655JkzM=; b=hqmZ5LmfgXi7oalJEfi/uvyJtfJxa+cktQefDRE3LNXo926k6tQi3c9qFPcze9/f1X fG8yDDaj2plIwW0sw3wa6lZxkx2KgaWkQTNiQnKK2MkhFWyZgZ4rmHW6a6OxVHzRCgfv EsshHHxdwcs+yovs6hCfgFDbApF5Xv0eO/YXayR1zQeuPBYsbHiDbO0Swc+LIid5ItGX BX7YGqXwStjAXt78NMHumiHit1Qc/37tNlKJ6NhHywHi4QliLVNwKQCgLsiwK0TL8cip ZubYBc9NSmZuBHd6FbFbgG5W1dkneRV3FujGoZ1d1rRsU+Ceh3kfNgfzxHREHd8JVI6A 2kJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121041; x=1778725841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WC0vAoB2JrxhCnH6uJJk5wBT6sf05K3174sq655JkzM=; b=r+ZRhRt7Q9VXTZpcyGGljDzX3ukH8qnzQiMYxrbQCTgZrjWTVnostDrStaz9qtNj0V BsfhkxTYsoHraOs0+VZ/YglSqyhV3XcEpcTeLwKXgsuC9tcf8aEOpcauosy14xhkQ/cu 1py6HaMdrXayF60AYSrVIHcOHzoy85ySGKPRKlEzlJfvR0yQsP1IzGWrEjvvV4a8yqXc 8xw2EuG+laRwEEJnYgO2YbPfTMaNGWSo0gr7kkrZyeU/AeCiPbIgdwXDbfo+BUeiH15p rokS5tBC55a/J93exELEjAaVlCFz5T4af1oMPUj3XisOXmpuHqQUzB7weJmyPsH9LHYZ 7FPQ== X-Gm-Message-State: AOJu0YwcjAmHN0y9oF2YLVINPfSw4aZC5d6/jWraeyrEqSplmFv0GWQZ ShjFROESy+4fMATgd+ezv1fzEDrE21Oo9gQEa+X8T55pK8P0Ztv6Fqv6p3B68WUGVCAJf3jvfX7 HHBj0tAw= X-Gm-Gg: AeBDiesDnVgMl+LO3x4wTFRaQQShmoJkPZXBFQiWh1DxK0gL/7mRgf/MvZb+O8ylFg+ gcyrJ/1tji3hTBXZgQF0Uki/QnoflDW+ADzOI2B/Cr3lXR/dO5tb1tJn4ozHl+5K+RAsZsBfwi2 THpcCeKsVfvr0r0KjmNS7PBVTCRxO1x1SpQdoWiXX/eNUFvM7/OUmXtr3t2REOmLQlazsukvqAN IEYNKVhK8Jv2IezhPNadsom13VBrWQHdpU5H5n7J6SQBT19nPMVXkU1Xn8BVyqWZ1z/oLrOyCvR E6g7XbkTSLiZ4w/aqQPRFYtn5t7KzFD6fAiWGZRyU2JeHbolM/qtcZ761PVvKA4NpFBKZLS0L2e CE42QFr72d69PNdCS70qarWpvAKMgVQ5+T7xEbdRSvJFs8nlBdPetVVZ4KutAD92rC5SMXatIgM Z5kIrVsK/WbWezEzpVhqwK X-Received: by 2002:a05:6830:828d:b0:7dc:db04:d316 with SMTP id 46e09a7af769-7e1deece6dbmr3972933a34.8.1778121040966; Wed, 06 May 2026 19:30:40 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 19/25] bsd-user: Add log_unsupported_ioctl function Date: Wed, 6 May 2026 20:28:21 -0600 Message-ID: <20260507022827.44499-20-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32e; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32e.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121168297154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add helper function to log detailed information about unsupported ioctl commands, including direction, group, and parameter length. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c index 94110d4ad5..2d84adce71 100644 --- a/bsd-user/bsd-ioctl.c +++ b/bsd-user/bsd-ioctl.c @@ -217,3 +217,27 @@ static IOCTLEntry ioctl_entries[] =3D { #include "os-ioctl-cmds.h" { 0, 0 }, }; + +static void log_unsupported_ioctl(unsigned long cmd) +{ + gemu_log("cmd=3D0x%08lx dir=3D", cmd); + switch (cmd & IOC_DIRMASK) { + case IOC_VOID: + gemu_log("VOID "); + break; + case IOC_OUT: + gemu_log("OUT "); + break; + case IOC_IN: + gemu_log("IN "); + break; + case IOC_INOUT: + gemu_log("INOUT"); + break; + default: + gemu_log("%01lx ???", (cmd & IOC_DIRMASK) >> 29); + break; + } + gemu_log(" '%c' %3d %lu\n", (char)IOCGROUP(cmd), (int)(cmd & 0xff), + IOCPARM_LEN(cmd)); +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121134; cv=none; d=zohomail.com; s=zohoarc; b=VSlfDXu5OoyomeP6V268RkHcJ3oGyN7Wk1AN/3wq3uuyZstE2kchoQmLV0dKdk6y1yBlCpgKHFrXnxqTkYZNrZCRgmzwhBsE3c7WG0npZDbOfsHPTS1G0aQzz+uKSR+uu/XWEpa2U7ubsZHi96aPk9LJoBwwxy35uTQNmT4ciJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121134; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KxPzwDdNP8oDpYmA2hO0L7kRJDxaNQN6DWWEtCBD4Fo=; b=WkN3e2zxOKIw12MQVmTbSLJYW7ioWModf6ntjSYpdV02TDngQbHWwpTGjxIgw/2ELG1ddmcmzSwH8ABT0K4VHyVObl0nawncMvwW4zlXshpa0ibKv6RKdvstrxB97lMuhV/lK9uh9pxEFePQnSiFWNphXCnLW51RN/As6n7tK/o= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121134183277.5411940484314; Wed, 6 May 2026 19:32:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWG-0007lS-36; Wed, 06 May 2026 22:31:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVl-0007Wd-Oe for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:54 -0400 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVf-0000ZS-TD for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:46 -0400 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-7dcc9b506d9so312573a34.1 for ; Wed, 06 May 2026 19:30:43 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121042; x=1778725842; darn=nongnu.org; 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=KxPzwDdNP8oDpYmA2hO0L7kRJDxaNQN6DWWEtCBD4Fo=; b=MBf3m4K9QtQiTULs6WyljpSbBWYXTmmHiKJkXY89tkRNzLrV/1uLCuuZgGwDDhuRQ+ iQXyt5/WmBbDyktVRUuLb3mKW18Nass/bIcm56/0scv2HEPYdSKrENPLJRB4q/2wtoQl QIwcyav7DalRJjcoW3WNLFJ0iosPX3Nzn6R+KxAd5vad44LG6hwDn26N890cT18HT8cG l7eXQEPqIti2xAlfFkNRfIbmsS2CKm+I5V/ebffy0zGf6pVltohIQXuL+tYw4br9dyDi 9ze7dN8oFM8RzVOvk5YavgcZg+91aVL1gruMIF/YdPz4BVke54zc1CC8si9HKU5yXAxs a2lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121042; x=1778725842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KxPzwDdNP8oDpYmA2hO0L7kRJDxaNQN6DWWEtCBD4Fo=; b=MMmHpoAagw+WSOeoO30XO+2PDhG1B+jpB4LU0aDApMNzCFe0/IbO4TTSsRanloFyQe 2t1Og0Fq9LgmaPhjprwSkP65WDDxL7NdU23/Svk3NbQpzBst+9yQTSEG+v4YZpZ4hd6X mFMJvdD0DCjjYzXntdlLjmFu7guEHxIXajpi7CtUM3IzI+3PtjJp1wTv5/1JvDpz/oL0 ahZkXlF7hpN/sUPxUKRE5qH/nJ9mnvtADwHjOKhozlMk5XAN/lN9XqqzHgSiUocTyCbi 8gy0lqli9nQ3+R+NHa1Dj4Dz3VJHFPX//bmlDkJXcy6z9atN7RadX5Dw59OAgA4o69Fs dVSA== X-Gm-Message-State: AOJu0YwtderuZ1Isa93t8p/zp0eRO4LFUKJ5nwJjJXB7n8XTqvnvvSIe cSxkMXZ+RtqEX4iYPlqXEQ/Otqy1M5aPmSlvZApiwqL6nATfejAtIJGuayiPYEYXk1Rq3ZNdxN6 /9zTyqqQ= X-Gm-Gg: AeBDies7DKRtzPIRy14PVAyF/TZZbl2MBS32vUru2nJOexy+phtt3Hm+K9+T3J1pSsH 79F8pMA2znvhSoVBqHqV8LYBeqzowfpTzoECe8bsWEk9+Gaz4nd33ViulgYt0EAOk1A6XW7j6LA d4qqajEjQIRo++00xKtdPOfhfwoug9hG4qN+LlTPdKWGiVhMCvdbGrniKRwAjCaWiLUmrA1clE0 4ViweBsBe/LjaiTr3QHSnDuUv7GBMneGfCxjF2DqT0HJwgf5dq7PZcrUiE4WWNWyr5ml3CIm/Nt bzdMchzRMqchaBfp1oFQ0TEkIb7hNdvqlDVXGliH32lZ8JYYarvmoNPI1sN1QRc9ulmcL78wRuH 9Ov/LE8z9sk41Dko3mOBRXtZzX8xQ9PARMgnAn5a/E9oEvXxPFl7YW6qXzGzyIe273eG8CDwkNn sTZJVuHNZYrUoWFkum4DJz X-Received: by 2002:a05:6830:82cb:b0:7d9:b0d7:ffda with SMTP id 46e09a7af769-7e1def7a851mr3880774a34.11.1778121042212; Wed, 06 May 2026 19:30:42 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 20/25] bsd-user: Add do_ioctl_unsupported function Date: Wed, 6 May 2026 20:28:22 -0600 Message-ID: <20260507022827.44499-21-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::334; envelope-from=imp@bsdimp.com; helo=mail-ot1-x334.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121135554158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add handler function for unsupported ioctl commands that returns TARGET_ENXIO. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c index 2d84adce71..69d1ea1718 100644 --- a/bsd-user/bsd-ioctl.c +++ b/bsd-user/bsd-ioctl.c @@ -241,3 +241,11 @@ static void log_unsupported_ioctl(unsigned long cmd) gemu_log(" '%c' %3d %lu\n", (char)IOCGROUP(cmd), (int)(cmd & 0xff), IOCPARM_LEN(cmd)); } + +static abi_long do_ioctl_unsupported(__unused const IOCTLEntry *ie, + __unused uint8_t *buf_temp, + __unused int fd, __unused abi_long cm= d, + __unused abi_long arg) +{ + return -TARGET_ENXIO; +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121118; cv=none; d=zohomail.com; s=zohoarc; b=IVscF64NPW2/Te0zPiMjrIzrV4MPnPV/olOE3b7k7lBCjb7eDRwDUVuOOyMJ5Yl+ZhH3MlDl2gljW2q86GDPBJYb+Wl+aL83+NKSz9+yZDmSp2WcOzvaPNBHH2IVa/TA0QQtn8dz6MinEAcl/Ocre2pOg53OgSRo6MpOn2xt8vE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121118; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R/QyHxhh955w/HPRpKuYJ0dcnEhs1tLz/1RAUl0qOaU=; b=kc6w9Dx5d4rItaCxgISA3pfksG1ZY9r94Roy+MONMbkDitpTS9LWbxq1qqoDw6vUEVsOrHK8ZvwO3tpZ5xLzXEn2i8QaugdVkzcncKUbH0wGHb9S7ImrGLwIciL0nbiiGHDckPy8kzBypqcGZa+Tr5cjwWA0kghrbtpg/H+BPZE= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121118788863.3240285378974; Wed, 6 May 2026 19:31:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWl-0000SU-Q5; Wed, 06 May 2026 22:31:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVl-0007We-PL for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:54 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVh-0000Zq-6W for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:47 -0400 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-7de431da8fbso308884a34.1 for ; Wed, 06 May 2026 19:30:44 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121043; x=1778725843; darn=nongnu.org; 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=R/QyHxhh955w/HPRpKuYJ0dcnEhs1tLz/1RAUl0qOaU=; b=Zfw+j6dM5PPIiSXLA2tvQgj5yvUjJJ84GBdS1UfL69bbEHQ1pnsLBv4DhGwq6Q66Xt sz9rYB4Joc8BRrFrqETWiQfNZnWutb7FRFlTg4/73iW2qnLKtH9tsM/OOUDhsF0wELMX fz9m1ozjg5RyeVBvVz7xqwtSvRaG9dZlUybrEXg4i/lPYYkT8IC1ifftDILh3UYxF6Al IjZZvoKxGVAUXoZPMkwKQbsqD9POd/aO+SJzLWzSFdZCW7b2fZmZda8X2QQiU5vBLKWV koI15WrqOWicvAkCqwIS8VlKtAaGf9NLJUKERqtpZcU4cwiZ6ygsuljaTgdhtHgQ+hZ/ vvUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121043; x=1778725843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R/QyHxhh955w/HPRpKuYJ0dcnEhs1tLz/1RAUl0qOaU=; b=bMKZUntDYfdk4FpThLDKmc6KGO+i3OSNbZUa5eW4uD+sgVW1MsJkEqiOQwMtwFaHjT 0gvnNBgbLMuv8baYV8zHa/bzmjfHMvqCg8m8Wmz/pvnIfmri9lb6IvVTkeOq0C2D46xJ pASt28v8mWE2RikOKvrqOchxiTrb1swxsFihcY96J9bHl2iwtWUMDnvYa5Ou6rk1lUjY 51iLS/joAINXXgWaKWp3gU67tZhaXRkZyLWhSYBDwQImJOi+ulu2XgkeM8QFaTNOP0Hw j6ODiCEXGcrXwFAD3CN9vSwQoLBO2BbGXhqcD07wKRZFt1RaebXHcNC1Lu2xTtgwfyKU 2tkg== X-Gm-Message-State: AOJu0Yxt/Fu0JGvd8lwZoZToT/6lJF/kInYTmESLAfwOEpGJNRPXpHCH MMPLvUXrp+fQIXsyEeI1tXkOqZymsCIoBv2zuo8kGsZj1+Im4A0LWQTTI+gwxi2UhXBb85fL7L6 qnReNX8c= X-Gm-Gg: AeBDievI5JmZNnFdxs57n6QEjpzmNueic2AahhEW0alp2RQFnsMNZxGh9eN7au8vmxy y2D2LQHlFibyrq3fPMe7Hv9eTyTahuFusTuFQtC7X5boJbEteg1Kjsecpbw1vL7QInukIJnEHB4 xsgg89weaD+PfRPtklpgZ1QZlQOjEOl7vDgHhYdDUnUtPgnI+ImJKmdaqfF98D1WBiHIKi119jQ abqtaB2Ml949hfeT7eVudQ6Xll0QwG3EoIR3qTtdC+v4y3riAuQhyQS4QjQx1v88HEKJ9nXqiNp qdfZ+q6ZyYUzANQcbvbUbEZAY0xkiGP/4ptwcErUTbPTbQhAN/sNjtMXeMmA6Usg/XSdtZb949h JpOWLAuwM/8dg1fgkEq6Ke/bHslmviJmVmC37reCr0fiU0eOivUNnaTpX8dtAE7zDz1isnSXk9c v8CTgqjoIKPWUR/ASZi9Jm09R+3GVWxeA= X-Received: by 2002:a05:6830:6f8f:b0:7dc:5899:c711 with SMTP id 46e09a7af769-7e1deec9014mr3930683a34.3.1778121043324; Wed, 06 May 2026 19:30:43 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 21/25] bsd-user: Add target_to_host_sockaddr_in6 function Date: Wed, 6 May 2026 20:28:23 -0600 Message-ID: <20260507022827.44499-22-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::333; envelope-from=imp@bsdimp.com; helo=mail-ot1-x333.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121119512158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add helper function to convert target IPv6 socket address structure to host format, handling all sockaddr_in6 fields including address, port, flow info, and scope ID. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c index 69d1ea1718..d2eb9105fc 100644 --- a/bsd-user/bsd-ioctl.c +++ b/bsd-user/bsd-ioctl.c @@ -249,3 +249,14 @@ static abi_long do_ioctl_unsupported(__unused const IO= CTLEntry *ie, { return -TARGET_ENXIO; } + +static void target_to_host_sockaddr_in6(struct sockaddr_in6 *hsa_in6, + struct target_sockaddr_in6 *tsa_in6) +{ + __get_user(hsa_in6->sin6_len, &tsa_in6->sin6_len); + __get_user(hsa_in6->sin6_family, &tsa_in6->sin6_family); + __get_user(hsa_in6->sin6_port, &tsa_in6->sin6_port); + __get_user(hsa_in6->sin6_flowinfo, &tsa_in6->sin6_flowinfo); + memcpy(&hsa_in6->sin6_addr, &tsa_in6->sin6_addr, 16); + __get_user(hsa_in6->sin6_scope_id, &tsa_in6->sin6_scope_id); +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121118; cv=none; d=zohomail.com; s=zohoarc; b=MSJcFABlCNVKADdZumykNLoWtyB/7ZLHmBWfciAarQy0WGTRw6NnPgwXGa0gLMYqPaLjpFOfGpcwIDtFqqi1mLY8WthoqFLRIQkGfhj8NmYPr9nPG2QG3oQrW166w45ucBYQMX2RY4HGRYsEzP/H87Deikbx4EWJdewl4Xc3r4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121118; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l3OaXMborORMMatPmIFsXY7DKnDgCYWPTloY74MIZzQ=; b=Q8klXWN/2EO1fMK/W9A0eye6SYIu8KPrWhN1b64pwXBk9quFXm5VFzNgbfOPWXuwyIDWYOrmgfhrn4BM9NSdVY/tVcmzAe/yqnvsW5WiwbxO6gcNJUKO+vpfoqkVmW4J1JxalEthJ6ZnySc84zc46cIYXE/WjQZJ+XQSUGGPS08= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121118864911.2853989413662; Wed, 6 May 2026 19:31:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWS-0008Ca-F7; Wed, 06 May 2026 22:31:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVo-0007X7-MH for qemu-devel@nongnu.org; Wed, 06 May 2026 22:31:00 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVk-0000a0-Qr for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:50 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-7de4ed0593fso189333a34.1 for ; Wed, 06 May 2026 19:30:45 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121044; x=1778725844; darn=nongnu.org; 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=l3OaXMborORMMatPmIFsXY7DKnDgCYWPTloY74MIZzQ=; b=CAKdtio5Jhad+4PHG/FsONpkYoSk30gXPSEWYCa7Flj+WBag/F83nET8+eb0KXAUiw 2C5g2l5XJZ0LlVqcwHkMDqIJhgovi88t7Z1wXaYcFnVzquBZs8K/qwVp1juqjbd14/E2 PV2iJzKcA1ipysOt54eXeQ3i6sq+pH3J/2aGZQi3VpOjFHVMFOukm/uiFe2YbZYNzyY6 DlMn2ThxDSIDQL09lTGqNx9OkYbQbZTqI2dZ7Tq/2RK063uB5vkqN2QMgzTlYZ2PgTpz qY/Wcx3PKOEqkiYdomcHH7C0zizcCH4l6TlMqvD8rcXu6OpWR3qLeh4AR9lMA1cN2xjV FdRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121044; x=1778725844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l3OaXMborORMMatPmIFsXY7DKnDgCYWPTloY74MIZzQ=; b=tB3tY1T+KPVYWHV32n88I4PSDbE25d5C4W0nc/q2nuUjcb43G39tTXXWGVubkU2084 rr5XOLykXI/yNmbCVjW/1OTxYAFZnyyNQaWHfYBv8TM+zAxceRUqI2O0shBX8BRFcT+F WuqHAc0ZOPUk4MobT/NQU4or31f+ZApoUdFqZuYtAPiI8sk62ixIpZTLzJnHMZ1tNedC CdECk+C6EMEuevpqMx6C6D0IMhoVIY+b+SyoH80a/pvNNsZ0OuwVuc4x1nrDzVKz7Wum HrajwHOom/FcqB6IiaqQ/FhISHF7lyU+Fj99iTlIVb15/lFA6++cGfcDciu30ObQGNZx 5MVg== X-Gm-Message-State: AOJu0YwnyqHJZvp10iqp3h+2VvWiDYhxPRFado8n59tkB9zmkOOfOcm7 euo6akKlBXFkL686V79TjPjvlrjC4JVEUYGEvj8EtkKUW2aPO92YE7c3S4LMk4iU0P6dLvY+OWP N3YYu+NI= X-Gm-Gg: AeBDieuaS/SMyPB6uTjzx3/RBH+QNCliRctuniWojfv0MxSyPg67DCiZruwy/dR4KMI 4RlFhmZSvown8vdkIbfv75Vw7b28th565S4ED5SvQb/UJPrVrARHT4QUv5CmP2r5tneOpOwcjBz bOGvZwEc/VN0JYx03fQuVGMQ4r8IV2/v1AsTDwzQNQ3RfQDuPgfbL+/dnpEwAfEz9k1riBGJy6I Bhfos6Z/0xZ1mbXQGOnY4HPku9iG+bv0XvWTtOD6GOn0r1diF2rwbX3OJ6h63FPU1gdHQn58Ma1 qxVYRQc8W5C8/L+jVidz/B5Tq04BSbNLrkCr/yptEgyyPTFS067pSBS3G/x8l6log0pMG3l3HTZ Teg9oxWRfzkSIrvbhj/oMRN2OxpfaK+oEpq+LniKuEroVGCRPSxRu/NTR9WcaxTwXVeU+AFel4K H8/+TOETQne8tjBZ0GPMQ6 X-Received: by 2002:a05:6830:82d3:b0:7d7:faef:fa0 with SMTP id 46e09a7af769-7e1dee30c64mr3660824a34.3.1778121044589; Wed, 06 May 2026 19:30:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 22/25] bsd-user: Add do_ioctl_in6_ifreq_sockaddr_int function Date: Wed, 6 May 2026 20:28:24 -0600 Message-ID: <20260507022827.44499-23-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::336; envelope-from=imp@bsdimp.com; helo=mail-ot1-x336.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121119484154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add special handler for IPv6 interface request ioctls that take a sockaddr_in6 structure as input and return an integer flag value, such as SIOCGIFAFLAG_IN6 and SIOCGIFALIFETIME_IN6. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c index d2eb9105fc..8d25d84dbe 100644 --- a/bsd-user/bsd-ioctl.c +++ b/bsd-user/bsd-ioctl.c @@ -260,3 +260,35 @@ static void target_to_host_sockaddr_in6(struct sockadd= r_in6 *hsa_in6, memcpy(&hsa_in6->sin6_addr, &tsa_in6->sin6_addr, 16); __get_user(hsa_in6->sin6_scope_id, &tsa_in6->sin6_scope_id); } + +/* + * For ioctl()'s such as SIOCGIFAFLAG_IN6 and SIOCGIFALIFETIME_IN6 that + * passes a struct sockaddr_in6 in and gets an int out using + * struct in6_ifreq. + */ +static abi_long do_ioctl_in6_ifreq_sockaddr_int(const IOCTLEntry *ie, + uint8_t *buf_temp, int fd, abi_long cmd, abi_long arg) +{ + abi_long ret; + struct target_in6_ifreq *tin6ifreq; + struct target_sockaddr_in6 *tsa_in6; + struct in6_ifreq hin6ifreq; + struct sockaddr_in6 *hsa_in6 =3D &hin6ifreq.ifr_ifru.ifru_addr; + + tin6ifreq =3D lock_user(VERIFY_WRITE, arg, sizeof(*tin6ifreq), 1); + if (tin6ifreq =3D=3D NULL) { + return -TARGET_EFAULT; + } + memcpy(hin6ifreq.ifr_name, tin6ifreq->ifr_name, IFNAMSIZ); + tsa_in6 =3D &tin6ifreq->ifr_ifru.ifru_addr; + target_to_host_sockaddr_in6(hsa_in6, tsa_in6); + + ret =3D get_errno(safe_ioctl(fd, ie->host_cmd, &hin6ifreq)); + if (!is_error(ret)) { + put_user_s32(hin6ifreq.ifr_ifru.ifru_flags6, + arg + offsetof(struct target_in6_ifreq, ifr_ifru.ifru_flag= s6)); + } + unlock_user(tin6ifreq, arg, sizeof(*tin6ifreq)); + + return ret; +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121143; cv=none; d=zohomail.com; s=zohoarc; b=HwL0FPnUPmvSoKqpIn4Us0eLdFZu8YwMe3hZD9s8rx628z6+qqPFCG++wnmDiab1503XFkkvNWu3q1Tegg/FHKoJ9F0dXlF++adyC7snHT9ZxGE+3RY3ZnD2NOzIDBQrIz1zuumxROV+UbtuEi9VoAXOVJtVpoUl/9H6coMfS6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121143; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ry/+AD30vqQ1SM10FWDtz2pfyCCIJfoXwGJ8k1dXU+Q=; b=crKZeQGPYVm7YiPCBZvTnxyBPfi7WsSu9WlBCADlH/sQknx1XCBxxOEy2VM/yVRAPckXZ9hOxtsH15INrDB+6fsUw/hLB6ThUGUxTKVK4K87XZmZeHM3cLVd4yWixdzyGlQQSalmHfxP1SQ+Rj2c0uJS7r3pjlr0PzalPXI1e+w= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121143204575.5891860706915; Wed, 6 May 2026 19:32:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWn-0000d2-T2; Wed, 06 May 2026 22:31:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVo-0007XA-TB for qemu-devel@nongnu.org; Wed, 06 May 2026 22:31:00 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVl-0000a9-0r for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:52 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-7de46b8e432so336182a34.1 for ; Wed, 06 May 2026 19:30:47 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121046; x=1778725846; darn=nongnu.org; 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=Ry/+AD30vqQ1SM10FWDtz2pfyCCIJfoXwGJ8k1dXU+Q=; b=eCBxrjyvqTVaYsZenoReqAuVqvqwdDsgWaeOt6UnQb45xZt115tzdsenIPg/XL51RO VLhRsv91gyenuSDyg0ciSQJA0kiJi5oo8MuaNbNrxQjjtAT6bomQxp23NIRc9gR6e7NJ cHmBfK1QPbKcUxm/gxTbw4ubZWcIkbO0qScEmSYTsXAair9bbweW8zElSwqMVgsKhAe1 VUWPQdv+mm9OpQeA4hDNEx1HcgevouShI0/1QqGYQoo1WsoBePlEGIEFOi45hozTJreZ SK99lvfdHGUKHgt+/w/J072tvZpLdUMTkOR7H9TSRiKjhrenMYqP/TH13FhfWGWtQopc Vmew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121046; x=1778725846; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ry/+AD30vqQ1SM10FWDtz2pfyCCIJfoXwGJ8k1dXU+Q=; b=XrhWiOm+coDzvpdixgNqu9whd3q/vS/1C55hQe1ohrIlnTlh+/LZDI0p1rRUIYyVP4 xk/N6YX2QPIv2NPIGZW2OyNsbvLHQTGXM9FZNk+jfPaRAvbfyK6sFtPQdI8C+EwU7x8X Xs7Svma9rYn2pJGzailRpR0+vkEEJ1vg2/uTaVd4fKpxExFygd0mH9Smr3nkurdhIbCb 4xMTNWWokxAWsYUB41rM8wMr6+gDD+QYIQmWWoXaRlAeIGLZAna+ap/cVIPw9mwRKT6f jIrYFjdVWdO8AXaL9qoKkU/ZpNK61rXMCmpUXZ09QW55bF+PCYvvY40FWLwptekRACoo TXww== X-Gm-Message-State: AOJu0YxPELvrCoyVBo7epLHX7fYV0hQM5aPd4rOtODOvZaBHiEzTKY2v gqMg/tSDM9sYeHTvkpnh3+10dXcLsAH2YP7jOTGTzPHzsjPTd0uHC92JGA1cCmoH7ml0cD39QbW 9fCi+n/g= X-Gm-Gg: AeBDieugdqLyEh3yFLsk0T16YGIsWFwnR4f12+Ja/M3lTmOzc7XUqJ5+smlr1iQZSXP XJdsUZG1DPXn1blJpyUizEzoSPvqRGzWwzbL+FzjF3JeEFamqJS6C2cxf8+oR9nAQi1ejfpTlwZ TnLRuCr3fIyS7u/Lq3QqlT3hYajaAg1+Ki0INUgtoOuC7Wskvwl/Kkb8hwaaNTXrIaSlxXAwHlq ckJZOVGEDJ3GGUXZaS6BtCXM3+fxwRg9gw6iE4RAKnsCQ0Gee3+SfhHyeoBKpsBQvHmqUTPa61L ipV+ub7zOBnjbjFi9E+NKVAQCKTeQ8IfGsoVVbNZIz1rLRI8PJrNJd72+pMn3ceSBwkc+xhC+Kt LdmWKZr0t/phSwF3Ru02OP9lyLGUJg1tPAvq2ikaCTetXEnoLIpM4u487LSWAME37VhYWqvecWG 2Y4u6nTFV+dWPwuWlPm4G964VmREMlqtY= X-Received: by 2002:a05:6830:2704:b0:7d7:f13a:761c with SMTP id 46e09a7af769-7e1df15829emr3012072a34.23.1778121046234; Wed, 06 May 2026 19:30:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 23/25] bsd-user: Add do_bsd_ioctl main function Date: Wed, 6 May 2026 20:28:25 -0600 Message-ID: <20260507022827.44499-24-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32a; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32a.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121145883154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add main ioctl emulation dispatcher that handles table-driven ioctl translation with thunk-based structure conversion. Supports TYPE_NULL, TYPE_INT, and TYPE_PTR argument types with read, write, and read-write access modes. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 100 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c index 8d25d84dbe..3940a69260 100644 --- a/bsd-user/bsd-ioctl.c +++ b/bsd-user/bsd-ioctl.c @@ -292,3 +292,103 @@ static abi_long do_ioctl_in6_ifreq_sockaddr_int(const= IOCTLEntry *ie, =20 return ret; } + +abi_long do_bsd_ioctl(int fd, abi_long cmd, abi_long arg) +{ + const IOCTLEntry *ie; + const argtype *arg_type; + abi_long ret; + uint8_t buf_temp[MAX_STRUCT_SIZE]; + int target_size; + void *argptr; + + ie =3D ioctl_entries; + for (;;) { + if (ie->target_cmd =3D=3D 0) { + gemu_log("QEMU unsupported ioctl: "); + log_unsupported_ioctl(cmd); + return -TARGET_ENOSYS; + } + if (ie->target_cmd =3D=3D cmd) { + break; + } + ie++; + } + arg_type =3D ie->arg_type; +#if defined(DEBUG) + gemu_log("ioctl: cmd=3D0x%04lx (%s)\n", (long)cmd, ie->name); +#endif + if (ie->do_ioctl) { + return ie->do_ioctl(ie, buf_temp, fd, cmd, arg); + } + + switch (arg_type[0]) { + case TYPE_NULL: + /* no argument */ + ret =3D get_errno(safe_ioctl(fd, ie->host_cmd)); + break; + + case TYPE_PTRVOID: + case TYPE_INT: + /* int argument */ + ret =3D get_errno(safe_ioctl(fd, ie->host_cmd, arg)); + break; + + case TYPE_PTR: + arg_type++; + target_size =3D thunk_type_size(arg_type, 0); + switch (ie->access) { + case IOC_R: + ret =3D get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp)); + if (!is_error(ret)) { + argptr =3D lock_user(VERIFY_WRITE, arg, + target_size, 0); + if (!argptr) { + return -TARGET_EFAULT; + } + thunk_convert(argptr, buf_temp, arg_type, + THUNK_TARGET); + unlock_user(argptr, arg, target_size); + } + break; + + case IOC_W: + argptr =3D lock_user(VERIFY_READ, arg, target_size, 1); + if (!argptr) { + return -TARGET_EFAULT; + } + thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST); + unlock_user(argptr, arg, 0); + ret =3D get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp)); + break; + + case IOC_RW: + /* fallthrough */ + default: + argptr =3D lock_user(VERIFY_READ, arg, target_size, 1); + if (!argptr) { + return -TARGET_EFAULT; + } + thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST); + unlock_user(argptr, arg, 0); + ret =3D get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp)); + if (!is_error(ret)) { + argptr =3D lock_user(VERIFY_WRITE, arg, target_size, 0); + if (!argptr) { + return -TARGET_EFAULT; + } + thunk_convert(argptr, buf_temp, arg_type, THUNK_TARGET); + unlock_user(argptr, arg, target_size); + } + break; + } + break; + + default: + gemu_log("QEMU unknown ioctl: type=3D%d ", arg_type[0]); + log_unsupported_ioctl(cmd); + ret =3D -TARGET_ENOSYS; + break; + } + return ret; +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121160; cv=none; d=zohomail.com; s=zohoarc; b=goE9vqwvJdQjYb6jMl7Ps8Pbi9D+y4j5SK9N+bHO3Ia5vHSkv52PodQzEEIrmzij7Y0TrcIMLgKFnQkgeraJUgX1ugiNWNsYiOKEU27Nhrz8Lusi+AQDQKIMsCGAC/QLYVRXJQHYPMUduog7Cgs84iRBQCg9NYYmjSslvQdbOoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121160; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3VP2ZZa8QaHuzkqWfiEQ1tuvq28xRUkNEtGYAQT4zOY=; b=QT4dFpme+y+8dZhG1RFhhQZfYGQH4UlGoJUG7gnik9Bj4OFBWGaUgKYq6ZI/AdtgRBYPxGqMvmcdlODgzsiKlccoBfXfPlK0sHYx9If0InrOhoEOJnNzpUzPdj3ZdbaYPgYJnTeOV/ehoSw/b0WZb3P2Xj9XgW85tFNcroBCJHI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121160842785.9212657873991; Wed, 6 May 2026 19:32:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWL-0007yq-4D; Wed, 06 May 2026 22:31:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVo-0007X9-Rt for qemu-devel@nongnu.org; Wed, 06 May 2026 22:31:00 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVl-0000aE-Ha for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:52 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7de46b8e432so336190a34.1 for ; Wed, 06 May 2026 19:30:48 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121047; x=1778725847; darn=nongnu.org; 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=3VP2ZZa8QaHuzkqWfiEQ1tuvq28xRUkNEtGYAQT4zOY=; b=wyG24FtHywJED43fY3lZLainw+sask6thbnyDgm1DTEACeAF5TNszui2Ub539W1RGK LN6B20iGC11YYBSYPX10zNlfYsjdGM8RSMlctmtWSubsHSL0/XNn9UuYcng9y8sY8Lvj dhcD3EVGpiD9f1mSrqBvXWZM+wllD5sHRVeu1nU7k13iRx/L4sfjlXfsPEXqtFB3zd0m 9iNhoMT9O0Vn1PtBxskmJdSmKt7sdwtiVEuuh77Alk35gk7hzgbk8brfeZ5mW+ns2Vmp NDk9ddPJpJ3tDLCfEna0xvWUlQaEqSag05SUeosUSMYof+2TA8h2ZIRzkKTvJQ4WGDIu cEQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121047; x=1778725847; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3VP2ZZa8QaHuzkqWfiEQ1tuvq28xRUkNEtGYAQT4zOY=; b=OvaH8Z1vx7H/rMW7TlXpmRh2Lf8iX40QihXbMJa9f/jSURgp8n7WnVexjUiT0xuBZD GUNGHCwVHGQ3W54Nxm3USkjrjGSeMaQ7NaIuy2fs3OAVdhOGcBBBHeaunLKuydbF2Mnn Ie2MQ1tGxzSiO84xbzbfij6qdqQINPJF/2okENUtNJnr4N48MjaML+WiIBymh6bAZbv4 dIwXmMm3uapoEA64DDRh5HV/eXYUxPkeyhwvJsOkq5PtzzxSwwdNr9mcGkIXb2ZzWS1w HQUNfsz5l0HaLADHP6YmCvWGIL21FsIfy1BsvUagFcTFyJqYXTeevh7uLr6TZr2pf1cn kqaQ== X-Gm-Message-State: AOJu0YzWNoX/RVP+WeuNl6gwzDjLvrVHWKB7ZS8/wObYQBVVbMKTG3DA LUO030xehVQIKqkFhUmuOoiY3gh6dyDtZTJqsQzT1bQWtybPaquAFy1+rSITvGyWaqHZ+l8+jxF n0hBaDxc= X-Gm-Gg: AeBDietCZIaI1Vy5XJRzYogdWAfLIFkIcY/2A3Kx13dcu2o97xG61e3lO0oVGtJrgrR o4u05C0wH8w8uJ60Ji+4VKediAB0ixT3PuZJTQi66HYn4b4WWUek4MaTmdBkZh4fiCIZ2IbIE1f BiPSdtbnGGztk9Fgq0Bsht4Ffzp8AcRR2v881dvRhfmGSbnbXGM4FrS6qgK7ZU26yq/tgQA77xB GoqVAYxdbddTHAo75Gy1CiGxSPHG7FdA1KiKRsdRNVctTepSbkxsRpqLiabHSxMOEcxbK2VV0uO wxTPgizug74Ei+OJ7ik7RnjkObLNFLrpxpdThequCXm9atSSCZm9fakb1oq0jteVCUSYZzNi26z V+nWdxSPSivZf8NiCStUGPDByyDiC9sDX5SWjzYHfIC3pjawT+Y+jS6VcYha/z+Yt6bNYEjyesy /RZZ8NbfPBp6edpQ90d3W8blfyBgCZtrg= X-Received: by 2002:a05:6830:3787:b0:7dc:db3c:1d82 with SMTP id 46e09a7af769-7e1def16ecdmr3839784a34.10.1778121047222; Wed, 06 May 2026 19:30:47 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 24/25] bsd-user: Add init_bsd_ioctl function Date: Wed, 6 May 2026 20:28:26 -0600 Message-ID: <20260507022827.44499-25-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32e; envelope-from=imp@bsdimp.com; helo=mail-ot1-x32e.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121161609158500 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add initialization function that registers thunk structures and patches ioctl table entries with correct size parameters for target architecture. Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/bsd-ioctl.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/bsd-user/bsd-ioctl.c b/bsd-user/bsd-ioctl.c index 3940a69260..15e80bb21e 100644 --- a/bsd-user/bsd-ioctl.c +++ b/bsd-user/bsd-ioctl.c @@ -392,3 +392,45 @@ abi_long do_bsd_ioctl(int fd, abi_long cmd, abi_long a= rg) } return ret; } + +void init_bsd_ioctl(void) +{ + IOCTLEntry *ie; + const argtype *arg_type; + int size; + + thunk_init(STRUCT_MAX); + +#define STRUCT(name, ...) \ + thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def); +#define STRUCT_SPECIAL(name) \ + thunk_register_struct_direct(STRUCT_ ## name, #name, &struct_ ## name ## = _def); +#include "os-ioctl-types.h" +#undef STRUCT +#undef STRUCT_SPECIAL + + /* + * Patch the ioctl size if necessary using the fact that no + * ioctl has all the bits at '1' in the size field + * (IOCPARM_MAX - 1). + */ + ie =3D ioctl_entries; + while (ie->target_cmd !=3D 0) { + if (((ie->target_cmd >> TARGET_IOCPARM_SHIFT) & + TARGET_IOCPARM_MASK) =3D=3D TARGET_IOCPARM_MASK) { + arg_type =3D ie->arg_type; + if (arg_type[0] !=3D TYPE_PTR) { + fprintf(stderr, "cannot patch size for ioctl 0x%x\n", + ie->target_cmd); + exit(1); + } + arg_type++; + size =3D thunk_type_size(arg_type, 0); + ie->target_cmd =3D (ie->target_cmd & + ~(TARGET_IOCPARM_MASK << TARGET_IOCPARM_SHIFT)) | + (size << TARGET_IOCPARM_SHIFT); + } + ie++; + } + +} --=20 2.52.0 From nobody Sat May 30 16:35:41 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=1778121122; cv=none; d=zohomail.com; s=zohoarc; b=Nuf5a0KC34eqHB/TIn5RkDvVTDLwVbQ38TTF18dgeWjB/U8G+fXZrMYe9JwWI1ZsKr28s8ymTXlk2DwHaT6yTz8gyHyOp4Hb/58qkURzOkyNZsZs2AqRC5o1T395ehzCH6YUDDfPFTQC3Ftjg9N4hdE86++hpc1uDwmlRSQgnz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778121122; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Hc7ktAKkXmg4BG5PFQIrRCVxKx0sZHqRW/Vi7G51a1U=; b=Gd5kimwK6O5Dh26qA8YhP30gMPoyDaT0iqM6abT5sUX/3emg4b549voAyw61j/bZlONZriyvqYUl/0BQT4sTf/TzG2P0yj3wGlcce0EWNjIvFxjRn2rrKVx4Cmk6KObOhP4zQyM+41UFUTuYOBy9U8Gx6ooIlFAoTWNpUTY5uMo= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778121122130541.9833763102786; Wed, 6 May 2026 19:32:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoWt-0001cC-9O; Wed, 06 May 2026 22:31:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wKoVp-0007XB-Vt for qemu-devel@nongnu.org; Wed, 06 May 2026 22:31:00 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoVo-0000aJ-Ec for qemu-devel@nongnu.org; Wed, 06 May 2026 22:30:53 -0400 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7dcd17e19b6so216206a34.1 for ; Wed, 06 May 2026 19:30:49 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ded1915908sm12465247a34.14.2026.05.06.19.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778121048; x=1778725848; darn=nongnu.org; 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=Hc7ktAKkXmg4BG5PFQIrRCVxKx0sZHqRW/Vi7G51a1U=; b=Oxy9e4O3OWpOgbJEkvigQUKvwnKf0fcXUclZ6v7lcW3yYPXKdDQ7D+KsHw0VPG9+/h aD+ltiaPR9UZU4YQKT8hY3qBq0n5vSt6x9hKjwAuFmCYznmHm78aUd3BgXsNtzqr85F5 Bt2Z9cTS4/dCPB9uOEuuVwM9Dtz+Z3bLzPNtRIo5SjROJU/zQ6zdMXdVyLr0KgVfg8FY 6ec77rAX4r4K9fYjzf1FgbFB3JaueFlpZzIQpnmJYKeG4u8YReBQDwogIYsr+JxK51kp 4FENfFD08ALRbqaQa0QFvZj1ky0WCiMLFw9EgXPur25b3s7xT511Y3Dj2NN2OXJS54jm HqXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778121048; x=1778725848; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Hc7ktAKkXmg4BG5PFQIrRCVxKx0sZHqRW/Vi7G51a1U=; b=mJzuucWcoHDT8n9YJBoKI+Gyqad6r4S60eEBMnTlxGSBwXkLEvKsa/jzP4V5Rxknie VBWpZ/PbEI/USMXB+YFPGRjR/ysgqChT6hGzgshRvJRzLtx7uCEZKm9sXQikeux/GsSa Z31nrh+2wqRo5Flh0nwmshkz0RFOvtl3lzS/XAgPLwn8LMLIOxw6lfuDg66671tbWJYe f4GVVKbYQDS5EwQDJAjnrT9J14DWBX8BJcgMhdEjwDpe78CzwhPTq4vdQ67A2Jbh43Y8 CR3ibmDUk1dzAl++p0zSwMc11KNgRMVYWugOttYkQi0kdmoETqikG0YG4tHPIHHOYNRF bRcg== X-Gm-Message-State: AOJu0Yxgtr0aWa/yQMdjtFeLX+3PDqjgxMQBju8BqnzPPqaxXTiA2FZD S2PmCW0gprpXKMpSuavkMUrII7WE/oq3JwHgwCE4/bJQM/Y6P2HQ8FkEKqNE/lZ5kFmczorJJ2z 8P105YFI= X-Gm-Gg: AeBDieuedYOFgxGRzZc7Q+dppLlAa/2dGbwHbCM+n5i8gLsuocFJA+YXzl8d1yWFP+R k3H9/eYTFEHg7yw65TTUhOzTVc0fuRJ94E6EAkxwzRDJ76WRoEPYRsRhcQ5DlpEG/y//bFjn9kC Ivh7oCngRAZ8Rpr/1gzNlPtpWGik2m3w/1Y61ex7VQiO0TzId1QpiF94Lw2w1Q4MDBtzUjEbMk7 AWLB+ac3pOMwbr9CTadqvn9If6btWsYLxG5lVim8H+IAXfH/Ob1sa9y+41gYrjwsAvbGq1q/icG e7pVMltMnRAczeO/1N0E8iuVWp2Eo55QnOzsanlrQ4ksSrze2J/8wsG9cbj9UUV5/n4i1RlctTQ I3JRPnfRWiqZl2JWXvU59oLlHk0EI2B/ue1E+/qBGZwMICgNHmv4bYTpcW7P9MY+87VsokObzsO KnmEW1cNjlDdQo5UbDxAOOeagksKF4Q5k= X-Received: by 2002:a05:6830:3142:b0:7dc:3d7e:40c2 with SMTP id 46e09a7af769-7e1df23c9bemr3813545a34.27.1778121048181; Wed, 06 May 2026 19:30:48 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PULL 25/25] bsd-user: Add call to do_bsd_ioctl and add bsd-ioctl.c to the build Date: Wed, 6 May 2026 20:28:27 -0600 Message-ID: <20260507022827.44499-26-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com> References: <20260507022827.44499-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=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::332; envelope-from=imp@bsdimp.com; helo=mail-ot1-x332.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: qemu development 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.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1778121123548154100 Content-Type: text/plain; charset="utf-8" From: Stacey Son Finally, connect do_bsd_ioctl to the build. Call bsd_ioctl_init() from syscall_init() Signed-off-by: Stacey Son Reviewed-by: Pierrick Bouvier Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 9 +++++++++ bsd-user/meson.build | 1 + 2 files changed, 10 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index ca819fc530..90ef1bd916 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -34,6 +34,7 @@ =20 /* BSD independent syscall shims */ #include "bsd-file.h" +#include "bsd-ioctl.h" #include "bsd-mem.h" #include "bsd-proc.h" #include "bsd-misc.h" @@ -689,6 +690,13 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_bsd_undelete(arg1); break; =20 + /* + * ioctl(2) + */ + case TARGET_FREEBSD_NR_ioctl: /* ioctl(2) */ + ret =3D do_bsd_ioctl(arg1, arg2, arg3); + break; + /* * stat system calls */ @@ -993,4 +1001,5 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, ab= i_long arg1, =20 void syscall_init(void) { + init_bsd_ioctl(); } diff --git a/bsd-user/meson.build b/bsd-user/meson.build index 9cc5c6c459..2abcae5122 100644 --- a/bsd-user/meson.build +++ b/bsd-user/meson.build @@ -7,6 +7,7 @@ bsd_user_ss =3D ss.source_set() common_user_inc +=3D include_directories('include') =20 bsd_user_ss.add(files( + 'bsd-ioctl.c', 'bsd-mem.c', 'bsd-misc.c', 'bsd-proc.c', --=20 2.52.0