BUS_GET_RESOURCE(9)
π BUS_GET_RESOURCE(9) π
okay so bestie, welcome to the Kernel Developer's Manual, section 9 β this is where we talk about bus_get_resource π and honestly? it's giving "small function, big responsibilities". let's get into it π¦
β¨ NAME β¨
bus_get_resource β read a resource range/value with a given resource ID π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/rman.h>
int
bus_get_resource(device_t dev, int type, int rid, rman_res_t *startp,
rman_res_t *countp);
π DESCRIPTION π
so the bus_get_resource() function reads the range or value of the resource type, rid pair, and stores it in the startp and countp arguments. like it literally goes and fetches the tea and puts it in your pointers π«Ά
the arguments are as follows, no cap:
devβ the device to read the resource from. that's your main character here πtypeβ the type of resource you want to read. it is one of:SYS_RES_IRQβ for IRQs β‘SYS_RES_DRQβ for ISA DMA lines πSYS_RES_MEMORYβ for I/O memory π§SYS_RES_IOPORTβ for I/O ports π
ridβ a bus-specific handle that identifies the resource being read. iykyk π₯startpβ a pointer to the start address of this resource. πcountpβ a pointer to the length of the resource. for example, the size of the memory in bytes. it's literally measuring the vibe πβ¨
β RETURN VALUES β
zero is returned on success π otherwise an error is returned π (ngl we hate to see it, but that's the deal).
π¦ SEE ALSO π¦
π AUTHORS π
this manual page was written by Sascha Wildner. iconic behavior, we love to see it π
Debian Β· September 26, 2015 β that's the source, the version and the date bestie, and that's a wrap π periodt π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2008 The DragonFly Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms