Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111108461
D37555.id113720.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
970 B
Referenced Files
None
Subscribers
None
D37555.id113720.diff
View Options
diff --git a/stand/libofw/ofw_disk.c b/stand/libofw/ofw_disk.c
--- a/stand/libofw/ofw_disk.c
+++ b/stand/libofw/ofw_disk.c
@@ -184,6 +184,30 @@
static int
ofwd_print(int verbose __unused)
{
+ uintmax_t block_size, n;
+ int ret;
+ char line[80];
+
+ /*
+ * We don't have a list of devices since we don't parse the whole OFW
+ * tree to find them. Instead, if we have an open device print info
+ * about it. Otherwise say we can't. Makes lsdev nicer.
+ */
+ if ((ret = pager_output("block devices:\n")) != 0)
+ return (ret);
+ if (kdp != NULL) {
+ block_size = OF_block_size(kdp->d_handle);
+ n = OF_blocks(kdp->d_handle);
+ snprintf(line, sizeof(line),
+ " %s: OFW block device (%ju X %ju): %ju bytes\n",
+ kdp->d_path, n, block_size, n * block_size);
+ if ((ret = pager_output(line)) != 0)
+ return (ret);
+ } else {
+ if ((ret = pager_output(" none are open, so no info\n")) != 0)
+ return (ret);
+ }
+
return (0);
}
static char *
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 28, 1:11 PM (5 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16883876
Default Alt Text
D37555.id113720.diff (970 B)
Attached To
Mode
D37555: stand: Implement ofw disk print routine
Attached
Detach File
Event Timeline
Log In to Comment