Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2023 22:14:21 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 6c918e0bfaf8 - stable/13 - stand: Move dev_cleanup into libsa
Message-ID:  <202301242214.30OMELbO089708@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=6c918e0bfaf8268e42a4b612c3f218e1abf97a2b

commit 6c918e0bfaf8268e42a4b612c3f218e1abf97a2b
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-01-11 22:14:17 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301242214.30OMELbO089708>