History log of /src/stand/libsa/dev.c (Results 1 – 25 of 32)
Revision Date Author Comments
# dd747d7b 02-Sep-2025 Warner Losh <imp@FreeBSD.org>

Revert "stand: Use calloc instead of malloc for initialization of filesystem devsw"

This reverts commit dfafdbdfc3e9db8b878283bcbef35f5d8d37dae8. There's no
author, and also problems with it. I'll r

Revert "stand: Use calloc instead of malloc for initialization of filesystem devsw"

This reverts commit dfafdbdfc3e9db8b878283bcbef35f5d8d37dae8. There's no
author, and also problems with it. I'll redo it.

Sponsored by: Netflix

show more ...


# dfafdbdf 01-Sep-2025 null <null>

stand: Use calloc instead of malloc for initialization of filesystem devsw

This change is required for https://reviews.freebsd.org/D49355, so that
we can check if d_dev is uninitialized by checking

stand: Use calloc instead of malloc for initialization of filesystem devsw

This change is required for https://reviews.freebsd.org/D49355, so that
we can check if d_dev is uninitialized by checking if it's NULL.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D49705

show more ...


# 7c43148a 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

stand: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Rem

stand: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 6e28a6bc 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

stand: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl

stand: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4883f347 13-Jan-2023 Warner Losh <imp@FreeBSD.org>

stand: dev can't be NULL in default_prasedev

We pass in the address of a variable to store this value always in the
only place that calls this function, so there is no need to test for NULL.

Sponso

stand: dev can't be NULL in default_prasedev

We pass in the address of a variable to store this value always in the
only place that calls this function, so there is no need to test for NULL.

Sponsored by: Netflix
Notied by: tsoome in D38041

show more ...


# bf020787 11-Jan-2023 Warner Losh <imp@FreeBSD.org>

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

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

show more ...


# a07cef5a 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: Add dv_match

On OpenFirmware, and possibly kboot, we use full path names for the
objects that are the 'device'. kboot uses a hack of knowing that all
disk device nodes start with '/dev', but

stand: Add dv_match

On OpenFirmware, and possibly kboot, we use full path names for the
objects that are the 'device'. kboot uses a hack of knowing that all
disk device nodes start with '/dev', but this generalizes it for
OpenFirmware where both 'block' and 'network' devices live in the same
namespace and one must ask the OF node its type to know if this device
type matches.

For drivers that don't specify, the current convention of using
strncmp() is retained. This is done only in devparse(), but everything
uses it directly (or will soon).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37554

show more ...


# 33bbe5dd 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: parsedev API change: devspec now points to start of full device name

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt

stand: parsedev API change: devspec now points to start of full device name

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt uboot, this is
just a drop in (since everything except uboot and openfirmware always
uses disk...: and/or zfs:, but openfirmware isn't really affected).

uboot we kludge around it by subtracting 4 from where the rest of the
device name starts. This is unforunate, and can compute the address one
before the string. But we never dereference that address. uboot needs
more work, and this is an acceptable UB until that other work happens.

OFW doesn't really use the parsedev routines these days (since none of
the supported device uses this... yet). It too needs more work, but it
needs device matching support first.

Sponsored by: Netflix
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D37553

show more ...


# 66012c8f 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: create devinit

devinit() marches through all the devices, calling the inint routines if
any exist. Replace all the identical copies of this code.

Sponsored by: Netflix
Differential Revision

stand: create devinit

devinit() marches through all the devices, calling the inint routines if
any exist. Replace all the identical copies of this code.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37349

show more ...


# 781ca0af 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: Introduce devparse to parse device / path strings

devparse is now the preferred interface to use to parse device
strings or device:/path strings. It parses the passed in string,
mallocs the d

stand: Introduce devparse to parse device / path strings

devparse is now the preferred interface to use to parse device
strings or device:/path strings. It parses the passed in string,
mallocs the device's particular devdesc string and returns the
'remainder' of the device:/path for further processing.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37338

show more ...


# dc472f67 11-Aug-2022 Warner Losh <imp@FreeBSD.org>

stand: Add devformat to return formatted string for a device

