From nobody Tue Jan 24 22:14:21 2023 X-Original-To: dev-commits-src-branches@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 4P1h8Y6WL9z3bgfT; Tue, 24 Jan 2023 22:14:21 +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 4P1h8Y5KkXz3LGl; Tue, 24 Jan 2023 22:14:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598461; 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=6sCsyesoDwUyw9gC0WfNRNUFSkaeytcg4MNj/9P6+Lg=; b=dN5vuPkvHIIWzU4OIuEa5YPy7DjU05gUGBeE4yii7YDLV7mErG68gsq+HuPuFcnCcABqve qszkqEBD+XK5lPtDUobCxsl0XfvSK2gxR6Z5nsFx0RNNqRFv0TzmMRJfyEy6uqjzGKbnRY R9GE5kEo0lVRVT16CyCNTrKlkJQztUec/q+4UbcLNBi8v68Nm9Y31XdE74W40B6SVbujy6 P18/spwyaasWHxquM9IoEC/gcI6Z8M0RPA3urgRyBQDp1bVwDsjMcD94yDUZCxObQFGWP0 g52RBF0YXLCrSc4u5haLTUcmp4bZqb30km3oGAVBWfkyYVavaYErOr5LEzGjAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598461; 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=6sCsyesoDwUyw9gC0WfNRNUFSkaeytcg4MNj/9P6+Lg=; b=IFMwrNBYbOgsOa60j0lad1JrhY0BEGxRDUzmKvYdljq5NbfI2BNIm/dkSF1c3lZGKBEF6v cVTB/C1t+2j/m+L/9ZJYzwSne+SzAbryU02suggSpvdzSkJ2XJuLFYSuc3JplfYe7o9EFf SOADfT3PLXiJmYJwqxSibanCbrZmyPqGOlkxYRhBW12J8smUhTAVtJLlJSFzzVMOUVg/Tm waBNnglkQNgFV+1ykWCM+8Ooh7OwPl7egANMZlmCVys+cUN9o8/7juD13yATmgCboX6ics BwmiICEfjIpz8Kf6xP58l7fHbKvFiYOT4N8Y1pD0WjCYgiptbYzQikQX+wfkyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598461; a=rsa-sha256; cv=none; b=yQXp0SHEPob7hGifPhqsbn9F3eyj9jUFuhPCDHLbSPFUBg6pq5mDgnpjmNDxSsqKp/ybHd Qg9Zxkv6WoocijQPxjgMvFOuQZ1igfqF49RmHsWORx4j70JN+Wj/ckct9k7MQAM+0NA0Z1 6L02lyu76m+KZG07H5LjC10wIiLlz1JncKgCPD5BVUdic9zdlJnV81DgEQ90dG+4O/fC2m 5LQgn1sESbWsQIPgto455+meGovvPB4H6dAw2eVxYUVJGTYiLxLVgSxJCsBrpJZZO0Te+h uU4rfTVnqY3tL6MbcSewgodkw7iheXdco5VdMEeG2lIC1v4YhQE7Fey0Qc82kQ== 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 4P1h8Y4RqZzQk8; Tue, 24 Jan 2023 22:14:21 +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 30OMELca089709; Tue, 24 Jan 2023 22:14:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMELbO089708; Tue, 24 Jan 2023 22:14:21 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:14:21 GMT Message-Id: <202301242214.30OMELbO089708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6c918e0bfaf8 - stable/13 - stand: Move dev_cleanup into libsa List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6c918e0bfaf8268e42a4b612c3f218e1abf97a2b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6c918e0bfaf8268e42a4b612c3f218e1abf97a2b commit 6c918e0bfaf8268e42a4b612c3f218e1abf97a2b Author: Warner Losh AuthorDate: 2023-01-11 22:14:17 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:46 +0000 stand: Move dev_cleanup into libsa Since dev_cleanup() walks through all the devsw devices with dv_cleanup rotuines, move it into libsa rather than having it in 'common'. Logically, it operates only on things that are in libsa, and would never be different for different loaders: either people would call it as is, or they'd do the loop themselves with 'special' things inline between calls to cleanup (not that I think that will ever be needed though). Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D38004 (cherry picked from commit bf020787d5f1b4a1274135b49309f7e9ef3955e1) --- stand/common/bootstrap.h | 2 -- stand/common/misc.c | 11 ----------- stand/libsa/dev.c | 11 +++++++++++ stand/libsa/stand.h | 1 + 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index b16625774ce5..138e2e51ceff 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -381,8 +381,6 @@ extern struct arch_switch archsw; /* This must be provided by the MD code, but should it be in the archsw? */ void delay(int delay); -void dev_cleanup(void); - /* * nvstore API. */ diff --git a/stand/common/misc.c b/stand/common/misc.c index e1945b24be5a..e27191796a72 100644 --- a/stand/common/misc.c +++ b/stand/common/misc.c @@ -169,17 +169,6 @@ alloc_pread(readin_handle_t fd, off_t off, size_t len) return (buf); } -void -dev_cleanup(void) -{ - int i; - - /* Call cleanup routines */ - for (i = 0; devsw[i] != NULL; ++i) - if (devsw[i]->dv_cleanup != NULL) - (devsw[i]->dv_cleanup)(); -} - /* * mount new rootfs and unmount old, set "currdev" environment variable. */ diff --git a/stand/libsa/dev.c b/stand/libsa/dev.c index b273edb4457e..6d1834c8a14a 100644 --- a/stand/libsa/dev.c +++ b/stand/libsa/dev.c @@ -172,3 +172,14 @@ devinit(void) } return (err); } + +void +dev_cleanup(void) +{ + int i; + + /* Call cleanup routines */ + for (i = 0; devsw[i] != NULL; ++i) + if (devsw[i]->dv_cleanup != NULL) + (devsw[i]->dv_cleanup)(); +} diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h index b5087d17e114..87b86fb98b20 100644 --- a/stand/libsa/stand.h +++ b/stand/libsa/stand.h @@ -193,6 +193,7 @@ struct devdesc { char *devformat(struct devdesc *d); int devparse(struct devdesc **, const char *, const char **); int devinit(void); +void dev_cleanup(void); struct open_file { int f_flags; /* see F_* below */