BUS_SET_RESOURCE(9)

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

okay bestie, welcome to BUS_SET_RESOURCE(9), straight from the Kernel Developer's Manual β€” and it's giving β€œassociate a definite resource with a given resource ID” energy. like, this is the page for bus_set_resource, and we're gonna get into it πŸ’…βœ¨

🌸 NAME 🌸

bus_set_resource β€” associate a definite resource with a given resource ID πŸŽ€

✨ SYNOPSIS ✨

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

#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>

int
bus_set_resource(device_t dev, int type, int rid, rman_res_t start,
    rman_res_t count);

πŸŽ€ DESCRIPTION πŸŽ€

okay so the bus_set_resource() function sets the start address of the resource type, rid pair to be count long. that's the whole move, bestie πŸ’–

ngl, client drivers typically do not use this interface. bus drivers, though? they use it a lot to set up the resources a client driver uses. main character bus-driver behavior, honestly 🫢

πŸ’… the arguments πŸ’…

  • dev β€” the device you're setting the resource on.
  • type β€” the type of resource you want to allocate. it is one of:
    • SYS_RES_IRQ β€” for IRQs
    • SYS_RES_DRQ β€” for ISA DMA lines
    • SYS_RES_IOPORT β€” for I/O ports
    • SYS_RES_MEMORY β€” for I/O memory
  • rid β€” a bus-specific handle that identifies the resource being allocated.
  • start β€” the start address of this resource.
  • count β€” the length of the resource. for example, the size of the memory in bytes. yes, bytes, bestie πŸ“

πŸ’– RETURN VALUES πŸ’–

zero is returned on success β€” otherwise, an error is returned. so like, zero = slay, anything else = the vibe check failed πŸ˜­πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

go peek at these, iykyk:

πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Warner Losh <imp@FreeBSD.org> πŸ’œ


πŸ’… that's the whole page, bestie β€” this cutie comes from the Debian manpage drop, dated March 29, 2003, and it's filed under BUS_SET_RESOURCE(9). mwah πŸ’–πŸŒˆ

πŸ“¦ where this page comes from