Use dv_fmtdev to return a formatted string for a device. If this is a
null pointer, return the device name and unit followed by a colon (

stand: Add devformat to return formatted string for a device

Use dv_fmtdev to return a formatted string for a device. If this is a
null pointer, return the device name and unit followed by a colon (eg
disk3:).

Sponsored by: Netflix
Reviewed by: tsoome (prior version)
Differential Revision: https://reviews.freebsd.org/D35916

show more ...


# 1f629966 07-Jul-2021 Alfonso <gfunni234@gmail.com>

ANSIify libsa functions

Convert libsa files to use ANSI function definitions.

Pull request: https://github.com/freebsd/freebsd-src/pull/508
[ cut and paste error corrected ]


# dd747d7b 02-Sep-2025 Warner Losh <imp@FreeBSD.org>

Revert "stand: Use calloc instead of malloc for initialization of filesystem devsw"

This reverts commit dfafdbdfc3e9db8b878283bcbef35f5d8d37dae8. There's no
author, and also problems with it. I'll r

Revert "stand: Use calloc instead of malloc for initialization of filesystem devsw"

This reverts commit dfafdbdfc3e9db8b878283bcbef35f5d8d37dae8. There's no
author, and also problems with it. I'll redo it.

Sponsored by: Netflix

show more ...


# dfafdbdf 01-Sep-2025 null <null>

stand: Use calloc instead of malloc for initialization of filesystem devsw

This change is required for https://reviews.freebsd.org/D49355, so that
we can check if d_dev is uninitialized by checking

stand: Use calloc instead of malloc for initialization of filesystem devsw

This change is required for https://reviews.freebsd.org/D49355, so that
we can check if d_dev is uninitialized by checking if it's NULL.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D49705

show more ...


# 7c43148a 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

stand: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Rem

stand: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 6e28a6bc 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

stand: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl

stand: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4883f347 13-Jan-2023 Warner Losh <imp@FreeBSD.org>

stand: dev can't be NULL in default_prasedev

We pass in the address of a variable to store this value always in the
only place that calls this function, so there is no need to test for NULL.

Sponso

stand: dev can't be NULL in default_prasedev

We pass in the address of a variable to store this value always in the
only place that calls this function, so there is no need to test for NULL.

Sponsored by: Netflix
Notied by: tsoome in D38041

show more ...


# bf020787 11-Jan-2023 Warner Losh <imp@FreeBSD.org>

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

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

show more ...


# a07cef5a 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: Add dv_match

On OpenFirmware, and possibly kboot, we use full path names for the
objects that are the 'device'. kboot uses a hack of knowing that all
disk device nodes start with '/dev', but

stand: Add dv_match

On OpenFirmware, and possibly kboot, we use full path names for the
objects that are the 'device'. kboot uses a hack of knowing that all
disk device nodes start with '/dev', but this generalizes it for
OpenFirmware where both 'block' and 'network' devices live in the same
namespace and one must ask the OF node its type to know if this device
type matches.

For drivers that don't specify, the current convention of using
strncmp() is retained. This is done only in devparse(), but everything
uses it directly (or will soon).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37554

show more ...


# 33bbe5dd 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: parsedev API change: devspec now points to start of full device name

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt

stand: parsedev API change: devspec now points to start of full device name

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt uboot, this is
just a drop in (since everything except uboot and openfirmware always
uses disk...: and/or zfs:, but openfirmware isn't really affected).

uboot we kludge around it by subtracting 4 from where the rest of the
device name starts. This is unforunate, and can compute the address one
before the string. But we never dereference that address. uboot needs
more work, and this is an acceptable UB until that other work happens.

OFW doesn't really use the parsedev routines these days (since none of
the supported device uses this... yet). It too needs more work, but it
needs device matching support first.

Sponsored by: Netflix
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D37553

show more ...


# 66012c8f 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: create devinit

devinit() marches through all the devices, calling the inint routines if
any exist. Replace all the identical copies of this code.

Sponsored by: Netflix
Differential Revision

stand: create devinit

devinit() marches through all the devices, calling the inint routines if
any exist. Replace all the identical copies of this code.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37349

show more ...


# 781ca0af 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: Introduce devparse to parse device / path strings

devparse is now the preferred interface to use to parse device
strings or device:/path strings. It parses the passed in string,
mallocs the d

stand: Introduce devparse to parse device / path strings

devparse is now the preferred interface to use to parse device
strings or device:/path strings. It parses the passed in string,
mallocs the device's particular devdesc string and returns the
'remainder' of the device:/path for further processing.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37338

show more ...


# dc472f67 11-Aug-2022 Warner Losh <imp@FreeBSD.org>

stand: Add devformat to return formatted string for a device

Use dv_fmtdev to return a formatted string for a device. If this is a
null pointer, return the device name and unit followed by a colon (

stand: Add devformat to return formatted string for a device

Use dv_fmtdev to return a formatted string for a device. If this is a
null pointer, return the device name and unit followed by a colon (eg
disk3:).

Sponsored by: Netflix
Reviewed by: tsoome (prior version)
Differential Revision: https://reviews.freebsd.org/D35916

show more ...


12