Commit Graph

71 Commits

Author SHA1 Message Date
Alexander Ziaee 4cf5878d27 devinfo.8: Document libxo support
PR:		289151
Fixes:		c759aca606 (Add support for libxo)
MFC after:	3 days
Reviewed by:	imp
Closes:		https://github.com/freebsd/freebsd-src/pull/1829
2025-08-29 08:43:45 -04:00
Alexander Ziaee 7e477aac80 devinfo.8: Polish
+ replace "-*- nroff -*-" comment with SPDX tag
+ alphabetize options in SYNOPSIS and DESCRIPTION
+ add HISTORY, correct two minor mdoc typos

MFC after:	3 days
Reviewed by:	imp
Closes:		https://github.com/freebsd/freebsd-src/pull/1829
2025-08-29 08:43:29 -04:00
Warner Losh e8d6b58ef5 devinfo: Fix some libxo errors
Add missing names of fields, as exposed by --libxo:JPW

Fixes: c759aca606
Noticed by: phil
Sponsored by: Netflix
2025-07-24 15:04:06 -06:00
ktullavik c759aca606 devinfo: Add support for libxo
Reviewed by: imp
Pull-Request: https://github.com/freebsd/freebsd-src/pull/1480
Closes: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:47 -06:00
ktullavik e90dd5d673 devinfo: Factor out helper function
This is prep for libxo.
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:47 -06:00
ktullavik d43ba99dd0 devinfo: Rename function and move out printf of device name
This is prep for libxo.
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik dcdfffd834 devinfo: Add missing function declarations
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik c73b33f85a devinfo: Add helper function
This is prep for libxo.
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik 471cff3eba devinfo: Rename function and add declaration
This is prep for libxo.
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik 9166666cc2 devinfo: Restructure function in prep for libxo
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik 50d1d4d4bf devinfo: Inline the code from print_resource()
The code will diverge when libxo is added.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik 204a9e9674 devinfo: Put expression into variable in prep for libxo
We'll need it twice when libxo is added.
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik 763ac7a343 devinfo: Turn '&&' into nested condition in prep for libxo
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:46 -06:00
ktullavik 171e3706e4 devinfo: Unwind the ternary operator to better fit future libxo structure
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:45 -06:00
ktullavik f8aa0ee8d0 devinfo: Introduce function for printing indent
When libxo is added we want the whole indentation to
be printed in a single call. Otherwise the html will be
spammed with indentation tags.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:45 -06:00
ktullavik 502977f858 devinfo: Use bool instead of int
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:45 -06:00
ktullavik f8ef84daf5 devinfo: Add missing 'static'
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
2025-05-06 16:01:45 -06:00
John Baldwin 9fab5bbc38 devinfo.8: Bump Dd for addition of -v to -u mode 2025-01-29 15:36:36 -05:00
John Baldwin b8529e7c5e devinfo: Distinguish resources owned by unnamed devices from free resources
For resources owned by an unnamed device, list the device name as
"(unknown)" instead of using "----".  In addition, if the -v flag is
given, output the pnpinfo and location info for the device if present.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D48676
2025-01-29 10:04:21 -05:00
John Baldwin 60516a51ab devinfo: Output device description in verbose mode
The description is listed in angle brackets after the device name
similar to device probe messages.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47157
2024-10-16 14:09:05 -04:00
Warner Losh e9ac41698b Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
2024-07-15 16:43:39 -06:00
Warner Losh 4d65a7c695 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
2023-11-26 22:24:01 -07:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh 4d846d260e 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
2023-05-12 10:44:03 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Emmanuel Vadot e7a5a60ed5 pkgbase: Put devmatch in its own package
devmatch is useful on standalone machine but not on jails.
Put devinfo(8) and libdevinfo there too.

Differential Revision:	https://reviews.freebsd.org/D36229
2022-10-26 19:46:38 +02:00
Warner Losh 5c19fabbe3 devinfo: xref devctl
devctl has ways to get the different locator's paths to devices, while
devinfo does not. xref devctl in devinfo(8) as a hint.

Sponsored by:		Netflix
2022-07-05 15:15:08 -06:00
Felix Johnson dde6071adc devinfo(8): Remove cross-reference to pnpinfo(8)
devinfo(8) manpage contains reference to pnpinfo(8) which existed at the
time. Remove it.

PR:		232587
MFC:		3 days
Reported by:	Graham Perrin <grahamperrin@gmail.com>
2021-11-01 12:29:12 -04:00
Alexander Motin 4d86ab429e Fix devinfo typo.
Submitted by:	Nick Wolff <darkfiberiru@gmail.com>
MFC after: 	1 week
Differential Revision:	https://reviews.freebsd.org/D27981
2021-01-05 14:56:23 -05:00
Warner Losh b98d2b35df 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.
2018-05-30 15:08:59 +00:00
Warner Losh b68de8941f 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
2017-12-21 19:19:43 +00:00
Warner Losh 3ca6eb9faf Fix markup and bump .Dd. 2017-12-21 18:58:14 +00:00
Warner Losh 3386009737 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
2017-12-21 18:51:47 +00:00
Pedro F. Giffuni 1de7b4b805 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.
2017-11-27 15:37:16 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Justin Hibbits da1b038af9 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
2016-03-18 01:28:41 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
John Baldwin 94f0eafcd2 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.
2015-02-05 22:42:44 +00:00
Baptiste Daroussin c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin 01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00