From nobody Sat May 30 16:35:40 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=1778120860; cv=none; d=zohomail.com; s=zohoarc; b=jjTht97JN9IN1pQN64eWBfxfax1yewXGj0RaR4E2OpCl8qP0mqvofrIgZ/+aiHWQlgseLjks/SmIisnt7AMCZu1z0Gt+uFHseO9XwwEWV+HEmAgaJU5W9N4SKxtKrsDxIyEIhFBCw5cDlqhndfjx7uPc3ZI2480ZbMnrN+rPRa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120860; 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=OIu9TPVBFvZnYGMYNwA1SLZmi496EfQxDyntm4WsvPJ8ASjakKjbWuan1Q5JSLs9oaZrWVys0ATzBkWAxTKOHBZC0Dyp45mLvYt7V8D2z+uqlX+Dc7fSl5ZxronWb43+3OBs/QC4ll/P4WKsGN//NHFXdJKe0VG+WtFflAhpb/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 1778120860846375.8050990433825; Wed, 6 May 2026 19:27:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPZ-000659-Sf; Wed, 06 May 2026 22:24: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 1wKoPY-00064o-It for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:24 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPS-0007b7-VV for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:24 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-691de293326so189607eaf.3 for ; Wed, 06 May 2026 19:24:18 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120657; x=1778725457; 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=W2QSXtLxxI57WIvtYPdrnH6WDhQb6tH2Z/P0GXVBukuYQbA079QA5Rc03BWoe+XvX7 uNAr0FrEbtHtH1Uw+Qq4Z9SiK1wwPfIQoTLbFyGLnpq4pAYSrxYHcrEZ9KYfFe1VrV/i TnBgiIaa2aXx561ES/ZWMC9Gr4ntJqe+8oXnH+Yzdf0jUfsNQVfzndfIOK+hdriBPYWK 1QpFTUVwANue2+xPbWQpv7QGvaYyvdK/nWfM+jf2w5zzDlF7ION4GlIE4SHnTamfr9NQ 3AIxBCSH4trIctsLYDqLU5fe1MycVHmTvijr1ODEfD5Lifj7MMZecYSFWcpQwI1myt1p nsHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120657; x=1778725457; 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=GUmjPeBqGzfNo/cmZx4Fhupb7/fvwzcL3mm/J9A/F12t10wjmsNpkUl/PYqri1dzvX hFXfzFSNMQ56l2PU9RpVk2SsF9eBjuI3Rfvbb/Q3LjLBqu3dsnQBE1siF9tXmBmfal7S rIdfOYWlPsPsOPGC9ImeQWjYNdE0qQUvG9Jkb9y3GF+odHj1iWcOalZA1xMz7jquZXe/ okjw2mG3Ey5kgEHPg7pjh/Bx6oWl1sESAef0VjGDVMIotM5vyFeFJCop5dR8wGgvnAFx oOJIAx3cXtZ7sgxtxq6G8Fkj/5EUuH0ZlAAFXXpFBeazIitAU9yMN5wU1LPLOMnFnr0c CthQ== X-Gm-Message-State: AOJu0YwbPTrsfbZc2IuZByLZ/PMSJdZZtoCUjMpwQ23onCBj6nWEiVSN xgVGByjyrTnu/L9+X9tHUudoYF7obeJ/xnNX/LqXTGZfyyTnQC7uh9IS8uwW2DD/gPuBp4yESNc NOyuQLzU= X-Gm-Gg: AeBDievG1sOQZf0gKrikS0HgHXbvg5AzIP7bHg0PpnSSA8HDTJ/OJ8V1uLcduwwRq/A eeuYrHi64vZMbA6G939d/ivQIJWVJvF0DfHkDPlwLlNOcjsKdRaZRH8dH/+XizWbs5mTCip/d4K uJ5Hj5mkl3G6baIEer7BdNsL8JEJYxzhJxw5riVi/UTHGay6rpgfoAf94mmLrnDV+xGVKuEBy7N 7yA1mV0MMuz5DBQZHAINWIFKOSsw2uwpi3IO8JW1WvEX6JxyrouPlyGlgV/pvk9hSzvn1ZbiUoL WFHRqnIlGMa1Aqu8F2E30/sqxn3dsvlCLcULTzEHWYba3ug6NtXXEoiianTlMsnGOy18HnbAAvU 12EsxHnNim99lklz5y6RFAS2D9dme9vaZqARRbuCgNbNOtgJAQKTU+yrRBziXdVSu7rCfmKd7xQ 6hp6wmgN5ieGnQuVjaPJsJ4F6572RzLi0= X-Received: by 2002:a4a:e918:0:b0:694:8ed8:e59b with SMTP id 006d021491bc7-69998d5c6d2mr3474102eaf.54.1778120655156; Wed, 06 May 2026 19:24:15 -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: [PATCH 01/25] bsd-user: Switch to SPDX-License-Expression Date: Wed, 6 May 2026 20:21:55 -0600 Message-ID: <20260507022219.44171-2-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2e; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2e.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: 1778120861954154100 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:40 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=1778120722; cv=none; d=zohomail.com; s=zohoarc; b=QjRMrHQBmjSGfl4y7JWdeMI6Lx//HuB36CgPH6fLgwkg9I4oiQUymmKFhss7UN4bkNQqXav0KXUbtyDWK3AQcIkHMiTZPtIzFx/BqUreZDOCCPahbICa2op4uCdlHHZ7bnDuJzlorlOD6FNNEuvI8LRChw0DMnl6C7x5vbxUFzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120722; 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=IHLacWl5tUZSkCvQlzjBF/hk8n9NqBIu9JIpiTheV949o46VPnLQNKGcz2ooOALYaCyjHPb7UFSs0rne1xWTXhNL+wJs+KsDotBvkwlZySxkfo6yVwl1aOpf8JmOP6MvNyj0xDyfhRbONdlbP81mUC1lpdR0ISHutaSgv2DcjQQ= 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 1778120722591655.9443942219713; Wed, 6 May 2026 19:25:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPV-00063V-8E; Wed, 06 May 2026 22:24: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 1wKoPT-000636-Q2 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:19 -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 1wKoPR-0007aX-Vr for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:19 -0400 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-7dbec19732eso267096a34.3 for ; Wed, 06 May 2026 19:24:17 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120656; x=1778725456; 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=GrvkQLG32Bq4GO7tUMdlbyC49hyGQoBEs/bV1v3nVhxavZTynVxqEgrseeW9tpjXSt 9sc31FAb/le///Z1jW8DffeCvQgW7lxVI+39UgnAG77d4SHevp+TaU74ci5E41oBaGYD HzJnLEwAlhbrAOyYSCChsihCEhOE1xHRGUNwupOEkB15Str8a8iTMdevoEc+jzTH/vHz qEL7/492C0nO/Q3jLptzPAdPY7rwuaEhdGIKq1ez449BRAaosyOzSN9rCsLRdmAVHXy6 o4w1PZnEsgHcGtRwvfSvYfWI14WL+s4L9bfBY4aRzoE4Sxk/GAQDaUZ4mR1OH+iofMSN fW7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120656; x=1778725456; 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=M1iteGee77ZCBFm5nAFu4pjSLnbGZpnO/2J0R8pYoWFXVti4Pxt5DR/fiwMm1/3zzY FaDRHYopzVR44/3rLsC3nlwk0dlvMS8RF2lOumyqhghMIB3K6HzlC6h8odGCpet0tC15 kkuXhdsFLC3mM9VVfJPnwuRNVAMl8weE0dEMXCWn6Cpy3YA034PIqWt8U0Y8on0FAgvv OMJqBRNwQiyJpTiHVakglqyzrXfMymnvUseKhc5r0UddF9fsyAxZD6os12ltJCpnvKP2 3NTp5AYqnfi++eJAItwzn7nUslOlfZZmoCIlKaQ4+kxDKbRcrUH9OiVtEOVPgoVfOmRr zjQA== X-Gm-Message-State: AOJu0YxaS7zpeiJBzITHnoOuvvodpVlO99GwXPWXO7CxaLIYjOwb2VI4 zu6PEA6INMZwwLcQ4++fVaCpxLTAso42nNvAam3bDadpUyNZxRBiLJSG9cuK0ZcdNn/vhf02mpy tJYO5lMQ= X-Gm-Gg: AeBDievlAny3B12RTWs85pVG6QXCrFD6fDH0oK3Xlk2POqQpD75LJM12FXSsXUVKKpe Ek1vOYn3ewP1B7P1Bc4RwjDoKk592eD/r+4zTNuHPinn4PdQXIVXrSjLmsyk3lc3HfKeZzrh8GN bb0BrruGWLjPZnlkOFGE4/eZwf69sfgBdhSoK2TDbeEbV2YHRCT1QGocp2y4nqmwCEANY5H24iy GOMWTx4KLXU641gXhgJuohKShI/zrhro4CpeoMVRTTnokyyLGsa8U5MDz4jdHQCxaPMukpfduEn 3GXMRjI39R0DNkG+y7RNsX41efFcQCMhi5PZn+GwHDXfx9C/FNcDE5tp/w5W8ji7zxy/5RQEfq/ Ko5bvUDVUWKrJEDY8pXf2bVXaHnxv5wJ8cAdhjOmjLkRd0vEil+0n5f3FGao8/cxjOQJVClOJVH kWg3va/Ry+X06oEeROKA3s X-Received: by 2002:a05:6820:c8c:b0:694:9d3d:e040 with SMTP id 006d021491bc7-69998d0daafmr3414028eaf.31.1778120656431; Wed, 06 May 2026 19:24:16 -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: [PATCH 02/25] bsd-user: Add syscall header generator for FreeBSD Date: Wed, 6 May 2026 20:21:56 -0600 Message-ID: <20260507022219.44171-3-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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: 1778120723764154100 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:40 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=1778120666; cv=none; d=zohomail.com; s=zohoarc; b=cY0xqDOIbx59eQ1UVk0DVd0W+Hh0FwxLyCNJRCla7C207fVXpdfYag3+91Y1CJU4SjhX5q26g1D9JZpiCvAT7vKZMVkyFygLMCYZP/rn7mYu1IYm7Z1Ih10mTe5LBXY5tiQu6Pa+/kxbwlMD92E0FK4Ffwz8PxOY0KfvZWkITV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120666; 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=ToFMdWG7//mXqzoyvmuCmfNoeS1TLa97EOAXuPjt3ejDmZ/Mjf03M74+1jXElp1g6zleWbWV46tz4xCoJH8HnfJlR17fnBtS9dzI8C+43CaIFHm5k4JgKB5ELkYmnW4kJzPgcOoXTl4a1MgI03InyDiu3tx6kE8SIgL3Rs1XWsU= 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 1778120666442583.3234735689308; Wed, 6 May 2026 19:24:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPW-00063z-Uf; Wed, 06 May 2026 22:24:22 -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 1wKoPV-00063l-Di for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:21 -0400 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPT-0007bY-SG for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:21 -0400 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-691de293326so189611eaf.3 for ; Wed, 06 May 2026 19:24:19 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120658; x=1778725458; 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=XMSExbMgcyVy1ozWAWmWi7pIFJ7vG7HjhW6JwsLxUFnnsOkoFmcZT1jBNvnIUtRQDb yEYZfGkWVZlivxRq9IhAtRmfi+5XyPsKP/CeDAhlo5QPc0O6gDmsbmk5VxV0v2Y05El7 gkv9e1/SI8Wf2qVDVTWH/YE92KN2xKT2/J7y8M82+ZnOhMMrIn4rcpSO/kEi5+OAV5zG w2S9EE4tY/N/xTD95RgDmsmcraYy59SdpTEutB82uYeBdArCsYRBASRst61l8FntH4TU dgoCMFMvQMBUeYOkjGqqPbRFnThdGT0X3ZTidj9E2v/P2I9CGVvLX9XsGzNtSIJp/TVr SPaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120658; x=1778725458; 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=n3kyl4f788t0HKEARwzwdU6BqIfcS9uwblLFBrPIodefiPz83JlI3V1SR9YvHjxtEe vgSEFkNlGwAV5blETy5/dmjlnDkKCZIvGBNdQgfrfOFbGGntn2gBPwtasxi035UoCWL2 BBt6rbOy4jP/ThkBp3DrQSjGk3OCvJ/kJBQyB7rY2gfboGy/zb+xlcIkvF/hN6ch3y31 46l4p7CXBpx7grUAi5FLXkaIceqhnEnSCG/DMIosbfj12vr51gfH5/2vXxjHtB5aF2w3 b8hYhTHQNrEeJmjOjq6TcF2vhwTlHYoHQnioKtEip8+uP+p+/UjNuB8X/9vjRMQw9MCl ck/Q== X-Gm-Message-State: AOJu0YwVxnK9u17nJ5Rim/61MyQq4H6vYkrICzBSO+2keDtyZ/UYNIZG EqFdDQfrfWmB5vgCGp51ga/cWtA+oERr6uSrj6EbDirKPHtO5K+PD+IKH1REO58VE2Ny1ilFqKr ucz0xb8M= X-Gm-Gg: AeBDieuSOg6xh6+SnwMHOqL+GaI1GE+yopduYpHQQF5PTize63UgSup0qCIATT1adzt S3jwEBk/tBDsLe37JoKDkIm6EsxRC+7qF0cs88nSJz+/YiMXcz8rM/CJ3dDKViBuB6eFnj7pf7d k78/MZcqJyj0vZ/Sf7GdDIS5DR8Bz2uFPQR5ty0oNXlDmZusZK8kJMGZEaQJLm1F4fNZVEp4c3G pROBsS4XT+zh0c7SY4yBPVFOMxbgjts0cdI3iEbenrXJhSFKTBi3nlvOgdK0+l7ERTU2VFS8U4o BE/M3rjWNOPldGaUHjQ8JKIED8A7x8V0thBkqwFvo6AJI08RMYLsouYJmnBhC4HCXdsWvESbUDC JgdoC9yBZfNvrELWFteNncBTwI7kf2QTzOhHfUaPs37wZHLc12uGY8smTFTsgsGI79APiUd9mvd Ti5JHAsoVJthAwCwB2leuI0KWkCnpxmRg= X-Received: by 2002:a05:6820:1f11:b0:687:d51c:e637 with SMTP id 006d021491bc7-69998c8feacmr3450441eaf.7.1778120658407; Wed, 06 May 2026 19:24:18 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PATCH 03/25] bsd-user: Delete sbrk and sstk system calls. Date: Wed, 6 May 2026 20:21:57 -0600 Message-ID: <20260507022219.44171-4-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c30; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc30.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: 1778120669308154100 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:40 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=1778120804; cv=none; d=zohomail.com; s=zohoarc; b=iFhbbrcx8Uat9K0KAPva8fbbTnDb6h1AcV09Is0FZh2TeRcplCBaHWI2Hs0rT4QL5V2r1fT9opUG8tNxSX71Q7kc/4uPatCKI60jyRjExzTQ18E/IkXvfmAVVV3bDZ1N4rYxspZbX2UDfu/OD1KE/j2RmSB1EssN23pxV6z3qEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120804; 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=LB4Ha5MnFvbSiX1Rh3Iw/6XN6eCF4coHStvn1Ft2siLvvXfbvY8tpIbNrgIIOz/Z0kEMN20XJY6ZRWmwwacFT2eRXUBSHAoq0KMYLfxEYYOy7x5ohBQ3hJGcHaUBjgUiInZkKOV4LRHt9K248aUU6m1Ph9q/0tzx+4HAu3NIvZw= 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 1778120803989753.0482773353176; Wed, 6 May 2026 19:26:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPY-00064n-JP; Wed, 06 May 2026 22:24: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 1wKoPW-00063x-Pi for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:22 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPV-0007c9-EG for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:22 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-699a23b2b08so141674eaf.0 for ; Wed, 06 May 2026 19:24:21 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120660; x=1778725460; 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=zva1G04HSZBopuAwIwqYQKyZvW/2X5fQ5rpvs+yZ3dIYcQw5rrpeUCUT608kI1ykRd QcvEhOBwlWnAqFz+Y04O8Exq/dloHqfKjKwQaLfknahNh4pwEj71IGT7wFaa5sQG1bDD OrZRrWvUza5XW3CzT5tGX8S+KOnEWQvgnqBXAghE2tPFdgwdZiK8Sjl8iO1Z7stJ6VfJ i11BfcXIXw/gXN2AbmzrrGi/G5E3ldv2adQYRGqR7tfnBHlV/AbXb7hrOL+Qxp3YP9Gr rEh0BNvJkvE2jxdCO5S1lH671PomYdDKyatrhkpfZVzyFAxPrhTO/829Aa8Qr9lJ+zJ/ PI+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120660; x=1778725460; 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=ZBiLTVZErWOQu/Ka7EHreVntumPcN6QtcbyPwLu7KOJWMrr8KqXPO8h8URb5aZd5lz wgLaXiAvhdBWl802awakD4Ke7LQjNg+/KxV80x9EOvzfmLhkfUOSrozVlumjchthCnG8 D+LJO1xwco+7vxurUk2rTaqz/2EtANyPhAxfV6JAAyQQa7JcQZIvAsR3rT71ZqbFd7zH RNRONE53mxXC79MPt+IL43YVbemRuNgGsVuGBLELMp76oO3wZrgg+kqQWtd/w24rIadV kTjDWpZcOGvD+o1vwcncVxjd5fpwqcJ4HZBCh/m9iGdp9El3wpSdNYDBRuOrPYvy2qXs hYUQ== X-Gm-Message-State: AOJu0Yy6Kl4zweDYpuP3WMfq6sIjLnChCMQxysxP55gYDNur0FsF909V /70WMfYcF43gCKBUrlmK0c7+dDuQXPs4kX7z6njqkL9j8Md9tzda4stGra6W+b2W4DRodQ8kgM2 YxQe/yxY= X-Gm-Gg: AeBDieuZOpETM5RIRRvUdvi9kNho+s7NKvf8DxfthxpC5aEuEoEB5isjAs4rnvgfUHf epQ5M26VTNLh8+t63oPiu4iYbZYZhou/TljUP0R7qJhbpclw/y1aKw+LgkJqmLto4pNzucjE7wK zESq8HQSKmZ1cD0XBdmOVrBCPlm3ZQOeNWTLamanSgYCBTLnyoaDM1ZmmfzNDf6WetBjfAg9Vyd pLpuiEanpAtpNwSF1lSFT3ArqjeDL1zIpb+V4SX+8sBKGvsrGYzUQTMwJyEdlXBOPa4OBX3m/K7 QhOWc6tB0SCMNanerbwunH3KiVFxaVzvNrLTK6q7Lj3gAqvholt5Y52v5EGoTGkTPvHdFRJ7KRo +VcIIszNushI51IDmdFSpDZmfIHe3Yq39iZNbi0hA1oNQ0tjx0jqD7btovvSxvNOqVRKATMcWo8 td8HvjU0YHYXGhjg7d+bsJ5rbLGiGm4+2YC8pPg8dI3g== X-Received: by 2002:a05:6820:2902:b0:692:a19b:af68 with SMTP id 006d021491bc7-69998c95db5mr3300512eaf.5.1778120660080; Wed, 06 May 2026 19:24:20 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PATCH 04/25] bsd-user: Create os-syscall.h Date: Wed, 6 May 2026 20:21:58 -0600 Message-ID: <20260507022219.44171-5-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2d; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2d.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: 1778120806240158500 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:40 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=1778120779; cv=none; d=zohomail.com; s=zohoarc; b=FCySsYwxuVAsuTse+oU3r2U90vGFNKhkbYGH2RRCh0nXsOU0paJ2qmGS6CaapTMSeuq5Xv/pNgPYkV5/ypeGVwr7EmnQm166RZYZi7HVamSY6agj4WUDhmaR7ZRLpsr6Vs81Yuf/4gMPZaJen+B/8CxS1YV+mSNaCaKKyBoTKIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120779; 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=nzCwfwhOnIaROoZuYawnkaseYki+Ui9+djclIdAiLhgRjWKbg3W8S+UeuBDbt1z7OyqX2OJuX8279SpIaurT//ko3lTVb3/+lYx9L+gAtrJdJhL1jrmbNNa3SMvT/YZfVBMF4j/R0xWdcvseVEW5HeORlEkbe2aNT/EWyVtbZMA= 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 177812077986321.593178621613674; Wed, 6 May 2026 19:26:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPc-00068L-Ez; Wed, 06 May 2026 22:24: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 1wKoPb-00067t-AB for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:27 -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 1wKoPY-0007cS-3x for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:26 -0400 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-7dcdd1b492eso307874a34.1 for ; Wed, 06 May 2026 19:24:23 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120661; x=1778725461; 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=NKgvv7v7b3Zpx1osRJVgmQbSjLsz2fAvTWo5Wz3EtPCPe/IeDGtnOL87jFStQWEs2P I867OpiVrMfMGZ7iPXNG5v03PuPyjvjW73dFiaHrkwX1VYu5NQfwTxsd3drc3cW6Mjdm t7dgKCbuoi3UvYXRGbq5+RyOpoEBFLsuK0LdeCHjcRgxmHwdRq59qxBqDmL/nXzpU8+6 FJ4ZZLgYwoWmcokQ660X+b4jAXUbBCQ+0TsH0Tw1QyCWctJg4+5x3Byj3uN/39mUofQe OHhCe+L2s6T+YM5FOsn506/vWsHxJB+surP965YjAUTzgmWePsDVyveLY3e/AREVRFrS ULHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120661; x=1778725461; 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=e73MO4hK2zhuqq0iRxIWB+rtOaOlIoFdZrQEEwoaD0dIf1cATAvfJ/4oFYhvcqhiSQ tdfyJefpgmAV7IIRXPrfK+s2Yc5KomSD9YZAaw2HdFUGIUm2WrM/BhYSIPKsGEdOpXcn /81ZEodrZeWiSkJ4i1lvuF2Pgm5a4lBLxKn7NDP3ti/75xYiXJhXE2sFu20L7qRD1lAW nx2GdtQ7UD4jernZtt8rtwvWJdxxp4TVWlmuoYzQ5n1BlKK+5RXcsGPebyifofB3mfQY vZCW6+woYToNpu2K+6GM446eXuGAYu5OhjV7HAwxdr9jZAOCq9C9dJxzxCbmxk4cGVGX wZJA== X-Gm-Message-State: AOJu0Yz+ySfgkZxvl1bO+oSO6gY0QR37Rm7G8xzRy4NhKs70KCIDK3UV SRmgs4+blyPRns/1BIJnvvovEaaPf1O4+bFF/TeU0sBQtGgrXw78CHYxj+YXkMcLcVV0eVjjWyg S+0FQwWw= X-Gm-Gg: AeBDieuCF2TnA1CW9OAyHnBu9PufsVl330FZEfDR/eRa55vEtVuxQa/JDs4lQkCBSLD lrChG3DF0Lv4hmb2gigK7d04fOqpdVD3cd7FbxvNPjChp3PCm2AqXdWSvVTFuZjRHqmxUXAt223 7ag3mZr2hIgBvCN4R8kSqapDJ9yCS3ItN7uUoUfvvIb58iY+Rieoe0lRcb8dr8ls3NhpoKVkswf 6mnC01cCJ0ntd0lWn2kvrOJdjpds4T+Sq0t8IJvPrsbdHwYzUHyVQYdSlD91qfnrOYyegIE52hl yMDXqk1uHKLN+Ri0D06Et/dyd3k2J/zCXT/kPp/bHwzHo7+qvfovday4+vh2NAdzZy1OwHVNRje nPmXFvy9Mmg2bPPqGGL89916nTQXNRYMC6CzU29z0UxUoAOhZIFI7u2Fuxb0DBu0Bt+Uvd57LWj zGxPeUD3iH45uQEdzvT1JY X-Received: by 2002:a05:6820:a0b:b0:696:711a:c1b8 with SMTP id 006d021491bc7-699ab62acb6mr612977eaf.15.1778120661495; Wed, 06 May 2026 19:24:21 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PATCH 05/25] bsd-user: Switch to generated syscall_nr.h Date: Wed, 6 May 2026 20:21:59 -0600 Message-ID: <20260507022219.44171-6-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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: 1778120780155158500 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:40 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=1778120711; cv=none; d=zohomail.com; s=zohoarc; b=YT+n3UB9sQctaN0L5ppXEN9murqSfg0eR/Y6Fm1EuAyNxrS8hp2vn3ORThmRx7126Jmpn+MT9YmuGDznmILHX3zkLcIbG10nA2rA/BrIMFXwOY+vFNNVg9dYfZ9zdlVsDYPPRO4xYEaXGUmRS9H9LR1vZaB8hUr/AHXPCE/DkW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120711; 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=HmAe2prJ7VPnumCFjgutorjnKzgdb+kbQaN6OLomU55QhyIFOHiZCM5GA/aSiDXH8+agL9+P45Lp/TuLNShjZP/dGoxHcjzbniLVShYLEfLeP7PxSaV4tyfFJDrIa4l79h9s1k7o7N8o/s5fLGGuFPKDvar4O/rpT1466a00uAY= 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 1778120711919218.76347429611178; Wed, 6 May 2026 19:25:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPd-00068t-5E; Wed, 06 May 2026 22:24:29 -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 1wKoPb-00067y-DL for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:27 -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 1wKoPZ-0007cY-6P for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:27 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-7dbca22dbfeso227759a34.1 for ; Wed, 06 May 2026 19:24:24 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120663; x=1778725463; 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=z2ma2ZzDB5pV+YviV0CwraKSpuxMVx7vJ3F2rKoqH0WjaxmcEiYoSSl9x1Ijy68ydq eNVB3OJ05lTmQHesJIuVkkV/lqlhJamZCIfkTj/N+Sdex0g8H6oE8X+wE4G5yIvozHiZ UhatL5LpVVPruX5SVsZDOWSZSNepdQf/6hjecv8YXGWkUsPoXwuQm6iD9uIi0IO7FOUx luu1smt8tqJZjG71RB/sr/IL+m8DXNHo3Kf5IYp7DQH7CCti6jp3Os1sVy/GIgb7mI8w Z4GeDeIAOj+ncWPLuHjgG/QO4uNXBVLuKpxNz56mxbmV3pyDSLOfSwBG5SQy/OaiFKQ+ IAsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120663; x=1778725463; 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=gnreWHjCNe5ucxW1tfrMhTsWYk1DFkaXujtBc/g+iHBKlLrwpGlmk0yjmqt5QS34My MV0YFF0QkD0jaqC7m9MsIr8qceXHo6u5MEKKg64AAjtTo7CAsfIldMo0VmUFKMumY3Kj nmfipGll2kNDSvnl098zKvjDfhD3P19umWaZzIX2yFJs1B/xolN/mcTPnqeuts3+6Fl5 0OI7mmMXHk8ySYj2N2JHIWLhaIuFIEBC+NQUy4OlgQ+wnIi/0x/JrxMhTGpmc3rZBkat bl1pIfmmhVkhP/YNI4ZKAIMIp83CtkJBFmVFrH2hdxl2gP6j5FXbEVG32XBvpE22CXkk C57A== X-Gm-Message-State: AOJu0Yw0TVa4GdgmSzG3+UZvjxlOttPqwAOfn+44LVVwlGifrFYeBXN3 Q7clAJ+QwC1ZqTsoOkw7pzl6mCOjUqosmhT6ApqlQpRcjcW8nwIqin8ftTupJeaPXh62egzBzp5 CXL0DLUk= X-Gm-Gg: AeBDietYZoJhnS/+aWVl3rmoCyxtKIODN5LywdKkZ3znFc8bquaiwx3YtxouysLFmah VHuQGtwS4e1Z90q5OwlQFKzOh6zY085E8PJT23VmYJXTH8MVUq1SY3YbXNQ1XH8JN1RJZ6qsKWS aUMsDy1uB2OgkND3F+fr9DUANBIBPjq0hWzPlLUbg0VhYZ6KexANScFqKEqLoNNmnodfyHjSlcW 7qUr/KToAPaReJF79L1ZBqHNkr1icXQL6DUNnC3c4YFgL5dyjLW0wz0lfCDfD/DKIN0QqWPLt1u v1p64H1LJpDRwEXPYp5dTBAvwN+1/lcb9Wi40l8KEugQEWGkmdglEK/cogteA/tDeCNpXbqctnV lwe/HDLHG06Jui0UE4lgHumY2DYlt9s9mbgzO8LP6ZJ8ZBcYr4+WBai7k95AOVX69+JJZiXhDhq N1Nvx3AxRDZAKmq1WFYZ6ZFGDdNKF1Mxc= X-Received: by 2002:a05:6820:f013:b0:694:8b4d:5f8f with SMTP id 006d021491bc7-69998d6a576mr3177919eaf.57.1778120663202; Wed, 06 May 2026 19:24:23 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PATCH 06/25] bsd-user: Copy linux-user/thunk.c to bsd-user Date: Wed, 6 May 2026 20:22:00 -0600 Message-ID: <20260507022219.44171-7-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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: 1778120713707154100 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:40 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=1778120703; cv=none; d=zohomail.com; s=zohoarc; b=O6M9U/LuMSqaQdGOxlEADFHEEuyEUFFXATssg2DA+L30xSsN1T01LrS8zKpY/S1/Y5EQMYKsLK3wYqATSj8eIS6s0q/5KTPSX1BIn9JmLRVFDqWj11CdFNRQsbqNB2RZVzhIKSp9fFOVTvTZ2SQXAXLw2MzWYwjo/In9pE5qvuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120703; 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=TTfvkoO/65xuc3Kd+/0HFvT8RkKMIKxgy8SjsWuIn7L/V5omf8++JtuUfU5axtzFywdl66Gq4Bhw31acEvzKJR1aMDve4q9mgHFIkXSYN50e0KWt5q5AOU6Zp9AUo4FIJe58JBuIkhrA4olKv2/eMuyYV7f3PjnZ9l7I2MHa92Y= 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 1778120703370137.18226232188624; Wed, 6 May 2026 19:25:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPe-00069D-9V; Wed, 06 May 2026 22:24:30 -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 1wKoPc-00068T-LY for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:28 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPZ-0007co-Tw for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:28 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-6949192b840so104225eaf.3 for ; Wed, 06 May 2026 19:24:25 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120664; x=1778725464; 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=VxC5euSbCUrH3XN8W3fIfViRrQYSp7OOyhf5pjLJCldrDZbVyoO4WFbK9D/1az+uxU DqZ5otIG+adHs+2mopH8XK7pz3gR3sufczJMPxfxJfZKTDBrrLofTRoI7QENu6zslE5r QWnqkG19Aw6g8QFBdLiISNu/egHzwfvP79XjI4YMoslgbu0ApjlF9/80A4yUB6OQScgT Q/RdUNvpKbWmkgE0U4qiD7PQcl4nxDsT6NFZA146YAOhDGbUYw3C77JQEKiRjCs1SWAE MxxIrLcjv/Qkq/nzw2LT2wJqE5ofGWNtVKHzyZmD46t2SXiAFYeZTxrqrJV/SBOB6WIX 8Img== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120664; x=1778725464; 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=BjbfSkGoAe/dypX6wvvBkCYUaEfPIZ1H3nOikKoTFKIMzOl2iW3KQXNqxEwo7Aq4JY sU27Nw5RfcBV0vbPj5tBYbNL+l/wjsmILCMhDi/K8uffm+GogZTJOvuKZO9qJLPnoFp5 pT/HM3NGw0xWbJf9bW+LN2Cs6f7ulwhdQrBETicKqDhxjScs6FrFPgsWNHLhmYB9rRLD 4jdFt4j3sNQ5hsRrVUUAe8d7GVYzh3a4QX8/ooHdAUPz4MSzV/2nmTEnY2jDQg0RTe1C 1sUzo0Aer5vmNXuoVz8SLqC+zAHMiX150sGjHF+whr0NxoGcDoaq+W1kwy+Jlb/PPCMJ p/AQ== X-Gm-Message-State: AOJu0Yxfb3PlmzX9TdTfjjpXUVzxOVPzIfcg8+8u4ldq5/TE15AUU41k bi/JPD4WgmeNuJzbktZg7Z7Ljv2+YpLEt//T9iBNvA1lSeK1PL+tiumYQ9xzivH4m2Q+lxVKACX 7P9ZBrfA= X-Gm-Gg: AeBDiev14urFMqe1SGkmwSNaCmGum9L4ttIMjt2oM2HIbkHJBSW7q763oskdVmQZQ5w K94jbebycKBHBM9Pg2AhZZOGvOnTMFkAlMo0QFvK1/KrDp9gKaId/aK+QSMXbcBQ2jBvlPUHFNi 66Cw2Ld9MCJWXZQnBwdcP3pU6v8TZQYVKDKoQdluUYdEczLjznWO9o+rBmmAZHwNoOQxcyUyT9O NCySRSIcHTV1ybspLVK8QF921vFKCMMUZuJ+ARYeXN7fGjL3c39wA9jclkDppK8b8IH4K3Xckd4 ONXTugbpO27a1082lKgTmiRJ3F/KdHqzvQpRYsHaGyIuPOOgngU+FoH5IV9gFprzmwd3BSNz3kv VTjIXcIHrjdq6r4L9AyFTGeyfpI0gH6DRc3Z0bqgZ69BolGf+TKRreZQ9ApZ+G8bv1bXWDQSOXQ G5AQzac4yokLDcufmBOwnn X-Received: by 2002:a05:6820:16a6:b0:694:8cb0:4efb with SMTP id 006d021491bc7-69998c91a22mr2963500eaf.8.1778120664471; Wed, 06 May 2026 19:24:24 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 07/25] bsd-user: ioctl: add common definitions Date: Wed, 6 May 2026 20:22:01 -0600 Message-ID: <20260507022219.44171-8-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c29; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc29.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: 1778120705524154100 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:40 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=1778120691; cv=none; d=zohomail.com; s=zohoarc; b=GZWLWVO/jlsOku2Mkikaj3nqMSm8y1A55LPcqjZalY1vehBiX07rOvvbuoUtYBvVOA0HNoZmmUL0NUf/bHdkymtHVyP1kUPDp7j0+8o9enAH10SEhAkIf2YuF4FFegI3lhT6Pc1H76hgERm0hdrLHu7Wf2ulZNVOXyeH8n42bPU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120691; 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=iWkW+L3ikVRQY40dXQqf2CA0oBPnjoFFRvfDyrIoc59jNwrz4NgHCap0Vflgs5M7VjfT9EQ264VxAdTpRTfiOgk2CpVE9btyR4Rvw/xdGP23+UEgKopxD8QlOzSbIeHmImOMzxZWchPTMARsNUiB3Utdc6T4U6X23/NbdbNtdms= 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 177812069117728.947084880579496; Wed, 6 May 2026 19:24:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPf-0006C5-Nr; Wed, 06 May 2026 22:24:31 -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 1wKoPe-00069F-9X for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:30 -0400 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPb-0007cw-Ro for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:30 -0400 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-6948d7ccfbbso140965eaf.1 for ; Wed, 06 May 2026 19:24:27 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120666; x=1778725466; 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=fUaQYCEDjKl7sMsQUP+XfvzPk0+nubedaj17wqiZ+dO38JPs1/LyM+BwNH4hsZKYkp t9GDN8gEoHO6HoGgcRBlFMHj/OaqdCih1iwIAcgcakZ8VKMO2U+j0GEqmvGiGit3DynY 4XWGibpE+YmY6dReMeh9VTEsXXfW7RcqHhCax7+m3qKNsBHmvLY8H0iAhZhab+7meWp/ gr5ZSv9Hk9yQqkkTBZIxwLKjeNdrexv64Rdtah2ysSNzEaCD0EFwokLrTxfUHbg/P3Ck 1x1jN5j1Qd+o1UDfB5Hkd/Bwf/kStGDEKFt+hEUSwBpElC/R2VbACbfP4v+MJPDkLGQu 6c5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120666; x=1778725466; 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=LiTlK/GTSMEVEWwqWSYbSApvmN6AftYIgGvGqWx/B7Ow/OI6p0M+wapEOzY90YzH8Z glUXKPo+xtMzE3E0pj0TC6kpLEeyCfLxJ+kyyVXU8agBtXfuD/Kq6McWbQYNZU6mU+0H SJouyPiDd5U1QBwtWTh7vi5hOuOrarDOB73eCtuEgLRkoYJKP2V87zvc2vMWUpnD99bb US/c0ryWMRB5HCcSFm1AJ8ZQiJbSOqxLb2rPnQ89pgqQKvwcBTL5AlXOMfNGMpGdc9x1 6o7iYMiIAAgtadKgybbSCze2gCcAsrjWFL84MPmDrsTaSmKkSJVmU6vOSBimajInAn4M b2sw== X-Gm-Message-State: AOJu0YzAPiGvtVMUTpFOJbTl1FM5kuDJzL0yLPU294+buSpAMRpUkb8u PZUTDN/JtFMrCZEHh27HUpv7Qe72TFLvcW4BfHbdbS6g/uva2YDYQRTgLBUL/ZXomnaDopA7iZs wwhCXlE4= X-Gm-Gg: AeBDieunXcT4mmCxB43LtVeM0C9gywtbk0buvJRgwercoYCfHhXZYtKGy0ssYaeIBJf 9Et7FR2ng4Su07kB9Pvh++bxtLhX9eyVoIHr2WKckdzwiRwWrqRzDuT7Fw8tFcVHtDsEaa0EFO+ 7nSFbC4a7GgzenYoQb653DSL7FJcwTEjdMJ86CWKSsK5KeRcBW3lU1tNTUcchryp6KbB2puSsaC st0hIGxWBHGzL5uJv1yY6yYPJl4YGFYtM/SCwGO8qkJGMZ7XWJ9vWK7w/PPJGgquN/8pLEhbx9V cdUGMz6C6Ox+FPINZBC/i7iy+PO/A3EOpsssaThxbxjqUJpVgg9HyvMtLFXICX2iQWZrgtdAhdD rx6dcAvibdnuYpMR980ngBdaQkdNEor5AbeIwHlhhk2twOUxCMXxXVnXwQAWbQ9ZwTOYmSDd9hM XI58GmjJPzNbce7zqOQrVnSmC7I69WY44= X-Received: by 2002:a05:6820:1898:b0:694:99b7:1a2 with SMTP id 006d021491bc7-69998ccaa03mr3469622eaf.22.1778120666271; Wed, 06 May 2026 19:24:26 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 08/25] bsd-user: Add FreeBSD tty ioctl definitions Date: Wed, 6 May 2026 20:22:02 -0600 Message-ID: <20260507022219.44171-9-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2f; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2f.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: 1778120693504154100 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:40 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=1778120726; cv=none; d=zohomail.com; s=zohoarc; b=hotlmkYboewy1mM0w8yUVfIwakuWkv7ZXThMDoEgtN0wQusdo9KElBPNvuAhSQieqlDLuxK7err1EfTITqWKbKyEevyti0WB+hunzyxGy1pz3BjDEx11hDFuN+ldc0reZN1u/bkjqZFHmYa0rzS8mzSQAhbacdqL7oqkogMoN8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120726; 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=mYuaTZhloPLXLKDAw+bRYCGn9qUor3926xKCY4kkqd2VVDR0u5zGXEIdEqDuZIxUGzhqUWUsWrbbFxVvgWd6THLcBmwWwC3gn734VFymEdYhXcySlw1X/695JNrCa+zfsnLMoYguW5TbR2mxzAmhW2hR3j3naaLomt+Yfa8zASw= 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 1778120726087363.94035544383667; Wed, 6 May 2026 19:25:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPg-0006D1-SL; Wed, 06 May 2026 22:24:32 -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 1wKoPe-00069T-LH for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:30 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPc-0007dB-U0 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:30 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-68470763896so187721eaf.1 for ; Wed, 06 May 2026 19:24:28 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120667; x=1778725467; 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=QYUabgb7NTBfxoo9QyoNn4WFpNmz2FGdP4U/hb7Jx7YqoObgQIYoJ3xK32poGrFvzu qJO9Seg5R6oUF0hFbPDrJyL2k80TpqjjtI06cD4dGjkSj1k/4YuC68Yu9Sa5ccDUH8k0 lTxf42O5J6BHyDRtOIAa7ssrQoWkHtszVvjWaivS+DcnCoOQroXyRoyMCRtdiyaS4zBb 39hCrxD5zwPH023vsieg+/1fwmNxl7QegMAqCRnfcS5aIT25V65HnKJQUZnJoDsySUgD cTVfFHNyzlBRK3/VKYT270SBAKsPghHWWtzO1Ye6HE9Xao1DivM2VYCxqACc8CiYeh/l ngFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120667; x=1778725467; 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=p6ihf1FmrIXC5KLExEU6aIeHI+TpyuofEGmqyalkw5LlqqZBT4dtY9IiO6ATQ5O7Yq nr1dQxEJVDYPoc5vy64fbMasliauCFKFGPam9/qOHF+0jvD3UymQwcYGrj4lvCbgMO7F j9hDOo21HA7PUjYPokYf77+C6tRjFPWJ/jc03GQ0ve6YQ49TAG3xV6R/aCfXh9cCWeR1 8xlG4iIIixdRBGt2B6EBrRTJOLaWeXUu+R/ExuY51RBsQT5poOGW7Ob8YXAglzoa5j4F h0fWF9fojLYbqQyePxFvN69xCG55ema6iiHc+tAsNiE9It6GTdGc7/2RMBH9wc4TYe59 VOqA== X-Gm-Message-State: AOJu0YyJDZijQUozKtVdFcziGWD4w9dmiSGSSGL7HTAI72G8ofyxxdF/ JHBusmsO8Q98hdXwgcV6ODPL6N1vZt3zJE3WOnYbj/nJKw3vCHDwvpYQLXVf90gXXjNtJmUH4go +JotM7NQ= X-Gm-Gg: AeBDieu0GZxzQBBFKlsET9XtQAw0YoOBHve7N7H3bFZxIvWIG93jDX6uIq8UFz4uwYk 16JGzFn9sIApyFt2uhS3xduFoGZleefZPAd3+r2YUCfLpEWk/T9eW+u6OMRyMrRVpdo4MJtchcK yVqhCXpHIcqigYFMy1L209/u8chWM/qeMbAHlVa9nDG1yFbkE3KZltbnwaquVXSFAhI1J1cCEno DkgTiPGagYXjdbE851lOusvUNdiwY96bYivO7hdzdyAPdSLm/7eTeHzsa9OM5yJoflXodk/1ZLw yrEUE90gwRFNpsTyoVGFVE0mFH4xmtKqlZlSXeuvgPGXfjCcPEdwPXyySCogN06c55WUm0wsUGd 0wFHmMDpeZ0B4Ysr98ernyvZg97UIr1bjJBXOEOE6KfJEtKhq3BKeWn7ut9woG/lkC+tGIlrg0j aixoG8Xs/t2aUPO1PaY7ab13v7XT11lIo= X-Received: by 2002:a05:6820:f024:b0:688:b73c:c41b with SMTP id 006d021491bc7-69998d63c30mr3340022eaf.49.1778120667335; Wed, 06 May 2026 19:24:27 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 09/25] bsd-user: Add FreeBSD file I/O ioctl definitions Date: Wed, 6 May 2026 20:22:03 -0600 Message-ID: <20260507022219.44171-10-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c34; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc34.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: 1778120727754154100 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:40 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=1778120834; cv=none; d=zohomail.com; s=zohoarc; b=nx6kxV/ZHJv/Gse/K8TrRyX7DsmFa6GpPWNM3rCW6BWPCOhmMUqUpTZi9iWlkXsS48y4/AVTjBRLrXwqTVjQDXBpY7V4VDEYV6ztQhEi8TdwzZdL/1Aj8fYP7L9102qIapBufpPaE1XhMGCgKmsiflJlyWPLHdnfofDkmFXypsM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120834; 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=GQSCm5Nc60eNf/B/t3oCMCA0ufqPfLR/uRqcPlBcBvRC59YWzf9bS2s24eYtglq0Pt51dmmCuwWeyJLbTAMwuNgLtl8FAUji0J+UVS9Lo7gCu3wchYFmXSCfLPCUpNqIEjOXgIGNmrIEhUjVXSgcGP2BBB0UbmB1TlgvVTYlmWA= 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 1778120834829698.3735580050018; Wed, 6 May 2026 19:27:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPi-0006ED-79; Wed, 06 May 2026 22:24:34 -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 1wKoPg-0006Cz-Oo for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:32 -0400 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPe-0007dU-My for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:32 -0400 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-6949831a7bcso184805eaf.1 for ; Wed, 06 May 2026 19:24:30 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120669; x=1778725469; 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=G3XVmYumO/Y5NiNgfFNlD2LaBjrbZnZIZX0y+we9mF1stYhu6I7kXb34gznrqt6WZM PS4nslY5DVCVHdU6xG6ewjSSNL/55+YnHvwIWKRoqVx8vsnF107uJauQaqg6+3OXlpfH h2EoiSTrZYtjrsoMZn6MijbRBNb69gWnPQbQnkmLl73W+5vr3aPN4im77v7zJyuhU3Td 4Gyad4lPvPocDQh5XzyOsVxdPJcVEdkVUwPv2TBqNK6NOYDRMvFY+tPIGAfrl5hYe1bu XEOd/RFaPvQcZCa+xaGdyIjziRyeN61ldXdOqpEF7C17ttM0wRIfmkrfKnDO0GuTYGUm h1/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120669; x=1778725469; 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=X5vEipz+dtom8TwuZaoFgO4C+VKs+m1FEpLcRR4tYRkWs3/zoQ4qspayKje3Agqeow LVJpv3DQG2Tbo+rsa2eDJ/7Qr/80Zk/PtWc4gzWwVfEXeg1L84gm7oTk5z2cskzQSSQu aPxiEhtsecE74UheymbhZvXi9eAYsp2brwhVYPPEsSMuwLQ0tD53eVzWkEjyRpH/+xkL WhwPvCQndRsCOX03qn+VSYilmvWEc67x94K7cGmETx4ym9tavBN2vdLdv/xwoPmBe0Ny 3fA12X1+tGUWtj5gwNTj3EDTdeR55BcAG4bZAcZi2FQ7V0ousxNSuZ0QQZcFyuIJvydc llFw== X-Gm-Message-State: AOJu0YxtLlZnqm/UUg6gi/ATbFxXe/oFDZ7o9taR9glqDDp1WGgw4+2D UGMImz5v+vic5HcMZmExIz45A30a+Apu1F3ivH5wB9wr+BKEG/FZslArPJQVWrIhU6u1rawiEcT hpY+HZd8= X-Gm-Gg: AeBDievnc3zihV2htwd4llpKFQyQ2i1y25R9fluurih731TLEYEx0I3hxprjdolTMwQ y+1nKgFV0yJGCnnP5yz2JhjvRdBWNEsRw/42Kmcv8ojyD7th9YKoWbD4J7aIEZ8kPFmoet5c+wN 7p03lydaUZvSM0+L8PRRNXu9bdiJw0cCajkfOutK9w84eI1YWiMix3GX3GCPOx3dqj0XILliVRc TGr636fJDtPvQLz1cTcG7OZdOvTQ66tpSRLnN6Ft/C47bL4qjmuDwTFT+x2J+7nZ36G4HakKprN hCEAWyuC+0O9AuAeAumG8bIRS13r+24fG+1FOS4maa3ZQBzWudyyAzs7Q2XQvCpa769TtVrkr1a kNle6OuJg8X84q15NO48PQXHZkImzzIgP172rI46aqeaTZjPKhagr8MRZFsNphmaQTGVn6DD2Ub wDsKRPG0U5Du7qFfeBeQSiCY1ua0jrIeU= X-Received: by 2002:a05:6820:1789:b0:695:a638:c6ba with SMTP id 006d021491bc7-69998c8c89cmr3437844eaf.7.1778120669075; Wed, 06 May 2026 19:24:29 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 10/25] bsd-user: Add FreeBSD socket ioctl definitions Date: Wed, 6 May 2026 20:22:04 -0600 Message-ID: <20260507022219.44171-11-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c31; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc31.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: 1778120837464154100 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:40 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=1778120679; cv=none; d=zohomail.com; s=zohoarc; b=FP2UXZPbpqF9Sxmxb6t+kv1U3GposZx45kSUFK49/l/U+rhCSD5VGk64xnS8VAWpcdeJzRl2k9RTED7UPfB6rD5V8HUvatrNBscmCvD0rIoXUgjrZc/43Z+rXZbrccCqO5zGyLpNuo7GeOuX++jOfSVCZaN0Szc3GYTAgX8H/dE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120679; 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=iz6vcXu4eKel3N5XYuIiL7lwdqQp3GNBvskOn6bXNm9RK0dSSJrweBC73Szo/tyn0tA8YhaspsWuqhdOztsYB6/kxcDpH9E7vYH1WYuXFCNcuh501feiQiOYFABJNKzUUehMCgjluAE7yEYsVH7YvTh0yt6MnEiAHz2SalETngs= 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 1778120678959186.72545612829038; Wed, 6 May 2026 19:24:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPj-0006EZ-8e; Wed, 06 May 2026 22:24:35 -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 1wKoPh-0006Dv-Dy for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:33 -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 1wKoPf-0007dj-PC for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:33 -0400 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7de7dc85b74so328799a34.2 for ; Wed, 06 May 2026 19:24:31 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120670; x=1778725470; 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=WVUMuXbF29pyLi44GBvZXA6zKfxkqFGE+AqusvRG8IeufqBR1XIqssV7kJYzoWOXhW /upxBCJHkG5MTwAwMnstCcbgRV67z/GJOXZfNXHPw9apGN4wQb1i3A2wD1IpQH+QYT0y 954Y2zgiKl4zvEKCmwbM8FrmBT512tMCP9gUG9bRVq3YXeRw52kpl9PGeats78lGAQ/E 12M/wj7Ir3wZxUHUnqMrtB5Rks3AUpkiarZkxZH+HfukinsFbuG21/xzS5aMvLY4aF1l B2OMoS/BcmnKm6M3W7SEmd6yoghastuh0tUgOHEdzybeqTys51XQYqseo2WPidAoD4jz jQhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120670; x=1778725470; 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=AkRWltCA/KNVt1/J1wt5la25CiBGhMVoWoC5IYY47ixfavj1hDqWSfk+8UnmsRofG+ tRgEpzbQivnXX59A37BRocf548UT8Wz1N1BhhQqw+m6oowJgdqWAi+2KFxFUGLZcs2SH SgC7+t+sKzX18/JZiDxpSC8ir/x1yHUn742m4o6RrxD9yxRh67+EYZZaEabQHh7/RHdB 5RO68QRt48BiMNM4XXMEiq31vgJC3rSj/fRsPosIdIelfdp3fXpDYno6WFSnctGAF9K2 1DWe59tRJSuLuppgf7f/uxGPYifY91F22TFdGgXg8M+YubsowuHuSDKPdDbRDThYqj/N 37gQ== X-Gm-Message-State: AOJu0Yy4Ka4qSTVLQ+BUMpFISEhbdoGXxKyiupRXFGaXjV+QzvkD5NTI jWvAR1pFLGXTDlc3T5xFisKb7ZK1aWZAk7vuisEvGji9hrUC4QIo41DFVBxo7M8BRjypJ8fr+/+ paVJlgcU= X-Gm-Gg: AeBDievH7DbNlGxb2Vc4riEh0kNFEBwGIlRutjceaHVjz0r7HGcdteaPYy4VWJwuIST MLoOMM8eWHs9HxM0j+K69MY3L4ufwEPg2s4Ec4rOLei6WIkM3ix9foFaGST+hcy8rfb2Z7Aivul hIcqQ8hQZHOh6JxKwjcpybZtW6NVggWy7/CVWb6Iwrig8dl0uc66ivdJo30qdEYEpoGXkpxD1pP l4sDq4mL6jvV+YbQrulMqDS4u92hp1o3zyUiWdkcfTyOD2m6SUktdWLMu65yYDuIkxnxT6/xLHG 1OJ40T53MxG5SjLArWbKwyuX5UZCcNQ/aW/vO26donPi5jBITCh7tjhvTbQC6s7AuAAfKggfdAv N1w84g2hM1FA7onrTWQNGEseYR1geuhGx8hZ5LLdMgwbDO0yknUvn2mcR44PLWVpgcpnAiMAZJ7 gkazeLwG6OMolkXazr2Z8W X-Received: by 2002:a05:6820:3092:b0:694:8e28:fd87 with SMTP id 006d021491bc7-69998c83794mr3053436eaf.8.1778120670375; Wed, 06 May 2026 19:24:30 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 11/25] bsd-user: Add FreeBSD cryptodev ioctl definitions Date: Wed, 6 May 2026 20:22:05 -0600 Message-ID: <20260507022219.44171-12-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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: 1778120682855158500 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:40 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=1778120689; cv=none; d=zohomail.com; s=zohoarc; b=C0Two5MXEnQWZMUoF4RY5XWHhCvVl0mgUEyiClYDY1y2KrnhE0cbZEzQUo6d4C4H6SNOCuwoDXbA+zUhb48SzpkSjgqa+xmQS05z+cCqckzEb3kRCn6rU35j9Bu8WFc+Aty5BBrBW29FqyEvZz5I22F3lJk+VTPTO5edsykVGis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120689; 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=W3+l/smX7qLs+C+LRaiUZqcDcCeUJElInOhl3UXTd13d5EgaiU+nAtjiZJJ99Sztw36DZQRWCzrYimmZIs0x7n5n1pQEDoH0MhmCC3Qy8xPtwGwf0lFQw5QGLLt0BZK06dqsIBdF5u0HSZyLgj1GcNtV9jCdkoWfWrloWOBg5PQ= 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 1778120689092661.4489572621643; Wed, 6 May 2026 19:24:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPj-0006FC-NI; Wed, 06 May 2026 22:24:35 -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 1wKoPi-0006EM-Al for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24: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 1wKoPg-0007do-Oc for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:34 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7d55b97f358so271987a34.3 for ; Wed, 06 May 2026 19:24:32 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120671; x=1778725471; 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=B8Fxo4sGf4Oic7AzORvdYI6k99dt1Ez1aDkkSv3UHCGiadRRJgsga/d7+wSElTjxsa 8ZAxza08YtCeIfBHIeGvXsAtjCNquokxwwBIzc9vX+al7EfwYZ3n1sNc7bsa8TkhSkPL UEQtQDW0gm5N0r+jAvCcBgI+Uz0rxY5ymxvGiYK2SnUSfdQp3yt1TKBJQ0wjBERW9bOR Y8fFYBc2uwAx4xy5Fc/OYW3OrUkZxeX60tCGtYnTBPhplJf/4ymvIaaV+7EuUpGRj7+b 6vmxxXUqeguZXwlH6Fzs35lS9qHkV6jk3LmD4o3Ww4a+2lwMrTp5evW0aiSzmrVe9+Vx pDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120671; x=1778725471; 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=lh9fOgwUAOm6z2pu1mk2orvazMp4sASD/t1IsRrqQC7shkzswqL614ONVSABkEdb9G Sq5OrJdf3ZQrSIHhgDLsJw0nw4rD2VlQmglZCnuixApS4xfv+VoteLfjX16R94LB+bZK DSI0Da5CoC2Z/i6F0kZoMmOXPFqcTRSMj1eQePMuJ8x6VWS4Y3IrXzSR1TMVI+UdDgrc yt/kaaeIruvJirmSLGvtbNxlLlNWMRLZpVHaW73xIjGjFxw873SLLneznE8a6iMJm8mS EHjw00fPEALn7q+0C64L5pSR1oPASMvjjuvNeyC4V27JZJGM4klRFj918d/PvkDbkzfe 6k5g== X-Gm-Message-State: AOJu0YyyGzqyjrdQab3aiV6wivfAfwchL995vBgATFwGDYeh0oTRhBjb XFRE5Sflvc+c8ajpK2HJHJrYvJgOONCyTnBWfZwVERFYBddq41aKNZzUpshQajqCRtfCXzQFLI5 i8zytCDo= X-Gm-Gg: AeBDiesUsrBZ6YDSANlVdQH5w8ghWyYyqL4+2KMAUYHi1G/2Ycy9XbbTQ90Qi371kTs DOyYEaFbTrgubRmTOFKdfBQaeNxiljSOXPm5vkWtqtPxeCEGPTGZgWoaMwu5ne7MtXo9AoUZzOy kNwz8meTeVI5ilgXErJkO9gj4HbtmozFwZmqVeAvtYbRe0C19ZyKH4/VG+nscFL/4LG23DltNM0 z1tCOr0wKNHYPBhhlsmsfoqzmag+D5YgbH7cnxCwImJSV9V1Chr+fBqHwboNYYYhM1MfefLK+xH /KUB/zXvPme8OVvLRpyLHrePA4mh3tpNXei1u7/QDndWCiqs2DQOKkxj9rfGCCw632WUxKUOhGa DWEJAb3ggVQ5Tqw1dMvzT2e6e6r1ntZ2vE0H9AJ9Ash0XyGMkFmKA9OYJ7GWscagm4sn3hjQbsc JfQoL0c/FG3xZFHM9KWNoxHKKdfoSXMKA= X-Received: by 2002:a05:6820:614:b0:685:3561:8926 with SMTP id 006d021491bc7-69998d235c3mr3097949eaf.45.1778120671369; Wed, 06 May 2026 19:24:31 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 12/25] bsd-user: Add FreeBSD disk ioctl definitions Date: Wed, 6 May 2026 20:22:06 -0600 Message-ID: <20260507022219.44171-13-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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: 1778120689832158500 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:40 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=1778120684; cv=none; d=zohomail.com; s=zohoarc; b=nu48v3Iv6UD599NWQ8H2MNZehZkQfxURKpSBBgj6bX6lKJK/d0AOwToLqLu7udNumoMyCEu+kX95qH1sc7RGdaS4isL2QvnoJXrzi/giJPCMR7QQvWURr37ffuueAMvJJbC4w1+1Msa5c7xVwgCFN01EdGN6ovrAOEcial/J6RU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120684; 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=XnGPAkHcw+pc+VVGoQQeMXni9hC3BucmQXGh39rQTQaxwMAFAXwmuTw7oQ5euadBjQxslbo/H4vo175L+YgQKBzFzNGsigJ9rfZRS2od7FQQ0Jv7EEMfLs31RE7vu3yVn8q1Gvel7tVgtkZxTpM9yiksf/ckh9nMij4stUNYKyI= 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 1778120684325594.7294630732624; Wed, 6 May 2026 19:24:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPl-0006Kt-QW; Wed, 06 May 2026 22:24:37 -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 1wKoPj-0006FD-Pn for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:35 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPh-0007dy-QW for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:35 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-6967fd0416bso199982eaf.3 for ; Wed, 06 May 2026 19:24:33 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120672; x=1778725472; 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=IDBsNxkdlpWv4TLNaBRVtLX5D0WM83ySJY/s+00qkOw8ySNGNJ1WF9AV67OAAufmJb ZQq9PTjMXPLB3s3L2xfUW5I/2RKauHEc+MgYD/Df88FSmftZLXZsnLI0n/R4Uk2/dgX4 wEQZk7qG7vR4O9L7EXlQAxxH70UjF8JQ9ozZVYuBkXkl7QndJJniMdNYNikWr9N55YXp oFEZOLbLbrRL4yYbGj8UdDBnko3u0gM9gLwtQ++d/kzsbz9ZdICra7aTathgaCISnIfM VTrcuhemkwHT1uKL39/7ahUL5y59ka/KKLEXIszWeGpEXNhWaUodj+qy8mQYLYWCQ8yx BB6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120672; x=1778725472; 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=mIwnjQIdVECt26b+sVkCg1Iod5+hcx9LOfxpqDU/EAy3K4TLz2/SbUUx8Hg5v/Gjdw 5R3+hm4xmW30mmYVxVxtkqctGyBOpi7daYUaOiB/ljcdcyByAqWKC3ob2MMNIPmNewsP DxzFgj2FTPzoSxFK/NcgtnwEmnvamTVXZYiTJCL5kaLmKSiGDqmNl8HVe1KVZqHbAMdX z0uVKsI74gKurWw3YXTKR9/OMe3lwa9Drz+7mT2zOhnTlbSC5CHaoikq4vwLhepDpnh7 jvZuNNFdhNj3ZC3spjWpcraOca6HHRL8UadM83ngKEPe+Zz6ef3aBN3+tpnWZBb4qti7 xkxQ== X-Gm-Message-State: AOJu0Yw3OE31kqQ13Yl05DnnNuVpaIFnTVVSSuM+M8yjnESIEHssvUC4 qe/tdecMkbqCV5KZ9XV6T+1TFpNrg3ywXvUNHT5aea91mSrO21nxN6IlRRjChLMOec42uF6kiuF XJQM/IJk= X-Gm-Gg: AeBDiev71yzguUmOxhsAsUM+uH9cexPy965AunA80NmitYENrxTwQ9vGjMcupUhw03A UQv+1IhLgjIF1wj6Anc5QKiNXtkvGgBZevNY+nLFodAI/SEej6mG8RFL95MJ0i6hoYYrwO/A0DD jDxiing/x5iGOGPXCsnyYPhfM6wfKWRHmWMDnjdITVC6wXRCcxcntFa05Kba9XBlcGqMFRf38q4 906nSeygSOHMBZIDCxXO+2JAD462ufSPW+zVpcNWbILM6vY4GNe4sc1ct+uLdljsuXwy0wylwNf u0fS1J2AZqwcM2dCKIop0XcodOzaCSI0iHnHOYdrsH1lAMNkj5+VM70PNEmWH+j6SmKK8JAF685 IHbTinfXU1SZiM7SRMTdUgaKid7Ve+z3jxa1Z9oFJfxaLLrmyHd+FVhxoSGJ5ufyQtaT/qgg1wf FBiaJc4h6szQTsJh9EAMLr59kzU2ovuJjsYMRasfYOZg== X-Received: by 2002:a05:6820:1c91:b0:67e:ae5:732e with SMTP id 006d021491bc7-69998cfe0e9mr2912646eaf.36.1778120672391; Wed, 06 May 2026 19:24:32 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 13/25] bsd-user: Add FreeBSD IPv6 ioctl definitions Date: Wed, 6 May 2026 20:22:07 -0600 Message-ID: <20260507022219.44171-14-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2e; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2e.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: 1778120686022158500 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:40 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=1778120834; cv=none; d=zohomail.com; s=zohoarc; b=AhjcDBkc4eokZ7t1u0asW6y8kPMTsBixTrnTbj5/PEFjxb4XYOx1rGvakfBkvyCzc8XGerZh3NHBIsrJ4NZGSzPt4sZw1ZQbPyEOk+D144HuHtt8MkNuFnkOyEq6UMDWt5zwwmuNY7rT5XL/CqkuklAWlQxFkjxV4fyBxLMMChM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120834; 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=RIRC3nErqVNYftmHqUmhA/oJ/TyM1IB/fh9hBp+g7yww4W7vfQauHiTiKs+5GtgGLMu83PvdUw+jfF497+C2BE7AlL3mcvDb5go3Cp1zN/+n4+C3eXwQqxH2x8zKNvsWs/gDS80pxBj0bCTdcAPJh4DN3wCy+HejIpUxp8cJ3+c= 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 1778120834324546.3431235924595; Wed, 6 May 2026 19:27:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPm-0006NZ-E8; Wed, 06 May 2026 22:24:38 -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 1wKoPk-0006FX-NB for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:36 -0400 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPj-0007eU-2Q for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:36 -0400 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-66ee7b9af94so134887eaf.0 for ; Wed, 06 May 2026 19:24:34 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120674; x=1778725474; 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=MZKjWjVSOz/9NaPA1sPxAppUYj1K7bvHM+/jyEI9hpk8WuybmpmzhpWBkt4Lc9W4QP 6FKhxzKYpuafDPNa61DiGSGBS+aqP4cB2IThqCUooOFQ6A37hAW1tiB7TwFZGn2f8AAB /jbYIoKJwzWy36OME6gnPXNUTVfqJ0atYl2Cs0+Ff36JceTctMMWc3SiTWNtka6JeV/X CFkM+RRAvFVXUoB2D7i4rRyNk0c1zVAY6CoYkwDdwJqF3VQ9D19AFJG6GloTRR7pAR/e wdU2Rfeagp7gmYU5KHyrkmqSEiYxobLRoeDCw5iZFReAj9XHc6jE6b01bRbCttcpLbvP /gFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120674; x=1778725474; 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=GYezq1KsktI92cgDr5to7gEszqHTt5eUXkDgURwDWL57Zq1sM41gRhwaomAxR6lEgS O6GxkVoIYbup48d25dO0asN87/UUqiT/k/0Jxqe+rYW1a2EzAhOaL9ty1ZUeb3wOC+DM x2cs86pyoxuS22J7N27xIUvMGNbBmQurCu1a1EEOjZNegeiO+iKCNl7q2SHnf9ymtCwJ dqa/sqnx0cxkX4AD+1pKkYjoUx6NgvtR/Be4f24xTdKAXDbRSmeNqHiXUtofEnNZHClc LhSTHQ4yNU52qnB07j0ZgigiyDmn743AaLgA+IwNKMp5m+cKdwYo9jOIrBFSPcFi19Q9 ISvw== X-Gm-Message-State: AOJu0YwO5DWjC2de7FAxvEcvCP8AmWqRb0fzyNDH1m25UBAXgABLw3sq aqBLfuB9umge7WIfKb/8mB19V7QlcLtSFD5PyzcA6t+vhIX9bMtQ0RUgtToXEs+NO1X5h0MTcAG 9JuHkgMs= X-Gm-Gg: AeBDievERXyO1F1nLTRUlH0XnmhjC+kYxEufY8UGZ1cB+DJ4Z0AAzOW/NvbqGjb3lfM BckAlHyWMd4DSj84zzHlpOARQPiVNVsWs9ciGZDdKmqs5KqPXyR1/Q17hP4HF1m1g1AQaWCgvvs aYar7Rsa6mUPpHB3dGcGds3EI2Ahtr2fCK1svkm4LpVgGsgvnI5CCAbalboTYLzujSqxpB5P1Fm 3lnH5zjsrRNjP1G+1RK0l+r35YZwGTzjnXAFAnbyZWF8mJpure+DAq/8AJacN2hQqrgnVDEyjwQ RKW8ACL9umxjx6LbXpGaYfw/GeA5DldoSMTCG+6ilZA3QuSP4eK4GJqktTkeKVJ8FsJmZnICHW1 q3+fLvGh/y6R/8DhqzN7Xh+tDDWBX94q/o014lLykM4rC0Tm4Ho6CfmOqVTxGSp8SGWSc0Dfi57 tEhVNN6J1w4PqHwiiDLqT0gts+z4392Aw= X-Received: by 2002:a05:6820:1743:b0:692:1f42:f1b4 with SMTP id 006d021491bc7-69998c8d193mr3209337eaf.8.1778120673693; Wed, 06 May 2026 19:24:33 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 14/25] bsd-user: Add FreeBSD ioctl type definitions Date: Wed, 6 May 2026 20:22:08 -0600 Message-ID: <20260507022219.44171-15-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2a; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2a.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: 1778120835330154100 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:40 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=1778120768; cv=none; d=zohomail.com; s=zohoarc; b=lVhKX2W1zMKvibbAaedYqhVdlRr4mgYDDKgaJbmvy65h1XUto9LlrFTYsjj4E76htikDCNQDXOJ+yMQ7EAMqugIZu6CRp0FCgFbWmi82z4+Esdp9mD3WofqFimdCFZJvv1k7k5TLz/818pPu1JzT0aXSivX1/gqTrjHSpHMzl0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120768; 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=Z44okU+jdUSrfOyt3z93wezFL6ta+i7Y5nJNc4QsFmqpNM+1bbVHTiB7bOcPnRoooRp1kVsM8jnt1Fhnrsj9gVsGZA6M0T/S6AgH1lhlGWdTksErXYgn1UvY49T6rmRSXejI0a+VmwGZ/8A+FgjfJTNekHrtKjyqGiY2u3heI7Y= 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 1778120768002943.980510868109; Wed, 6 May 2026 19:26:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPp-0006Wg-8y; Wed, 06 May 2026 22:24:41 -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 1wKoPn-0006SS-IK for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:39 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPl-0007g2-Kr for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:39 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-415b23dd6e5so126546fac.3 for ; Wed, 06 May 2026 19:24:37 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120675; x=1778725475; 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=vrI76oDz23IT8Tzj/8ZCJOwz6c4L+7lxdegmPojHYDopRyJM87Bvs7xYAxPGd8sJh4 0UmI7F4pfdr9/IZFqDbwpcf28XtoBBPzehgScDvBwz87euuzvBCIezzPDEiL2cLzY9wX QkL31a950mlORPxDp+yi7nOzAId+zciIU47O86UxkXObr5i9IKSREMzN3zR/ShKaoHH9 XnzLmJadOS+W/KIXvTdVSQJ+UD1RGknw0E0tA1+yMTc4TEvWLfBYEtz3MPEodCBDQnly DpiHaiWs1ATdNLjX4rDvvFmMgvW0/gwZEE3E0Wx7wPJHmG65YRf6O6ktHu29OHTmPW+B pkew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120675; x=1778725475; 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=Foz2SL4W62fJjGWa4I2DfrjMt8k4tMKuvXg9tq3ZcO9R/LY1IEDboXzk7+q1b8O895 xF/m4ur5x48wid1Tmq6SqVEYu1hMLn9AvNSvlH+4igj3VsG6yUv2bNoeMgRCuKVn57RX mEEK/y5iybT9j73HkOG16U3/5IYtwmGS9UXGmLLYK21EDNjIQbVHeiAlhHt3PVlA+1Qk D3IxLWZQi3AlFvM7gDJz640gIOwONTCZNxaWbanuK2N+suKp2v0CqAHHOe9G7OkrVkdg lZcy/h+Qdwpx0F4KKW7CqktNlEQBdJ2tAZsuFjnIol02p0OAKZJAa5WOO0khtLT3Lb/m XVYA== X-Gm-Message-State: AOJu0YziccPJbDfX2ydToNd/FY8eandagkU3+ksoqpnplWczQvwAlZob /V0tFUq2E3w8i0ZHPyI51/wURyF0jSqPeFZNvyCCtW6y1lNpTT+g3bKv1RSdIwzVW1XAJbaN7vp ONGnz/sk= X-Gm-Gg: AeBDievHDTc0X1BT87jqUYguhAvF0HBB+jl+Je/J2dxGj6XwbddR6s6YU7q0TbWAceN HyUehdW0aJ8/y3VzXxMQMQKR1aK9iBQopgH5Jovl4jOVlJtVRac83wn5SLr/WuELzYUJdmw47C4 K2idIpShlCz/38NBE/4uP5bYNkZ6hWmugJLUA6pcXBdDqorxhBpazRY06ASiSHpDPyOIZhi/j+g AClbYmBol3covWezyH8RZTMtuH48R2aqd5kXZP802FgiijUxXojw378tmjMUJ/gJFZciobqXz6v bzm5aeXo/d+WCjRN3Jm07nn3TP8tkm57rjk1w/MAEvhovralmYOTfKbFqdDKzhc10x0Vy9HkAiN Bo7u/pdbP6XD5zNRNUns2tIOG/P+GRX+FBnhNbuTQjGIjlWryxnJ6MYsWF9/DLl2+qkg302UOY7 Zqve3/3W8na2Bnj4PsV+4TVUvST0m5MJU= X-Received: by 2002:a05:6820:81d6:b0:694:96ff:d4b with SMTP id 006d021491bc7-69998ce4321mr3338640eaf.26.1778120675350; Wed, 06 May 2026 19:24:35 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Alexander Kabaev , Pierrick Bouvier Subject: [PATCH 15/25] bsd-user: Add FreeBSD ioctl command table Date: Wed, 6 May 2026 20:22:09 -0600 Message-ID: <20260507022219.44171-16-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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=2001:4860:4864:20::2d; envelope-from=imp@bsdimp.com; helo=mail-oa1-x2d.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: 1778120770480158501 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:40 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=1778120788; cv=none; d=zohomail.com; s=zohoarc; b=aS1gMEYW4LgM2NNYm/POBrcPcC86qoMpAZt+x6dZWLMeJKFuh6e20LJQXX769FB7YBvRF785aA2xmQnXQ08y10W/g9d5nbD13S78w85Wfkwf83XI3YYyvjgcD7dhaBoeLHaFBbidCfcH/tAinKgOmmSrqFMEzwZeY5LVzzEVIKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120788; 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=ElqrXbD2BEJG5SrfHtbDX81e7n7MVTs/1y49hfF6VM9/VSDhGtqErnpsesv/9JRfd/eECWfEkEqXvkCiFPzusskHyIioxF2/SQgUL4m61b1J/ttI5HJFkaOjN7rIVHFa5Q3wz51Cz9Tx5LPc9zbXADBCgo3YT8q0RNZqsjVai/Q= 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 1778120788359252.6306794333617; Wed, 6 May 2026 19:26:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPp-0006Wu-MN; Wed, 06 May 2026 22:24:41 -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 1wKoPo-0006Vw-E7 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:40 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPm-0007gQ-RW for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:40 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-4350cd5b97fso181415fac.0 for ; Wed, 06 May 2026 19:24:38 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120677; x=1778725477; 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=iFFS58y+nuSSZdd4IV/t/ccExwtSS+yGO+b73ERUPuhO9pMKaFMo1KBPsCyl+pIgdX TQ4ZbXjYtXhTq1nV9D0MFgN8JRHP3eGmj0JuO09jo+1azjNb3pHJzRKXkhHOp1xB0Mjn cVh3m1/9sGcGkg9a2zMuxqyav2XjKG5JGgG1U/hmn/Ne46cpEyrl60aQl9UN97YPiep8 7++Q6n9q0lxCF22RuQl+2q6ETLKrcOHI4yeJAFx4OXFrGlsKTrHOnldm/B+O0gPp22vX h81IchMvhvyOtGql6geRwv66KsFU+JxDQ7Z9HqjaNYG7dbpoLqv49VOgU3mjgYY4MQN8 6YJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120677; x=1778725477; 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=BuV08pio9TbCOB3+rDsbrNHJ9h4FhVEZk+P/w+GcgZXW3e7m5+Ucvww7Y3npXV69OZ JKjkslIgpBKg16bgh0ekZwEq0jE9cn80vHrmBpS5dwYtBjfedCD37UcS3EYdPHDrp9IP N2y5BXzZtzmk3u3u3VAaBVITHhwGETH9svi+YCLhjXxHxfdFa37hZcxdg4We5j8gdtNG wpsaf049+o47J03Y7FHs4PQtEGie7V3iceE+YlISzPSeb12z+oX9nJagjMai8gCEUnlK urA1Oi9KxzXl0uNAULcN8zZAiYbwvwLIOud9SJsrjcweXlfgPmTqqNjdspXKeDafyMQA w3Tg== X-Gm-Message-State: AOJu0YzVvtu83QnOyVDbgUMnv5ZhPRIFniwfxJmFN655kkZr7qVuOO3N GWenNGeNkCFP0n5fFKcngzhqhioMXJIB1XN60VgG/Gz4hCJRGSRfHqNsyddflDxtmYDDeZDmH33 LDjAhF7A= X-Gm-Gg: AeBDietcmgYFSGjqtVoMusT4GZL/gGnmlZMklXV7g7ASkPFYOc80LQuLJAKLJJHmMYo 1zkXDwTgsePJknEWEoqigGVNSTekZpLIn2NKvUQH89JNU3EsN5C/8XfITY9HGZw7SzLCDNq3ml4 xpL4ucPDpJjyYvTRdxwYLAO1Qty/zdx1F90pIuDoo0u8kw7sXqgnJ6hqNqJ+i6os/nHX530quOf N5OcpwY3UADOlZhy4R5SgHCTGeaWZFLQlmQMPR4RMovfseMJ4gti7PWt0lr/UMcs4QHQRfHxQqu k0uq/nm6T0YK4rf1o71Qeyb++OrRX2GN0WGe4KdyexJb1pRIOq9mgO3w2w24QREAzAlyPmM78qi yhy4i2NGogNLYubZhfxP8vy+/7qvlh0S/gGCxG5u4tnXEDfUuNYPFhEk706s7SNLgyO54ljaArh aJEM8GDaqxsfjtOl9YzWXx8K/UfwQ+RWZHFkXOShPoPw== X-Received: by 2002:a05:6820:160b:b0:694:9a8a:2ce with SMTP id 006d021491bc7-69998c8fed0mr3228427eaf.8.1778120677083; Wed, 06 May 2026 19:24:37 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 16/25] bsd-user: Add bsd-ioctl.h header Date: Wed, 6 May 2026 20:22:10 -0600 Message-ID: <20260507022219.44171-17-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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=2001:4860:4864:20::2a; envelope-from=imp@bsdimp.com; helo=mail-oa1-x2a.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: 1778120790620154100 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:40 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=1778120751; cv=none; d=zohomail.com; s=zohoarc; b=TD2HUhA0Km8UGO/P6GAxhV+eu6Ankzmmu6orOb4Wr+p1WJbh6angwFDMt3wHWt6X/4bAm2FpJ0hEbxqLL97bGH0/VNtOEy+Uo/DeII+996RoLFD4f5c+X6rCvrnamb9T8KdTdXVLIIwjPeFdeoXfwWY1Jvke17ZzeZB2BwhSrZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120751; 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=LZVl3XcevTs5Zh8Ixbqsd7hcfxusl9qCSwMss0zmP5ORB2RvW75Lz/GpWXv0lvdG2zQWSEzTBz8ksD3kywQD3ury+SOSXgdNeojm6G5q4zyKOXzfMzjt9dlLzM1Hazhi/B9oAh01pHDPKqYL1709M3RXaE6UyPiPcivXPzbiSSI= 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 1778120751781762.3095521632463; Wed, 6 May 2026 19:25:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPq-0006ZB-Uy; Wed, 06 May 2026 22:24:42 -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 1wKoPp-0006Wh-Ab for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:41 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPn-0007gV-Ra for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:41 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-662efd1bdd4so203949eaf.0 for ; Wed, 06 May 2026 19:24:39 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120678; x=1778725478; 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=JdaETejZk346FA1cOXZePTSAmOdl/YKl08+8iKVPhQX+Kx9aTIdICKKzVHGZtgPamL uJZL/3IRMV31O5OC75ZZOFG2cgJlsPGwpbNpWGunrZHPLPY7jZYp4iqYV7vbBQ+33++9 lpwPZA/WzKnqQ0tUsU4LaUl07mfHnFQB1Gzz0n1bX3QySiC9WEk7sQquhbeRiWukNekz J5c/Vg1haqxY2dqoKJ0a4njt8tYIrenD+YFSx9IJD65Xvy+c8ivvJYB9GdDWdqQsmzw3 DavMFzeQYNthx8/pqN+AOe5VZyRPGgqtNXDvla+uc8+cNQxY88/Q2F5zXiEQLZXDShsx f8bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120678; x=1778725478; 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=b3rVNPkRzQe3B9d7t4eHuh28ZXLOfvPOt+Cfxhw20iTHG3CdQFFdt0gjLs7ivrqGs+ /8Qz6EtkQqWw+wl2wBzgPROt5HYxhZzDgDVux7Nur3pyMX7FzBy3BCKFBGiiECP70Fmv p5jJwe5lsRudYwkiYCgD3QZmeahalp9UZS5g9lb9s6XTN2T3Utrq6Llk8Qz/flZ5ZqPI 1IPGiS1HelLbcSgzmaHw4WGWbdVXCBifBB9EnWIMlLKuCYZjVKhTsWNxMv1zp2FLTXVo T1C3pMwhPVO6iy50gVAzqgo/RGC5uAyIjzPldwcx0JkusMUq+O8jgUm8FsmkaS+21e5S 5kYQ== X-Gm-Message-State: AOJu0Ywuhz09dt/mL749ZXe8KXfBP9DoYgR/BmTOb2bOWm0q2icKo7UQ 41WE4gJ+/1fCBEpi0NWI4CDUAba+Cqn43n0Wy8B3Bgt2rDE0qNHNtx1ggq+JLt2VYrm4XDkntiC IkETyTD0= X-Gm-Gg: AeBDieuFPioj9DyiCdITNlO/+1HUFWtnjAC2+lsXl1OQB3xhuQTS7qzlXoE+pcTLI5U RoV1oRWGroxlGpZMvYsCHSUERorze8pTo3I5xX3aLzqmgHbb4NQekSF0ZTUifaFtkcnJ+75tFBw p4AqyPaHBqOFRefmBxsbWMRk27DGFq873LayWTnQaD0KsJpzOs6mKwhE3LpSQ9HlLcw2aJadVGg Xevbxc9qRw+DtRFI+r4buQUsvI52eSVYaDTjN8BPe7Ie8GdH4SERrTorm82N5rnRB1AvhfIOr6f zd3gbSbQKoxtBbLFN2//DU5LrjhXrt++fVqD5leX8XC5/+1zFzYzGurbSgHZIvoK/CHCdmwqlsF cVgKHBRQjF+/Swah+4G17pOMgYDrmX5N0+WmYQhhz/jwGg/ynhD6N3cvlNOs7xJADGZay2VdAG+ al/7cvLXjPAdgf3oj0XMWn X-Received: by 2002:a05:6820:4c10:b0:694:86f7:bbf7 with SMTP id 006d021491bc7-699ab5726f5mr552347eaf.5.1778120678530; Wed, 06 May 2026 19:24:38 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 17/25] bsd-user: Add target_sockaddr and safe_ioctl to syscall_defs.h Date: Wed, 6 May 2026 20:22:11 -0600 Message-ID: <20260507022219.44171-18-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2e; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2e.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: 1778120752025158500 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:40 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=1778120866; cv=none; d=zohomail.com; s=zohoarc; b=ItfjsQcfuvE/tlHEg3SpkuB2T+K6JSkU3LgKomr4ET30EekCpSThc1KS1bHW6SO/E8zS+mNPCwy/Ht3KplUoEaErQwE1IFoX0Bz591gK3en3glZHmvaX5OOy/KGyMuZVpLMRiRLdN/0+EqaYyDHB6VsZy17ML0hkxciW/DuXbe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120866; 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=KIMNEJZF129i+W23xSX9qj9xD0wkg+ytS8sVda3s1uLbvRMTS0IE4f2fO/O+el1FYH0WVlt97lD3mgVV3Rft8giREdiAnCkWb/QWyLlCB3+bnfRjXhP0uY0AU/6q31WuSXt1NWPXKVZIaKxXSOqmERs7xk1ETE0o5izhPVYmvQk= 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 1778120866666261.24973582944347; Wed, 6 May 2026 19:27:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPs-0006aS-PP; Wed, 06 May 2026 22:24:44 -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 1wKoPr-0006Zb-En for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:43 -0400 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPp-0007gl-C2 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:43 -0400 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-679b072ed3aso174026eaf.1 for ; Wed, 06 May 2026 19:24:41 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120680; x=1778725480; 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=q5A/eWNyFIqRW7lGWGnkIdsqmoe+bPInzVLKOpWtXt14C/m4xDOYqG8cmmwae5fTZr 2h/NHqwlWHUDkFNZcYJDvzolkVO0KZcK5NAL2LQQRsUPpWKh33u6gut+LLV7SwTrYWlr wYldTlkg+eq1sDKmPvtAiML/sTz/CWD+yRmWApmnVvTv21NeYuCrJXXQ2igF81Rmnwlk oBFmB5s4AMDWiR44ix7d6+NrZIwd6wfrrJoNwzSly0EVgeKetnJ6zMKhisU1dcckWwyA t6ukb/BpLtfv1gKFfaQqC1Q143aUAlKHa7s8TeLo4oxEG1XLq5c+K62loBPq3TwlvXge LKog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120680; x=1778725480; 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=cd3zNFeP/XO6ceN4YWupArNF1rV25ZlacHBnd/107gA+ikcVI3t5gimBUbl4uRg+P7 4G1WN4n6JLcx/0oTmDmRuqMtYDmtNd7UygBw3jNdZCHzT773qtX28W0hfNi6Pab8Bmzd vFDL9P31K7qC/lQY6Fn9iO12IVGMcC2IrlT3YDBQVHoznXUmU0iOvI84R0lzfxygKSaG BvPai4z49OHRAzJBVH+PH/iKwhkXKhH2YTM7L9NHVvx9632E0Fru4hhvo2UD4GDvuy6a 71AcpzwL1w2ryVK29bnS1ku6tXrnkJfxpl03rUJmNsGqANNm7fC/SsHS7m7trkrMZJrR K3bA== X-Gm-Message-State: AOJu0YxppZVU/pTBN3ndOtKOTRC6klGMBZXJUDqRbbJ+9mckHulqVu9s dRxRcc8ajn/td8zQOEWsDK8lAkIJqFlKe4PJFt4/mZSqOc6ZqBCgjAWeKEK8SabAwbQDjmOllpG pByf7UPA= X-Gm-Gg: AeBDiesJ7e5+13+TXCcW0HtPYbIvwj2TEqSIym9wRXZUOrxCLhD5UzphNO5ecVWOYG5 COJXTNQJzXaCWnOm80NY3Z+jhBH7Dnz8eyVwHA5DcZs8gK/UUx7upiyxanfCvQbdbhju89kQObf aFdbrT/NlaeCE63JuD6HIRpealbsIdVSUU1ZJHmYw3fIu7N4zlNlBbkJFHi/8h2AJ/vjEoq6olQ 7tT6mpZOa9/iD3tkxemJJhRYrnmeKsD8AvrIgFvw7/auhlzRjBYysKvYWTgaNKKk3w/auzTTJBq RjV63kHvhF6X7XOaBdwdRxjFsGY0pERNGvZLH9VvBUiCPcg+7WMEb8DdQtxNKavNzJ86uP4nxee uLV6w7QdgFWmq+lswI4UMrYrQHFiBm5qPVNw9Qc+HCzcX7yzf5e+cZn5E8ZTvI0NfW6piyFw/s0 EQiP5VEnqLBgg+sRLeTAG1 X-Received: by 2002:a05:6820:1513:b0:696:70f0:7ade with SMTP id 006d021491bc7-69998c9fbfcmr3340956eaf.8.1778120679896; Wed, 06 May 2026 19:24: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: [PATCH 18/25] bsd-user: Add bsd-ioctl.c infrastructure and termios conversion Date: Wed, 6 May 2026 20:22:12 -0600 Message-ID: <20260507022219.44171-19-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c35; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc35.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: 1778120868584158500 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:40 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=1778120785; cv=none; d=zohomail.com; s=zohoarc; b=NVMaQhv+rvrr37puhOI6YTO75yyuOpyoY/6FZL6RE1jr3Nvhl0Ohovztr6wKaCSmx/dQrMMakwNvrwfavEYR9ksjO40YzULQG74J+DsNoNIuosaY7ABbldz4OkxMoOfW75ls4zYycKTibwV8ITIRpL2K64am8j24caU/SQDX8vM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120785; 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=a8GpGM50kfNbzCwWtV8NC2Ah+Yki6HRlBbqoIuOWPoiFgz4zH+UasJLtuFtaZ/sIGSb1gWoea6Sp9lXysfntiK21Kw60YTM8vezoYooliJjwUwODHYeJlcbeEQKtkq3t4Hj8umMm3zHkINOCKQ3h2LKGvRBvFPO72PTMJrx6jlo= 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 1778120785169583.6435235223989; Wed, 6 May 2026 19:26:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPv-0006f0-5F; Wed, 06 May 2026 22:24:47 -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 1wKoPs-0006aT-Gb for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:44 -0400 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPq-0007gv-U0 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:44 -0400 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-679f6ee3fb0so139035eaf.2 for ; Wed, 06 May 2026 19:24:42 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120681; x=1778725481; 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=Y/5Gwk/rLWcJ8QYg+rbxVePXDOR8C28tqSRuh1KjMfUNd+iIexI3Bb3MG4kXeHrWLk I20PT9OaWVd4GF951GBFTDMXseQ/tn8V1oj4BsNSV8srnH6VQ5XPXG05B7qc1GNxkKPu sxyaWun7rRP5440E/EX5xF2EZ6+tTluG7KcEQC1z6jF1hFKcIjlpJSZhpXlK0uGcymY7 jWZcgMvL90o4rjuPjcCri8KUScR+749x9gx9Lw8ifjPamE94tkjFUhmViysFDc3OP5S/ GEi4oGGAPN5SB/0JAVP20nhVAbDmch+BjtF0UvGfSCZzfdmujWR86u3ta0FcOz/wPvCQ Ormg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120681; x=1778725481; 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=SOKePVspwlLq0QuDN+EgOT/Wfr8Bv9v03pcflTDOQ4KoUXuXVnGxA/1drtgk5KGYqe PjXgqcvmlyC1Np4qGeMgdvt2YxTVWiVnKukUZFk2MrR34O5i6uv+bwAk2YFyFH5BXVc+ LDtdOxJ9drNdtgxDkxKvcQevBCWgyXKx5SgcXwZK4VWvKU1qeVfEfu1SzNKLYGpaZZRC IYcFST0iNekbFUub96N9ZMYzDQuZUg+adlsXubk66aeWPtTJ88lGDHF3W+k88KlxZ0LH E7+nzpRFGK2lNzG+sbTdthRDVDllQqUcpxL7ksewCAtXZTgzWLeL9yIFRQe9rt/CIA7A Ct8Q== X-Gm-Message-State: AOJu0YxQdrI143PTX3BB2Lu6RUBYkSa+U43v+zBbamk5ksW7lPzg2QIu oR7qdSvXNk9P5N9RwBLq8Hl0Z35Jb8mLvwFIsfHyg+aKYRgt98vKLe+UMC3WuLd7SnXazV3MiCQ BLVo82Bk= X-Gm-Gg: AeBDievvfi/RVNDAbD7j1ddHDVClQIuJPFacbhmfatHUUdNm5fVzpFScRXr5tiS5QBP S93ZfwFI/KAFgMIP+t93CC8G9WU8vRo/tBGL1p5MXlfGyFG15qwfdz02hGvWCDYnCZ4zj37pgXw QfZ7b65IRnpyIHsfIPR2/tdE0XsdRAzroi+rbCJqL2IL7lO9JO2006YAsFn1gqfcyePKWxlWulZ azfpk/gpL03JMJ+n6tSgju5D7XozO0SEpzDznr8muQOFNEZlHXUQhJoKx+oPkzYcpzsLHluVTRM 2OvFO1jKG3POznJ4aOaSWYq8radu0hegrvQgpsOdTQKAERsriGJCB00ro6BO6UG1EFYfcClVoJ2 lsnp6hf5B5M+keaduWv9u1z7MDHZv8aEGLePsgqitEAvAJTwFhM4DACiK3DbVusPYfT63C4hHl3 E6l+jWL2bFLd/+y6y8NKBG X-Received: by 2002:a05:6820:190e:b0:67e:251a:bd3e with SMTP id 006d021491bc7-69998cc5fcemr3328267eaf.18.1778120681567; Wed, 06 May 2026 19:24:41 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 19/25] bsd-user: Add log_unsupported_ioctl function Date: Wed, 6 May 2026 20:22:13 -0600 Message-ID: <20260507022219.44171-20-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c2b; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc2b.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: 1778120786175158500 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:40 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=1778120773; cv=none; d=zohomail.com; s=zohoarc; b=BC0PYrgib1z614qdT0ZkVcXyqhtVupUSFgOVcafjC57Qmyn/kz9x8ZXGAXLlSK/gwhwpSUYAiCJEQ0gqArj98DRMpTBMFHEcYvA/mAks3/Hw8qm9ngdOkPFZTYOjoMlslskfjlEqvTjU2opqdosTPAflvGLnTCn2GtKLfOTd8rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120773; 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=Ys0fFOdaPxT2UmkXqkvi2iC1p3AsTyrjw6ozWkvLFiWo+L9XIN6z8EOz3krtrPgVX+w9L+VQ8C5pHhoRjiB/q4MwyTNN9q5R0d0G2W9jpCq7UGQ2lh6GaSMlWa0YkVDhN/DuwhTtEGFV2T+u34daBiHbMGbN8QWrDrxU7A/67EA= 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 1778120773461811.0124324255643; Wed, 6 May 2026 19:26:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPw-0006iW-F9; Wed, 06 May 2026 22:24:48 -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 1wKoPu-0006bS-8E for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:46 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPs-0007h6-Tz for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:46 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-682fce74c06so252849eaf.3 for ; Wed, 06 May 2026 19:24:44 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120683; x=1778725483; 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=bNkMeq2hfvfzrFTdYsdlZicP9X3iLGKF8EPY617KxRlKXP2SC16GKgumLp+ivtBeFn HhGmIDGaK0acSUZF523I5zuiCCpylnADP0YyJUNwBu2D6EyVW0ZcsyaOUq73Z43n9x6k JBV/Pub06shjt0A5NcGpNfOjmLjrdSkuVVUAkqttiQ8SWQFt3gdos+kNnq7xF1VcTbjy rHXwpipec1vQwNSeRPQ/4z4zi1EkP7wL/RDB9lsF8hF643+/M1GDhMaJBh+uqMTn0fBQ XhL4peDMohmerER+JXnMYyMYLBPfGyOy9dSBUjpA2/lVel12ckamqwfAzak5cHu9trIP SvDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120683; x=1778725483; 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=h/tjRTnL18ez9QG/LmpY3HQJYDARMtmXSc1m+gtAq/6XJFJnSJDO66aj3hTQTQBtu7 MP7IxVt3gSZzs0KunYmvBwuMQB6cEV2+FCjZ47oH02hOIilfH8jqEZ5r4U2eC5FC9SWV 15nX6A1P+lA66iaNItGyQC/fWP2897GvlOHjgt7JlpMRKT8WGBrnJhrF/3Y0S51ZD1Pq HqdX425RBkwXvDD0eMr/uJ/tc6uODxzKF0j8lcuntpcablhxRTeJP8XEYakN9YxbPcuC UL6OeGlWgD5131chBRfF1lTbAuQSMwxPcrVBtMJ5txG91HLyLNvQuKqJ70sF4yH0xVJp aBXw== X-Gm-Message-State: AOJu0YzS1kr0uHN/X8lptzrJ+E7iVbk0w4v+SKbZA4kwfJRt842iqU+9 xJzs073NWa1//AfIDAl7e5l26/tU3Q+IhOi3HNnErF8DRPJ+P76GgIXnyREHFdhEBa28bZhxML0 69Pk569g= X-Gm-Gg: AeBDieuWIg6mm+lCoSeoqBFFGB3Dt/wCkubPsZeSH+zlKkw0FHjlF19uAJ9ZcHT4vzU +ril34q2Yjg1dVuykxC9QZnZpRs9oirUwjNjQ+D6681XWZUInd5oPukWPHmkOPznoR7UH8hzHdo DxIvy9RE5FfeSltynOdvgyMRBvEeTKZ5A/E7u/dP2BP+v9X92k4sZ88+q+UagYxBVeONtNsh9v/ rc3vYaURzSlJfbLljZtCYOiJ7uE1pDa2uHaGtOAamHYjD6i6Xg2EsZe2Ofq85Fhu9AOIGak53Wr EK0G3UQIPU/wWhaph6y6XzPLs1vNKirQchJDOCRTtHH50N5icjLEErWy+0MuKDTcg3CUbS58Fpj uv589HCu6dBYIHtBHzgm9GtcujEydMdulvF/lYUGQrBun0BwXP0xxF6phyIP78XO6p4RIKIr7yO c0NuEhPSpqpjbBiEQWrpjhFABx7D2n1Ls= X-Received: by 2002:a05:6820:4c08:b0:696:7d51:79d6 with SMTP id 006d021491bc7-69998d3338amr3241685eaf.31.1778120683319; Wed, 06 May 2026 19:24:43 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 20/25] bsd-user: Add do_ioctl_unsupported function Date: Wed, 6 May 2026 20:22:14 -0600 Message-ID: <20260507022219.44171-21-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c34; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc34.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: 1778120776425154100 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:40 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=1778120790; cv=none; d=zohomail.com; s=zohoarc; b=CI/+9NBWNajtOmG7vTlFLX6u9NyjF6//px0hlhdk9NcAAojsx9X+FScJv044uHDjYbnXXmK1dD+NO6GvC0tfEm63EYU3geDjobxUrymURS9do9rivi7ZRikD4p5mkNJD14EiLdbzsFgL54bu8jVY+GMcHH67vWeWcPtkpsOq6AI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120790; 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=nwq6M/KpkphZ3PzLLdc5hw6JXf6Z6/YbGN4k/hz5pXh/ttdA2KBnSSrZEbz4jjFXOkbV0GI+l8bCcSM3X6jaz9bSC7b13cao1KBt5aAyk3f7yEcSwuxA/bURobu7H+JH9AZdh6fpfLdMEg+sj2z/HeNYoBuuCIh1bwYXwElaiUc= 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 1778120790912468.5118500384924; Wed, 6 May 2026 19:26:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoPz-0006z1-Gm; Wed, 06 May 2026 22:24:52 -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 1wKoPv-0006fo-BC for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:47 -0400 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPt-0007hF-WA for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:47 -0400 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-6967080e6c0so201467eaf.2 for ; Wed, 06 May 2026 19:24:45 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120684; x=1778725484; 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=DKBgifPHSmsFU1i4zCrDM40YNY3fR1hRsoG6oIsTt5WdKF54yO6pGbX6K5kuPFk4V6 BUlnNc/fApJTzBXXpDYp0dt0bnIh/GzGCZH8+w5qwva2S3YAOSc395qdr8pxtHoP5WTy QmYciGcjVjPmYsEonhOFotgOwNFETMlurl7N1Hs/zGe03rAdyqXvtec77PjOY0G2nuwf fWUoQV3KQmZFx3di6ym9xrfwF6+Wmd1RRUP8M0vC07HvGPwJ/YqIDRE7lSrYNST+crXJ YdZiNr/Qym5ptrYVy765oXfEcTzdKokXTvVvmik3IsEuXqo0zrpsjlmSuTULdMV29ekQ jupQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120684; x=1778725484; 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=A9nquyA9mffMlPd5LiFuL+EslNHHLAtTOlDufEwtOwNwARP4nTpQ05pX/XcOpfr+98 bT/3fzIYOBGt29EGXpeRbW7rllHk3lAR+/o8G3My9duFj/FxlTlfXPORufZ8cdsDHCvf YYfgAG2GzdAO4soKSy3sALakay0pEYZhDdHoYlM7zjwNhTnxZJZtX3sPAl9Hh8pLYtHN 4DpXm/PcikqPG7TCjbekc4ldxkZVhpejtXzYQ0hkoatUcjJ8lIWKoa4YjKqvc8vyeTny vqQ28+sOa2OTmowJi3tBR+mwrSLETpQ9Fhwd8E7J91ZELGT2NN1TuBiBw5Yyd+jEFSos TaZg== X-Gm-Message-State: AOJu0YwjBEfybe+LmLpTnJm65nZrN6nzXn9WSMfYt9ZN8CjKJDqGAHv8 CP7E2KqFK1Guc0I8UxKdSeSTAuOt/V3u37cOl/MlBhDrDgqSNYOs2ehyzcTHEvEWWjG5IWDGEgj kvN/iTHI= X-Gm-Gg: AeBDietZsWf1PEvsO8Q480qx5DO/lWmIq2+vizsixEp8WAfWYP6Fesgq3tEPvVZxvPg XrK7CM2T5k0R6oM7TqnhWP8hoEfbn8WO27Vd9vtsagNsXs1oC+O+NgwWmstzr1EdPypf3knKbzp oJMP6MGa0n7QzxjhSpYDPNIwtRl9H49Rp4GgWzHqfUutEZOgkI9eF0MWCZTecnRMV44+NYUNs76 o7e6lSTxf3lb2Q0PeZNsKGTx2p94B5zeEHRB4VOPdscmzGiAm5ukLUwf+nAg0eK5zV5nuJoPQVg NharvP5XublbvGCnX3UlgAPHbhz3H1WCpNbNMvOwoF5L5HgLqnp8uH7qwtEBWqoUElwFYB5jEm1 VNy+iPK1vwVt9fGJnw9pG8dMOY8EAW1t9c/Kcl4Mo57WS7TIwmAfzakk/dEm4+jiuVSRUXaUS+A t0EShTxVfJ8ghsjk2dbCTZ X-Received: by 2002:a05:6820:168c:b0:694:9f3a:da8 with SMTP id 006d021491bc7-69998c8fb79mr3511806eaf.12.1778120684583; Wed, 06 May 2026 19:24:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 21/25] bsd-user: Add target_to_host_sockaddr_in6 function Date: Wed, 6 May 2026 20:22:15 -0600 Message-ID: <20260507022219.44171-22-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c33; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc33.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: 1778120792677154100 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:40 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=1778120761; cv=none; d=zohomail.com; s=zohoarc; b=j4rGJ3DGVk0rh+/zFnPdrZTgxp7IvDRpEjfUiv1QienmB9mhWLGIg2VsorkmyjrfMuLGputE2OPK9+BAtcpifv5/fZFOgQk4AHaoDpllisiw+7Ym/G/tsILyYs8vR+Ll0VayTnLMqKI4T0+G6PtwaxwY14wdrjHS7Z/s1lPl5mA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120761; 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=Ibt2BBi8tvUVUIzgEKC2QhFA5NmAOQ7M87UQ6UbwrhbGnDZS1jvQ+kL6qTIkl1BSMDKr/7hfX3YTlPBHwxMjvi1d06fMo5a7Ttfa4wXAkWA6AtWkEcTwUt/w4hOUU+2zxZUutSTOiHRq8bSpS1khNJgFQip8MhMDZRkqoPGwA2o= 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 17781207614241013.5211312190629; Wed, 6 May 2026 19:26:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoQ4-00078K-Oz; Wed, 06 May 2026 22:24:58 -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 1wKoPx-0006su-EP for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:49 -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 1wKoPv-0007hR-VZ for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:49 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-7dca4debedaso388322a34.2 for ; Wed, 06 May 2026 19:24:47 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120686; x=1778725486; 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=FD54uHMS5DFh8rD90wqDNAqXuUNcOHzP5C2uKpAN8iRpD1An1HnPYdiDWC5YhisioM X+ooN6EI5Db6XNEca8LTIffAM+N2MFaH/eX4RW/QEhP863FD+ejCPcG4jDFjfdosuigt PVV/EAnr8gmvkbY62cFJSAAua24o/W6wGsV69jpe2dc1+Ebf+41N+uDX4rNojgJerwGK zFagh8myJ7VgxLDN8UcD6oK+v2QVZy6MsQmNPLda3oaNbc+ZstwGfGfhP39xm3Jti/9W H9pe75eHQI7Ey2BIVWeiRZ8fxxJl0Z3naP6VpLwmGaokJAUm8Z75dK8Qhk02eoQd/W00 dljA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120686; x=1778725486; 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=TkGwD8Px7xrTg7ubKX6LuFFIhviRafJMv3zfqOljc4qi0hopSnteVAVxAUTi0F2duh RRC6H+uPu8boujXuST/uh3gTpWAFk9HrCz5J3CzqKFQnyIy++twCFqyUe0J0SY6XfGw/ lVJwyPeUS2vk2XrJc8qXdCGhcAOItdDy701qoKBqjBnqqVhmE9DI7FxR0PUu5MzshwiC g3rGnKLVOGzZmWkwEZMTnUQkv/aeeLeiaHqZ4fGyNpxOoZtQEV8pAaYsTU5rX3G6gvsQ MwC394T0VMlTzQezEc5X+9zMBdEwFbg84L4Hyfjy6xdYRii5tOoU+iFxuQff1flzH2Bz hv4Q== X-Gm-Message-State: AOJu0YxBaebRljSgOrgayPfe7S8AV21ainZTZk1B9DBBwkGo0m06ijdJ QdEMv1Ye13vPpfppMwf0HYzHFe37xq3xKkgFgMrFJo2yOP1KhBEG/vZvf3Wy4LioP77WMmGGlA8 QpR1Hl9U= X-Gm-Gg: AeBDietwfcFddo4ymi4NWhFwaFjqk2d4dpsZK9IVIme0lQyU6GRmQtTQjDPjhKGxmm3 2eCBkGF6aQzEb+ktAwf7XJyVuqkEO6asZpwzjXAJZ4IScgbVRBq4SqIBahEvV5Tz/8vSkGpPvhy UH2KuhJjVP+Ugd1jC4cjQw6Tj9SHwHYw5WFzIvPpqomDtWwQp8p9XtGC57pKG1MrDcCWTiQJVCB sdBNDa5UyXQ7fcItTUka4OM2fZ6Cyu8zQxgbfw5I/pOWneM8uDqgjrRo2eKrlJk+0IBtSOaWIuE 4IPANH4TwLOPODeHRYvTpi2gV96+TdmpxrcdSFUjZ3vNH7TP0E8SbH1Jer0fcP8oW15cSyl4tro 7oZrfe5IL/xv44PuSC+miQDq+n3PfJpj8qpMb8zglQfebRPEzI4bsFI6HhCpGvkkb+2JZxYB3yp LuizdDQgm+UcKAB4qlFcvo5uSQl1eRO24XULJ8jCKttQ== X-Received: by 2002:a05:6820:2005:b0:682:3fc6:5581 with SMTP id 006d021491bc7-69998cbae19mr3171151eaf.7.1778120686320; Wed, 06 May 2026 19:24:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 22/25] bsd-user: Add do_ioctl_in6_ifreq_sockaddr_int function Date: Wed, 6 May 2026 20:22:16 -0600 Message-ID: <20260507022219.44171-23-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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: 1778120762097158500 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:40 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=1778120833; cv=none; d=zohomail.com; s=zohoarc; b=G2/HLS8/B4J3frI5gc3e/2NirlsNy3e8rVSF5fvZEd1HHZz/flnOvVKRYk+c5kcjOU6zsmI4DGCqpCa86PrdYrjooSCNL9jzwNbPjmBPIZFOChoL0DG7uKBU5hXKExhMtYoyT7lvEMTHpP3YE/CkocSEhbULzyxqRrsCkgFuOpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120833; 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=jiUwq+r5WEZyhzwcBHD4duElFSnwxj+QjsUCxVBux9p5PEkJ0YtSMxRL6jyCt7sh7K6CDwLyHGDLNINkU/ageBtqZD66LmiO2PuIOFFZCSJd1Ws4JuZaWJFQVd0gTgGfzGuRvNWK0ZsXSn0SSrR8nWqxD5432QDn9pnMGMEViXY= 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 1778120833178436.4643231903286; Wed, 6 May 2026 19:27:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoQ8-0007H6-JH; Wed, 06 May 2026 22:25:00 -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 1wKoPy-0006tg-C1 for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:50 -0400 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPw-0007ha-Sa for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:50 -0400 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-42fdab683a9so203515fac.1 for ; Wed, 06 May 2026 19:24:48 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120687; x=1778725487; 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=nrFUFIJ3vp9AIoDVbStv/5bWmHAHbfpH35TGdqOFuElOwFyR5JHFMaY/6TPojcP1gD lAGNsObrIvV7sGs2ikQxZcv3bRxs6S1GBroCXNdG5nNrXxFVPfeIx7GimyFxp2NPvsUa bQOXv115uUUBtCanhnhPiqXOCOuOIaYXr4HQho5ShanIPYWgeQNWhQEAGzeidXrh8m29 c6ND6LLWtL9RDVbQAh/Czx2Q6VRgC0LzCqpLgXT8ip+kbKEj0ZQ9l7GHzRR0E4pu1wXV R1LRZXOIIGfudnwVdb3FoHjxrs3kcILLF307fyxvVgr0kohWdL4bHHqiYxCAqIWffSgF 2yxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120687; x=1778725487; 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=n99nD7hJwRGDOtwdXuqohHyeOf6OdsbmvJfPmk6IZrrTwt7sQRuM74yO2TGKLWhZ4j YOF/ZXZ9q6sXoePIc2yjWSXVvBamdvRGbfHrbOm29DOdZWx5/SsyVotxB4g09w5vPkyH oa1xRZcDpLN5qwp/dhIRK1N75J71CQnyt5K1cGv6QrptWNze9Y0EiV3V+Z11nzXSYDDT 87MHzyphpCMCabejnmutwF/CULubT5EvPIe7EbbuilmD4xvtU6MABb5tS0fFFE5WPTTn L0vpRTU5l1zE656pwUJ8EqKqWRMXxyzN3wGnaJe0ff3KHoamTIcS40wpiHz387S26l0I 1I7g== X-Gm-Message-State: AOJu0YzW4UNLsOn3qCzZhDHciyMxxizqhkp8+FqFQ0VnEhaiSlN98SNc NQ8yav3UqidTkILFcDCeg5dpn2nvFiR3sLadLgOTNeoDwr2W/BAM66ebdCFR+1YLoTbmxhXIdep p58+8n5U= X-Gm-Gg: AeBDieuJOWt3njaVaSW5JQTxw9Wz0moeA4lTFnhx9Rj5Vd0UdQIsjB+km/15HiK97L6 lScG4jXQLgMjuKUyzYlNrbjxXJdwEn/WYSngdP5//y9P8Tt8QeFccS+82lUcc92wWOdwBeHDe6j ij99px3Trftq34FaryssT9X7PeoM5cTgPen1Nfk78n7v5GNSLB/x7xxht7ixvzqIAFDCsO0rLc7 1oV4NxGebqjULW2oY+067UdozqwQmsPM1Aqb69yjvAUt0Fs/j/tzpcf1LlAtQf34qwrZQ5PsCVv Z5L5jST1V2gsieZ9psPiAagUs9nHmrGvjMUx9PvssRXSdnQ8SwxRCF4Dc2AhYZmj8FCHlrP/lTj YMarnJ4rXCHCzG8XjQdLzJfzhWjJJQ3l7D9L0Qdn6ZuM7ty6Sxc1jd3G+LjD+wexWPrTGE0JuX+ nhm7Rl4hva8T94XwHhkgJY X-Received: by 2002:a05:6820:f010:b0:696:8ccc:55a0 with SMTP id 006d021491bc7-69998d22f89mr3388223eaf.42.1778120687342; Wed, 06 May 2026 19:24:47 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 23/25] bsd-user: Add do_bsd_ioctl main function Date: Wed, 6 May 2026 20:22:17 -0600 Message-ID: <20260507022219.44171-24-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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=2001:4860:4864:20::34; envelope-from=imp@bsdimp.com; helo=mail-oa1-x34.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: 1778120834378158500 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:40 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=1778120760; cv=none; d=zohomail.com; s=zohoarc; b=cR2tp7UuaayciRZivIiZAEDVgy8sTHbhdTNeOYNV2IBHA+qEr8tzNZVWeVdVkOcDPpPce9AriPN1ygJ/AF/FKiHeP0VZIVf0lTAi6QnZZaek3N2iAgARui2tBKaal4pPv3U6jiBgb2N9ebzfW2nO3Hu4ob2WfTtsPV40+WS5rQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120760; 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=ai9jngKMI+zmUi0RURw+K6QsA1oqR0MclFIzQOGn3BdSbU/qqPBqFqsPhmdkS68joG6Qwjl+ckITKIG8sS35OBnw85t36PCx2ULYn0EH7Bq4zeUmjHEcNmH6X5dGO0iqapylW1R7dGf9/sLZnxM5sR03geP+B60zK00YtY+rN7o= 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 1778120760569747.4017103995843; Wed, 6 May 2026 19:26:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoQ9-0007OH-7R; Wed, 06 May 2026 22:25:01 -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 1wKoQ1-00078L-9y for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:54 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoPz-0007hp-Sy for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:53 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-688a8e5fe5eso181723eaf.1 for ; Wed, 06 May 2026 19:24:50 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120689; x=1778725489; 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=cJY/rOgZp086vu4CPNcGe5xHMK9TWbalGbTUCNxaeXDPd+51VTSoHTj62L0dOnCpj+ dpu9LLDT4RoARX9w9RkRP4BXxrU5viNN/3IVxUTqhjhc5fZ1GrmNMav0nmavdxUC9lQj Ew7U0IVhgDkviTMFqKLo3+zOQKI84rtKvUSjza0RGmCx8sWKzvilJEkt3GijIUK6yzAf 8OCmxiWmSvvdHAkemy1CwKZGwC7BHToThxVpKN7SaJtQ9fuhMA6SQcRkk9X1x345QQx+ /WvD4eltUUZXn30DmhnU/vQbIwoK6bWNtiHRtxpiwiD/Qk0RcoxfweNQr0WeGu/b4WY/ O3Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120689; x=1778725489; 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=Z5fzYKcfg5mnDLOtPsUNmhSXhfmKVa4hd7LXvQ3w/H75o8uopneKzCqSDBlQ8lVoH2 s1AQsrdGnCwUiKis5ucC5ZXN82yiSaAj5rvEieV1R8UrNST6JgTA91sIs+xACP8QZyBx hAq4mwbs0ZBoDYViJ+xX3IWZQNQYF276V8VURErMKzaPXSeUJvan6FBo8KIngP1I7t0S dwy8odtNpLQoz6c5b1V24OIexX/5KMp0zSdbB4vd8jaI3Fbx0e7HGGxb/vIe47MZ1qyT kxQPtCCbu6pwMcrx8DZRlg0kr431l4G/EoFrHq37fSvZ/HL1DUA0F8ONlrucXpv1u0vW SFMQ== X-Gm-Message-State: AOJu0YzzWrOiQ9Tv22UolffTWBWphlE25jcty47Fy0E5Gf6w45cRa4P6 yxeVOdzeN7IgFvrVnpyqiciDztgWeMgZ/eBnrHoiJSpEB189n5DEMuFVhMXQkeBey7dH6L2ZS62 JRGAlo9Q= X-Gm-Gg: AeBDiesv3aW44ueBkTEG4tp7QpogJNvI2tdCCUWykzz/3nU8T3avfR8I1CaZiyu3jlB ue+9yylPh8ZHhX3bjYnibmyMgAneEDhhlrRbzCcO1dW5N8C+aS5buKsL417Y0fONFkurm6ySgdO JvsS8oE4F3nNuZKdBHAQdi1Fc6k7NuU4y2gtCUjDV8cUt5R5q13/obdiyhCk7Txeb+GqgX62giV MYDkpMxG2/GQZGVSB/eyJHgZD1391DiM/PGVSrfrW95Qxe45I2qKA4QNcBs2h6n0Qy/edzJbDxg Hts4jhj21Zmcnq9bm4CrA+u/bOCC9xnMkl5t1kGrd+aw/ueIpB+YGbWxf+OVpZ2gn5h0BwXA1XN cZCAqq9gmBuj8USDkt4y6vynCmvV5/Nb3sZgF3eR/hg4prOUSHh1tymUJHmLnYnbedCoEdKxGOo yAobBTuudntvSedSE3eYEE X-Received: by 2002:a05:6820:4b14:b0:694:89e2:74fd with SMTP id 006d021491bc7-69998d4eb2bmr3151851eaf.50.1778120689110; Wed, 06 May 2026 19:24:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 24/25] bsd-user: Add init_bsd_ioctl function Date: Wed, 6 May 2026 20:22:18 -0600 Message-ID: <20260507022219.44171-25-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c29; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc29.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: 1778120762457154100 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:40 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=1778120757; cv=none; d=zohomail.com; s=zohoarc; b=cqT7ayvwPfvDSc6KT1j8tAakuauY/NiKHpCKFZyWPl4HALh4zEJEcZDRpPsZY9I1+ZXFCqcRxZ3ReQ31H62gz8Qvh+/KlExK17PJ7EhbQ6a7jNRl35FmmgXxziIcPPxt/2flz/eweMRpcYn/eLed78nSRI/K0hzYNLUw9oKcgCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778120757; 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=A6rotKU1ltlbeMjGaaQXUHAR//Iqfw8TIuUYqqtMbk3fTEah7yADp9B6cQ42dWVLSq7MEIfrArrjiD2m6EYwzhIII3rP5sfINVY85TZ5OM+QyKMz/KuFYXMXfZGDTe22btdjSVSEep88F/NJTy3C7LsGsHbIMQIt82/LxJJgdZM= 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 1778120756934675.0368048205792; Wed, 6 May 2026 19:25:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wKoQ9-0007QH-Fw; Wed, 06 May 2026 22:25:01 -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 1wKoQ2-00078P-Ex for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:55 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wKoQ0-0007jX-4o for qemu-devel@nongnu.org; Wed, 06 May 2026 22:24:54 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-6948ed7139eso196556eaf.0 for ; Wed, 06 May 2026 19:24:51 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-696896e72c4sm11088118eaf.9.2026.05.06.19.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 19:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1778120691; x=1778725491; 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=qNbQQcwj0oQAQsXd2R2qQKxLPHukrb8NN/MoZTPRjnrSpuF5KmU8EHcnQTHJTUc+jb H51Au4atlqkheEmLyc86Mr3KquqLOPaJ7stPfXXOmALoFz48QwQFxMwTyFC1D3hQXXZM RJYIdU2R1Ah36MqXRZAaPNvunaCsWmMrUeb3PLhLvyLDNL6JtQsy3J4t4x6YR+6MDr48 tSwARYLzGUNazu/vzLiASogZPJE0+0x5U6pvd3J5MRaIl1Usk5EJum6tYwO7Snrvy32x N4kIkit7QJC2TVit+RgBJlaq/7dOjkIa56yJAjxHVXjLXIU22TXjDhkLdouLAlOk/n8Y 4+3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778120691; x=1778725491; 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=MZVkfHME55vlg6ikIpPqI0xucpuIjl0zfSWsAtv4pkbPsuEUjwOIhSuhqeM6Vsx21E 7Hd7KwQZQJ43Gbc8AC4GKzIFaMFY3Jy4tPEBortsqnVOR5FeleDvTnVDjh8DZRcDZ5s1 DPiC5Rb6Ai5blPz8C7g9iQyVHUgovXYKeztFfKkfYh5zu9lTux8dU9egciS3nOSw98P3 n9bAqtmxZBNmtceo3m1FQMF93sHDs1UH9RxFedu4LuxBNUl1f5JXn/2PV5C8ZdUOOFFq o/5HWxo/991yK8dY5ObrH/8y6rcr1rZlMCQQFlA6BTlOH/2f/Egd3rycvPKsdIPtO1oa e5yA== X-Gm-Message-State: AOJu0Yw9cPh/nehdfs8XD8zaAh4lSu+lfY1z/VwrwphcrThCjqQEfRXz UtKjmJqZ3Vq1/I5WqWyCsAZdmuBIRQT7NMb7RPI0CIbCnjGKodGSGl0hUuXcGuchr9VHp4lJOOs ClW9ZIR8= X-Gm-Gg: AeBDietfX3GIfdsQzRAwgt5VOIzKRdWxj4rSug4AbczI1VuSyy6dzWUeOFpiHVplhuR d5SiBiLFClaYrdEL4ATbbop8EaZqIH9msf8u0pmh8LnFq5HpXHyLRN1iNtUf8bQ5wCAYJm4WPzg /ncbLrnjBNHy/WTYNYBlcLHI0BLMTgSOt8YCcQQDiKYSgoPksjRB1L8zagBRJi/F1P6901pJmsf e0Qd1JnIbR5OKrRFsg+DunRMGY9spGr520d3mC48ju868j/ah+gs3YUDWAFdK5CQpcHzj4xMiFy 6A9pQm2FS8lqJ2BrGA/ITPu2Gh3oih28OpGM73bXJKaGjLJCB560IoO3Ga4gl8tay/YyNRiOZ6m x7ZVmsc9t6c+ejXset6Cvo/S3kU7rs0Ru0aANhJYPlz456nONGMM+Enh6S14GEGM3oGgsSXmwfN iwln1FBTU2fTWA/MjAnfPn X-Received: by 2002:a05:6820:610:b0:696:7fcc:6113 with SMTP id 006d021491bc7-69998d35e06mr3408750eaf.49.1778120690811; Wed, 06 May 2026 19:24:50 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Stacey Son , Pierrick Bouvier Subject: [PATCH 25/25] bsd-user: Add call to do_bsd_ioctl and add bsd-ioctl.c to the build Date: Wed, 6 May 2026 20:22:19 -0600 Message-ID: <20260507022219.44171-26-imp@bsdimp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260507022219.44171-1-imp@bsdimp.com> References: <20260507022219.44171-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::c29; envelope-from=imp@bsdimp.com; helo=mail-oo1-xc29.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: 1778120758141158500 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