History log of /freebsd-current/usr.sbin/devinfo/devinfo.c
Revision Date Author Comments
# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: 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


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

Remove $FreeBSD$: one-line .c pattern

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


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 4d86ab42 05-Jan-2021 Alexander Motin <mav@FreeBSD.org>

Fix devinfo typo.

Submitted by: Nick Wolff <darkfiberiru@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27981


# b98d2b35 30-May-2018 Warner Losh <imp@FreeBSD.org>

devinfo_init() returns an errno, but doesn't set errno, so the error
message when it fails reflects some random thing rather than what it
returned. Set errno to the return value.


# b68de894 21-Dec-2017 Warner Losh <imp@FreeBSD.org>

When -v is specified with -p dev, print the same verbose output as
when listing the whole tree. The list, however, is from the requested
device to the root (so it backwards from the normal tree).

Sponsored by: Netflix


# 33860097 21-Dec-2017 Warner Losh <imp@FreeBSD.org>

Implement "-p dev" to print the path to the given device back to the
nexus. With redirection, could also be used to test if the device
exists in the device tree.

Sponsored by: Netflix


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# da1b038a 17-Mar-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.

On some architectures, u_long isn't large enough for resource definitions.
Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but
type `long' is only 32-bit. This extends rman's resources to uintmax_t. With
this change, any resource can feasibly be placed anywhere in physical memory
(within the constraints of the driver).

Why uintmax_t and not something machine dependent, or uint64_t? Though it's
possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on
32-bit architectures. 64-bit architectures should have plenty of RAM to absorb
the increase on resource sizes if and when this occurs, and the number of
resources on memory-constrained systems should be sufficiently small as to not
pose a drastic overhead. That being said, uintmax_t was chosen for source
clarity. If it's specified as uint64_t, all printf()-like calls would either
need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t
aren't horrible, but it would also bake into the API for
resource_list_print_type() either a hidden assumption that entries get cast to
uintmax_t for printing, or these calls would need the PRI*64 macros. Since
source code is meant to be read more often than written, I chose the clearest
path of simply using uintmax_t.

Tested on a PowerPC p5020-based board, which places all device resources in
0xfxxxxxxxx, and has 8GB RAM.
Regression tested on qemu-system-i386
Regression tested on qemu-system-mips (malta profile)

Tested PAE and devinfo on virtualbox (live CD)

Special thanks to bz for his testing on ARM.

Reviewed By: bz, jhb (previous)
Relnotes: Yes
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D4544


# 94f0eafc 05-Feb-2015 John Baldwin <jhb@FreeBSD.org>

Expose the constants for internal new-bus device flags to userland. The
flag value is already exposed via dv_flags, just not the meaning of the
flags themselves. Use these constants to annotate devices that are
disabled or suspended in devinfo output.


# e8f386b4 06-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Mark global functions and/or variables in devinfo(8) static where possible.

This allows compilers and static analyzers to do more thorough analysis.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 12628101 15-Nov-2009 Attilio Rao <attilio@FreeBSD.org>

Collapse devinfo_state_t with device_state_t in order to avoid a
structure replication and improve manteneability.

Reviewed by: jhb, imp
Tested by: Riccardo Torrini <riccardo at torrini dot org>


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# d9cec0a0 27-Oct-2007 John Baldwin <jhb@FreeBSD.org>

Bump up the limit for when to print the resources for a given resource
manager in hex vs decimal to 1000 from 100 so that IRQs are printed in
decimal.

MFC after: 3 days


# d20241a6 29-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Sync usage() and SYNOPSIS.


# 6e7abcb1 04-Jan-2004 Philippe Charnier <charnier@FreeBSD.org>

Remove unused local variable.


# 696a3d28 17-Feb-2003 Warner Losh <imp@FreeBSD.org>

-v now also prints the pnpinfo and location information for the devices
whose bus' provide this information.


# 7f156483 19-Sep-2002 Warner Losh <imp@FreeBSD.org>

o Don't print devices that aren't attached unless run with the newly
minted -v flag.
o Print devices that don't return a name as 'unknown' in -v mode.

# Yea! Now I wont think I have 10 different ISA network adapters in my
# laptop.


# 84e0df3f 09-Dec-2001 Mike Heffner <mikeh@FreeBSD.org>

WARNS=2 cleanup and fix potential unitialized variable bug.

PR: bin/32567
MFC after: 2 weeks


# ce7894ee 20-Apr-2001 Mike Smith <msmith@FreeBSD.org>

Simple tool to print the device tree and resource usage by devices. Also
serves as an example of libdevinfo usage.