SIMPLE SOLUTIONS

BUS_RELEASE_RESOURCE(9FREEBSD) - man page online | system kernel interfaces

Release resources on a bus.

Chapter
May 18, 2000
BUS_RELEASE_RESOURCE(9)           BSD Kernel Developer's Manual           BUS_RELEASE_RESOURCE(9)

NAME bus_release_resource — release resources on a bus
SYNOPSIS #include <sys/param.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/rman.h> #include <machine/resource.h> int bus_release_resource(device_t dev, int type, int rid, struct resource *r);
DESCRIPTION Free a resource allocated by bus_alloc_resource(9). The resource must not be in use on release, i.e., call an appropriate function before (e.g. bus_teardown_intr(9) for IRQs). dev is the device that owns the resource. type is the type of resource that is released. It must be of the same type you allocated it as before. See bus_alloc_resource(9) for valid types. rid is the resource ID of the resource. The rid value must be the same as the one returned by bus_alloc_resource(9). r is the pointer to struct resource, i.e., the resource itself, returned by bus_alloc_resource(9).
RETURN VALUES EINVAL is returned, if the device dev has no parent, 0 otherwise. The kernel will panic, if it cannot release the resource.
EXAMPLES /* deactivate IRQ */ bus_teardown_intr(dev, foosoftc->irqres, foosoftc->irqid); /* release IRQ resource */ bus_release_resource(dev, SYS_RES_IRQ, foosoftc->irqid, foosoftc->irqres); /* release I/O port resource */ bus_release_resource(dev, SYS_RES_IOPORT, foosoftc->portid, foosoftc->portres);
SEE ALSO bus_alloc_resource(9), device(9), driver(9)
AUTHORS This manual page was written by Alexander Langer <@big.endian.de>.
BSD May 18, 2000 BSD
This manual Reference Other manuals
bus_release_resource(9freebsd) referred by bus_adjust_resource(9freebsd) | bus_alloc_resource(9freebsd) | bus_alloc_resource_any(9freebsd) | pci(9freebsd) | pci_alloc_msi(9freebsd) | pci_alloc_msix(9freebsd) | pci_disable_busmaster(9freebsd) | pci_disable_io(9freebsd) | pci_enable_busmaster(9freebsd) | pci_enable_io(9freebsd) | pci_find_bsf(9freebsd) | pci_find_cap(9freebsd) | pci_find_dbsf(9freebsd) | pci_find_device(9freebsd) | pci_find_extcap(9freebsd) | pci_find_htcap(9freebsd) | pci_get_max_read_req(9freebsd) | pci_get_powerstate(9freebsd) | pci_get_vpd_ident(9freebsd) | pci_get_vpd_readonly(9freebsd)
refer to bus_alloc_resource(9freebsd) | device(9freebsd) | driver(9freebsd)