From: Warner Losh <imp@bsdimp.com>
To: qemu-devel@nongnu.org
Cc: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>,
Stacey Son <sson@FreeBSD.org>,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Subject: [PULL 14/25] bsd-user: Add FreeBSD ioctl type definitions
Date: Wed, 6 May 2026 20:28:16 -0600 [thread overview]
Message-ID: <20260507022827.44499-15-imp@bsdimp.com> (raw)
In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com>
From: Stacey Son <sson@FreeBSD.org>
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 <sson@FreeBSD.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
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_SHORT,
+ TYPE_PTRVOID)
+
+STRUCT(lagg_reqport_lacp_opreq,
+ MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ), MK_ARRAY(TYPE_CHAR, TARGET_IFNAMSIZ),
+ TYPE_INT, TYPE_INT,
+ /* struct lacp_opreq */
+ TYPE_SHORT, MK_ARRAY(TYPE_CHAR, ETHER_ADDR_LEN), TYPE_SHORT, TYPE_SHORT,
+ 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_PTRVOID,
+ TYPE_INT,
+ /* struct lacp_opreq */
+ TYPE_SHORT, MK_ARRAY(TYPE_CHAR, ETHER_ADDR_LEN), TYPE_SHORT, TYPE_SHORT,
+ 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)
--
2.52.0
next prev parent reply other threads:[~2026-05-07 2:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 2:28 [PULL 00/25] Bsd user 2026 05 patches Warner Losh
2026-05-07 2:28 ` [PULL 01/25] bsd-user: Switch to SPDX-License-Expression Warner Losh
2026-05-07 2:28 ` [PULL 02/25] bsd-user: Add syscall header generator for FreeBSD Warner Losh
2026-05-07 2:28 ` [PULL 03/25] bsd-user: Delete sbrk and sstk system calls Warner Losh
2026-05-07 2:28 ` [PULL 04/25] bsd-user: Create os-syscall.h Warner Losh
2026-05-07 2:28 ` [PULL 05/25] bsd-user: Switch to generated syscall_nr.h Warner Losh
2026-05-07 2:28 ` [PULL 06/25] bsd-user: Copy linux-user/thunk.c to bsd-user Warner Losh
2026-05-07 2:28 ` [PULL 07/25] bsd-user: ioctl: add common definitions Warner Losh
2026-05-07 2:28 ` [PULL 08/25] bsd-user: Add FreeBSD tty ioctl definitions Warner Losh
2026-05-07 2:28 ` [PULL 09/25] bsd-user: Add FreeBSD file I/O " Warner Losh
2026-05-07 2:28 ` [PULL 10/25] bsd-user: Add FreeBSD socket " Warner Losh
2026-05-07 2:28 ` [PULL 11/25] bsd-user: Add FreeBSD cryptodev " Warner Losh
2026-05-07 2:28 ` [PULL 12/25] bsd-user: Add FreeBSD disk " Warner Losh
2026-05-07 2:28 ` [PULL 13/25] bsd-user: Add FreeBSD IPv6 " Warner Losh
2026-05-07 2:28 ` Warner Losh [this message]
2026-05-07 2:28 ` [PULL 15/25] bsd-user: Add FreeBSD ioctl command table Warner Losh
2026-05-07 2:28 ` [PULL 16/25] bsd-user: Add bsd-ioctl.h header Warner Losh
2026-05-07 2:28 ` [PULL 17/25] bsd-user: Add target_sockaddr and safe_ioctl to syscall_defs.h Warner Losh
2026-05-07 2:28 ` [PULL 18/25] bsd-user: Add bsd-ioctl.c infrastructure and termios conversion Warner Losh
2026-05-07 2:28 ` [PULL 19/25] bsd-user: Add log_unsupported_ioctl function Warner Losh
2026-05-07 2:28 ` [PULL 20/25] bsd-user: Add do_ioctl_unsupported function Warner Losh
2026-05-07 2:28 ` [PULL 21/25] bsd-user: Add target_to_host_sockaddr_in6 function Warner Losh
2026-05-07 2:28 ` [PULL 22/25] bsd-user: Add do_ioctl_in6_ifreq_sockaddr_int function Warner Losh
2026-05-07 2:28 ` [PULL 23/25] bsd-user: Add do_bsd_ioctl main function Warner Losh
2026-05-07 2:28 ` [PULL 24/25] bsd-user: Add init_bsd_ioctl function Warner Losh
2026-05-07 2:28 ` [PULL 25/25] bsd-user: Add call to do_bsd_ioctl and add bsd-ioctl.c to the build Warner Losh
2026-05-11 14:21 ` [PULL 00/25] Bsd user 2026 05 patches Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260507022827.44499-15-imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=kevans@freebsd.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=sson@FreeBSD.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.