From nobody Tue Nov 12 02:01:58 2024 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 4XnV5z0506z5cxgg; Tue, 12 Nov 2024 02:01:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XnV5y50w7z3x86; Tue, 12 Nov 2024 02:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731376918; 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=6T6VA0tU2mPx/WDQXFVl51zAQOE1H+1zQFD7WkhZMwI=; b=H+OOhz6VVVAF2YKGBwLEcT7dhSxARrPyvO9p3ne6bvdPX7+1wRIbStNUcuRJQAQIaNYP0a dxZTc9LsHC93xiWa3I/2viHPi7qHD8JrVw3rqdbKHMRLuQO0Y3LEBrTLqk9wLK5wwkj8qs lNPAY8bqd2nqwEo865nlOOKJ7ZnUMd6v0IwqBR8PNvmSPtneWqSsii2xutp8Tskz6GNwXO LjKf/4nfXL7xLMphPXwpfzM9GU6/UVZ3QLUYwdfHGzP4cIF37+4MD4ZzkPzAvD7jAj2uV4 d5HXXPeS0HRkqUOmXyCZoGb1gHlueZl/s9Y0stZZBcPa9SY2LBl2xwBuQV4ISA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731376918; 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=6T6VA0tU2mPx/WDQXFVl51zAQOE1H+1zQFD7WkhZMwI=; b=wnxJ2gmEx8SRKKQn0q8kEkvHoZqbEveLlRTjW6frJlhLGKbiHd4Nn/x8mrlfYZFbhg2om5 Z3y63nARTMYhB9lgcmcXhqMZmm3U6vA7PnnGmg2pheC4jwLZmqIZDYJ4sXcEsssd6VQlVH kRRcuYCm1gEb+1vJIMun97HhEcjHus7OKKLwdGO13c89nKNCZehfEeayU3TmguO6ScY8Cn zSC1YbLE32GV21YGX6PT0xDvXjCUq2mLVwhEbQxUSspnk2LGZV+MRM9pKAgNat4KEq0ol8 rmN9RIuJ/gvo9aWHEpboQgGGYqUKqiHthlsMH6XRUxVbQtPPZ/1H/XigLLjPWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731376918; a=rsa-sha256; cv=none; b=HszyYTxEMtbc9T0mx0NStvNSQcjJoduclPNesW+GpOb+s9QYEpkgDFWQtlnTsS5BWyCyI5 VX9yKvC0PpVq9QJAsXKI0EEzHOQ1SzYJsri3RS1WqMtnpOcf74/ZVHcxyL1o3QWQ2/hINw YLXCGdLAG7VkxU1PmLGfntl4myJll40yNkUC6NZi05dTmzZ+OMlG9wje0tOXl6KsWXR1cy qQHdKp/D5E5M4vyw/MkeR8AJAiMkKWh3QUmZ/XvbYNlHS6XpcpGZoXoJeBgDUGcKL6by0J +pELYFNl/rF87G/BXSrVHqAXyOj+C2jW6mAwxEzJpiS4VrGFpYU3i5KAN5p6vQ== 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 4XnV5y4b1FzrYw; Tue, 12 Nov 2024 02:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AC21wTZ023067; Tue, 12 Nov 2024 02:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AC21wNW023064; Tue, 12 Nov 2024 02:01:58 GMT (envelope-from git) Date: Tue, 12 Nov 2024 02:01:58 GMT Message-Id: <202411120201.4AC21wNW023064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 195402c5c5b7b3236c0680f06b60b7f9465982c8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=195402c5c5b7b3236c0680f06b60b7f9465982c8 commit 195402c5c5b7b3236c0680f06b60b7f9465982c8 Author: Mark Johnston AuthorDate: 2024-11-12 01:57:35 +0000 Commit: Mark Johnston CommitDate: 2024-11-12 01:57:35 +0000 busdma_bounce: Replace a SYSINIT with static initializations No functional change intended. MFC after: 1 week --- sys/kern/subr_busdma_bounce.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c index a27bc423c23a..60fe2fc6b2a6 100644 --- a/sys/kern/subr_busdma_bounce.c +++ b/sys/kern/subr_busdma_bounce.c @@ -86,11 +86,14 @@ struct bounce_zone { }; static struct mtx bounce_lock; +MTX_SYSINIT(bounce_lock, &bounce_lock, "bounce pages lock", MTX_DEF); static int total_bpages; static int busdma_zonecount; -static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list = + STAILQ_HEAD_INITIALIZER(bounce_zone_list); +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist = + STAILQ_HEAD_INITIALIZER(bounce_map_callbacklist); static MALLOC_DEFINE(M_BOUNCE, "bounce", "busdma bounce pages"); @@ -130,17 +133,6 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) return (0); } -static void -init_bounce_pages(void *dummy __unused) -{ - - total_bpages = 0; - STAILQ_INIT(&bounce_zone_list); - STAILQ_INIT(&bounce_map_callbacklist); - mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF); -} -SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL); - static struct sysctl_ctx_list * busdma_sysctl_tree(struct bounce_zone *bz) {