Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2025 22:02:16 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 50d1d4d4bfb0 - main - devinfo: Inline the code from print_resource()
Message-ID:  <202505062202.546M2Gea042305@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=50d1d4d4bfb0292fb9b23ed84cdd333649a69880

commit 50d1d4d4bfb0292fb9b23ed84cdd333649a69880
Author:     ktullavik <ktullavik@gmail.com>
AuthorDate: 2024-10-17 18:17:40 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-05-06 22:01:46 +0000

    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
---
 usr.sbin/devinfo/devinfo.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c
index a4fa6892981f..7fbb34277d47 100644
--- a/usr.sbin/devinfo/devinfo.c
+++ b/usr.sbin/devinfo/devinfo.c
@@ -210,9 +210,26 @@ int
 print_rman_resource(struct devinfo_res *res, void *arg __unused)
 {
 	struct devinfo_dev	*dev;
+	struct devinfo_rman	*rman;
+	rman_res_t		end;
+	bool			hexmode;
 	
+	rman = devinfo_handle_to_rman(res->dr_rman);
+	hexmode =  (rman->dm_size > 1000) || (rman->dm_size == 0);
+	end = res->dr_start + res->dr_size - 1;
+
 	printf("    ");
-	print_resource(res);
+
+	if (hexmode) {
+		printf("0x%jx", res->dr_start);
+		if (res->dr_size > 1)
+			printf("-0x%jx", end);
+	} else {
+		printf("%ju", res->dr_start);
+		if (res->dr_size > 1)
+			printf("-%ju", end);
+	}
+
 	dev = devinfo_handle_to_device(res->dr_device);
 	if (dev != NULL) {
 		if (dev->dd_name[0] != 0) {



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