From nobody Sun Apr 30 06:57:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGb3ZSXz48rhc; Sun, 30 Apr 2023 06:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGb33Rsz3MQt; Sun, 30 Apr 2023 06:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YPI1bD7Tx5v8ZPVqt7D13ffCb9mOaWAP3pJNWSFv9j4=; b=kICmOwLi1a/gIvCHt9w9OKoVx13j4oxocZEJiE3AJKcovLJv9xMW/SQ0jkvsQIe0oZN3G/ nNSyYP4RpE2GB1Z+fLwpRZsD+dzmRE+weKOsiCYyz8KfwUQxGqr83du478wxHBjHQfdLLv OIBH3R//EuPtz0wEk73qzc54AONx3r0GSBeYkrDfbWSt3u3gDdCk0GobQQKq+wRdc0s/mr EDVtHiicptADLNeL3SZUs9p3858wbIxXHYH01d0LbrbXbE6oQK8VlZhlfoK/cxqZ1qKFDO fIgYy0XIGte8JCuehAOJLSKvNtBRQ0RZtgWpJEdYoPsvSqOHRBayvLg/dReehA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YPI1bD7Tx5v8ZPVqt7D13ffCb9mOaWAP3pJNWSFv9j4=; b=in1dilip+eTxJfIBH2Go2vYZHBQPO7L3n6SvBWYwpgDVdq2FxPAOwVlsHcP2zNlfm5sQom csNgnqOh5LHwFV9lDB2fDLNH603YsFFfK57TE9idQY0HMWsYs9UBQnLu+Ux6RMtO6thGHd siVtj6DovD1gVkxO5m3O+BGim8lUuq+bYYO5WHNX+qghCm/eiVDphtoabi9fzBw5w+kFW8 RwcJ/C4uJwP1zBcr+iCoAla17ZtCncd+/fVsICHiBR7ZCfFb/tKOReIwWQrvLZuANUUk1o 6Yu25r1SE8klVI7iSpGx+y+wx27hFvZWVTzkvF4PXyy+voeh/KB+awis9R6kmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837863; a=rsa-sha256; cv=none; b=nLUc9qg4Bgz22Q0MxqEjmJPBEaaAg1KEl7BgcF5VwFeXsDwLuu6r0fC81B2hiUzovMfsSr C9UXG2rDWXw3e4abxwFcCK6LcLpKFaB97bxqKTcgcrVzs8oy6z+8hX65oiNH/80NLwDgoL 4wJTlUhkNood48flWN0c3GdB9WRTxcwtVJ5yxxz42fJxaOXEn3PHUggnwMc1UNBYFVb4UD nH9LZDQx4iY8jTc6AeEho9rLf823LZJuVZLrrYABXlqB2v/npIUwWz6PcBWQSsLaaHK5S6 5wfhV5WqhTx4qpAQQ80hbAMLQX/uiRtxNQpQhbRSz8QtVuKx3lPucib+x/jTsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGb1sGKz1Ccb; Sun, 30 Apr 2023 06:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vh6O071343; Sun, 30 Apr 2023 06:57:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vh2k071342; Sun, 30 Apr 2023 06:57:43 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:43 GMT Message-Id: <202304300657.33U6vh2k071342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 60603f6a5302 - stable/13 - usb: remove COMPAT_32BIT ifdefs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 60603f6a530250b4e71ac658cfddf5d9e0a418b0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=60603f6a530250b4e71ac658cfddf5d9e0a418b0 commit 60603f6a530250b4e71ac658cfddf5d9e0a418b0 Author: Brooks Davis AuthorDate: 2021-12-17 21:28:14 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:15 +0000 usb: remove COMPAT_32BIT ifdefs Now that we have proper 32-bit compat support, remove COMPAT_32BIT ifdefs to allow 32-bit code to use the 64-bit layout of USB ioctl structs and struct usb_fs_endpoint. This includes the removal of redundant alignment directives that had no effect in practice. Reviewed by: hselasky, jrtc27 (prior version) (cherry picked from commit ea972feea2d2589ee1317a19eeada0598332defa) --- sys/dev/hid/hidraw.h | 20 +++------------ sys/dev/usb/usb_ioctl.h | 67 +++++++++++++------------------------------------ 2 files changed, 21 insertions(+), 66 deletions(-) diff --git a/sys/dev/hid/hidraw.h b/sys/dev/hid/hidraw.h index 4eaf8650a332..b1b037ab8c1b 100644 --- a/sys/dev/hid/hidraw.h +++ b/sys/dev/hid/hidraw.h @@ -35,23 +35,9 @@ #define HIDRAW_BUFFER_SIZE 64 /* number of input reports buffered */ #define HID_MAX_DESCRIPTOR_SIZE 4096 /* artificial limit taken from Linux */ -/* - * Align IOCTL structures to hide differences when running 32-bit - * programs under 64-bit kernels: - */ -#ifdef COMPAT_32BIT -#define HIDRAW_IOCTL_STRUCT_ALIGN(n) __aligned(n) -#else -#define HIDRAW_IOCTL_STRUCT_ALIGN(n) -#endif - /* Compatible with usb_gen_descriptor structure */ struct hidraw_gen_descriptor { -#ifdef COMPAT_32BIT - uint64_t hgd_data; -#else void *hgd_data; -#endif uint16_t hgd_lang_id; uint16_t hgd_maxlen; uint16_t hgd_actlen; @@ -63,18 +49,18 @@ struct hidraw_gen_descriptor { uint8_t hgd_endpt_index; uint8_t hgd_report_type; uint8_t reserved[8]; -} HIDRAW_IOCTL_STRUCT_ALIGN(8); +}; struct hidraw_report_descriptor { uint32_t size; uint8_t value[HID_MAX_DESCRIPTOR_SIZE]; -} HIDRAW_IOCTL_STRUCT_ALIGN(4); +}; struct hidraw_devinfo { uint32_t bustype; int16_t vendor; int16_t product; -} HIDRAW_IOCTL_STRUCT_ALIGN(4); +}; /* FreeBSD uhid(4)-compatible ioctl interface */ #define HIDRAW_GET_REPORT_DESC _IOWR('U', 21, struct hidraw_gen_descriptor) diff --git a/sys/dev/usb/usb_ioctl.h b/sys/dev/usb/usb_ioctl.h index 5a139d0653c5..a57228a5fac2 100644 --- a/sys/dev/usb/usb_ioctl.h +++ b/sys/dev/usb/usb_ioctl.h @@ -46,16 +46,6 @@ #define USB_GENERIC_NAME "ugen" #define USB_TEMPLATE_SYSCTL "hw.usb.template" /* integer type */ -/* - * Align IOCTL structures to hide differences when running 32-bit - * programs under 64-bit kernels: - */ -#ifdef COMPAT_32BIT -#define USB_IOCTL_STRUCT_ALIGN(n) __aligned(n) -#else -#define USB_IOCTL_STRUCT_ALIGN(n) -#endif - /* Definition of valid template sysctl values */ enum { @@ -75,38 +65,26 @@ enum { }; struct usb_read_dir { -#ifdef COMPAT_32BIT - uint64_t urd_data; -#else void *urd_data; -#endif uint32_t urd_startentry; uint32_t urd_maxlen; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_ctl_request { -#ifdef COMPAT_32BIT - uint64_t ucr_data; -#else void *ucr_data; -#endif uint16_t ucr_flags; uint16_t ucr_actlen; /* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ struct usb_device_request ucr_request; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_alt_interface { uint8_t uai_interface_index; uint8_t uai_alt_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_gen_descriptor { -#ifdef COMPAT_32BIT - uint64_t ugd_data; -#else void *ugd_data; -#endif uint16_t ugd_lang_id; uint16_t ugd_maxlen; uint16_t ugd_actlen; @@ -118,7 +96,7 @@ struct usb_gen_descriptor { uint8_t ugd_endpt_index; uint8_t ugd_report_type; uint8_t reserved[8]; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_device_info { uint16_t udi_productNo; @@ -147,7 +125,7 @@ struct usb_device_info { char udi_vendor[128]; char udi_serial[64]; char udi_release[8]; -} USB_IOCTL_STRUCT_ALIGN(2); +}; #define USB_DEVICE_PORT_PATH_MAX 32 @@ -156,24 +134,24 @@ struct usb_device_port_path { uint8_t udp_index; /* which device index */ uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_device_stats { uint32_t uds_requests_ok[4]; /* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ -} USB_IOCTL_STRUCT_ALIGN(4); +}; struct usb_fs_start { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_stop { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_complete { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; /* This structure is used for all endpoint types */ struct usb_fs_endpoint { @@ -181,14 +159,9 @@ struct usb_fs_endpoint { * NOTE: isochronous USB transfer only use one buffer, but can have * multiple frame lengths ! */ -#ifdef COMPAT_32BIT - uint64_t ppBuffer; - uint64_t pLength; -#else void **ppBuffer; /* pointer to userland buffers */ uint32_t *pLength; /* pointer to frame lengths, updated * to actual length */ -#endif uint32_t nFrames; /* number of frames */ uint32_t aFrames; /* actual number of frames */ uint16_t flags; @@ -206,22 +179,18 @@ struct usb_fs_endpoint { /* timeout value for no timeout */ #define USB_FS_TIMEOUT_NONE 0 int status; /* see USB_ERR_XXX */ -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_fs_init { /* userland pointer to endpoints structure */ -#ifdef COMPAT_32BIT - uint64_t pEndpoints; -#else struct usb_fs_endpoint *pEndpoints; -#endif /* maximum number of endpoints */ uint8_t ep_index_max; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_fs_uninit { uint8_t dummy; /* zero */ -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_open { #define USB_FS_MAX_BUFSIZE (1 << 25) /* 32 MBytes */ @@ -233,20 +202,20 @@ struct usb_fs_open { uint8_t dev_index; /* currently unused */ uint8_t ep_index; uint8_t ep_no; /* bEndpointNumber */ -} USB_IOCTL_STRUCT_ALIGN(4); +}; struct usb_fs_open_stream { struct usb_fs_open fs_open; uint16_t stream_id; /* stream ID */ -} USB_IOCTL_STRUCT_ALIGN(4); +}; struct usb_fs_close { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_clear_stall_sync { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_gen_quirk { uint16_t index; /* Quirk Index */ @@ -260,7 +229,7 @@ struct usb_gen_quirk { * UQ_XXX in "usb_quirk.h". */ char quirkname[64 - 14]; -} USB_IOCTL_STRUCT_ALIGN(2); +}; /* USB controller */ #define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request)