BUS_SET_RESOURCE(9)
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 IRQsSYS_RES_DRQβ for ISA DMA linesSYS_RES_IOPORTβ for I/O portsSYS_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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2003 M. Warner Losh <imp@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms