BUS_PRINT_CHILD_HEADER(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… BUS_GENERIC_PRINT_CHILD(9) β€” the kernel dev manual, bestie edition

okay so this is a page from the Kernel Developer's Manual, and it's literally all about how your kernel announces devices in that cute little one-line format you see at boot. you already know the vibe, let's get into it πŸŽ€


✨ NAME ✨

bus_generic_print_child, bus_print_child_domain, bus_print_child_footer, bus_print_child_header β€” the generic implementation of BUS_PRINT_CHILD(9), bestie. that's it, that's the whole family 🫢


🌸 SYNOPSIS 🌸

#include <sys/param.h>
#include <sys/bus.h>

int
bus_generic_print_child(device_t dev, device_t child);

int
bus_print_child_domain(device_t dev, device_t child);

int
bus_print_child_footer(device_t dev, device_t child);

int
bus_print_child_header(device_t dev, device_t child);

πŸ’– DESCRIPTION πŸ’–

so bus_generic_print_child() prints out the default device announcement message. like, the classic. icon behaviour only. ✨

say you've got device foo0 sitting on bus bar0, and foo0 has the description β€œFooCard 1234” and is associated with the NUMA domain 1 β€” then this is what gets printed:

foo0: <FooCard 1234> numa-domain 1 on bar0

gorgeous. no notes. πŸ’…

now here's the lore: bus_generic_print_child() doesn't do it alone β€” it calls the three helper functions bus_print_child_header(), bus_print_child_domain(), and bus_print_child_footer().

  • bus_print_child_header() β€” outputs the device name and unit, followed by the device description in angle brackets (foo0: <FooCard 1234>).
  • bus_print_child_domain() β€” outputs " numa-domain" followed by the domain number if bus_get_domain() returns a valid domain for the device (numa-domain 1). if dev isn't associated with a valid domain, literally nothing is output. silence. ghosted. πŸ™ˆ
  • bus_print_child_footer() β€” outputs the string " on" followed by the parent device's name and unit (" on bar0").

these functions are there for you if you want to implement BUS_PRINT_CHILD(9) in a bus driver and bus_generic_print_child() just isn't sufficient for your needs. main character energy, do it yourself πŸ’ͺ


⭐ RETURN VALUES ⭐

the number of characters output. that's the whole answer, fr fr.


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson. shoutout, king 🫑


and that's the page!! source is Debian, dated February 5, 2025 β€” mwah, go print some children πŸ’œπŸŽ€

πŸ“¦ where this page comes from