From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 239D743732; Tue, 19 Dec 2023 12:30:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DA61402DE; Tue, 19 Dec 2023 12:30:08 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by mails.dpdk.org (Postfix) with ESMTP id 8708640283 for ; Tue, 19 Dec 2023 12:30:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702985407; x=1734521407; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fLGzX1fR7pkOKxAgreRgI+0eNiupp2qoHdzIxzm68hU=; b=Rcc+Z1X+b418g34guNZJFwmXC/3sSBN+nb8UQpMZm/zYofzHzxQwV7xB Z3Mrnf7cBPqg+oi8bEkUb63oEv9Rd/ibHCRYXYUoAAOO+11fyASTtVmxh yamfIlaoee8mKqU0cPhT0tDkt5wTl9WSorB0YRRQm2g7r9wIbL3jnc4Ml Y9jySq7PUhYybn7iMJtMx478pdlivJnKtiP4rhHdwhhhMNRhtMjOSLYft bWH/+37BEWirixmROnXVeSByFrUSPJxWwkkArkq+WOShF8Y83qY7RzlM/ CELCS2yL+QHRfOaWzZpQzt+4WOKml4eb0Xa12Z4Vgcr5bweluHc/0C6J1 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="2857009" X-IronPort-AV: E=Sophos;i="6.04,288,1695711600"; d="scan'208";a="2857009" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 03:30:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,288,1695711600"; d="scan'208";a="24152173" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.29]) by orviesa001.jf.intel.com with ESMTP; 19 Dec 2023 03:30:05 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH] kernel/freebsd: fix module build on FreeBSD 14 Date: Tue, 19 Dec 2023 11:29:59 +0000 Message-Id: <20231219112959.10440-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When building nic_uio module on FreeBSD 14, a build error is given in the DRIVER_MODULE macro: .../nic_uio.c:84:81: error: too many arguments provided to function-like macro invocation DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_devclass, nic_uio_modevent, 0); ^ On FreeBSD 14, the devclass parameter is dropped from the macro, so we conditionally compile a different invocation for BSD versions before/ after v14. Bugzilla Id: 1335 Signed-off-by: Bruce Richardson --- kernel/freebsd/nic_uio/nic_uio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/freebsd/nic_uio/nic_uio.c b/kernel/freebsd/nic_uio/nic_uio.c index 7a81694c92..0043892870 100644 --- a/kernel/freebsd/nic_uio/nic_uio.c +++ b/kernel/freebsd/nic_uio/nic_uio.c @@ -78,10 +78,14 @@ struct pci_bdf { uint32_t function; }; -static devclass_t nic_uio_devclass; - DEFINE_CLASS_0(nic_uio, nic_uio_driver, nic_uio_methods, sizeof(struct nic_uio_softc)); + +#if __FreeBSD_version < 1400000 +static devclass_t nic_uio_devclass; DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_devclass, nic_uio_modevent, 0); +#else +DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_modevent, 0); +#endif static int nic_uio_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr, -- 2.42.0