Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/bus_if.m
Show First 20 Lines • Show All 281 Lines • ▼ Show 20 Lines | METHOD struct resource * alloc_resource { | ||||
rman_res_t _count; | rman_res_t _count; | ||||
u_int _flags; | u_int _flags; | ||||
} DEFAULT null_alloc_resource; | } DEFAULT null_alloc_resource; | ||||
/** | /** | ||||
* @brief Activate a resource | * @brief Activate a resource | ||||
* | * | ||||
* Activate a resource previously allocated with | * Activate a resource previously allocated with | ||||
* BUS_ALLOC_RESOURCE(). This may for instance map a memory region | * BUS_ALLOC_RESOURCE(). This may enable decoding of this resource in a | ||||
* into the kernel's virtual address space. | * device for instance. It will also establish a mapping for the resource | ||||
* unless RF_UNMAPPED was set when allocating the resource. | |||||
* | * | ||||
* @param _dev the parent device of @p _child | * @param _dev the parent device of @p _child | ||||
* @param _child the device which allocated the resource | * @param _child the device which allocated the resource | ||||
* @param _type the type of resource | * @param _type the type of resource | ||||
* @param _rid the resource identifier | * @param _rid the resource identifier | ||||
* @param _r the resource to activate | * @param _r the resource to activate | ||||
*/ | */ | ||||
METHOD int activate_resource { | METHOD int activate_resource { | ||||
device_t _dev; | device_t _dev; | ||||
device_t _child; | device_t _child; | ||||
int _type; | int _type; | ||||
int _rid; | int _rid; | ||||
struct resource *_r; | struct resource *_r; | ||||
}; | }; | ||||
/** | /** | ||||
* @brief Map a resource | |||||
* | |||||
* Allocate a mapping for a range of an active resource. The mapping | |||||
* is described by a struct resource_map object. This may for instance | |||||
* map a memory region into the kernel's virtual address space. | |||||
* | |||||
* @param _dev the parent device of @p _child | |||||
* @param _child the device which allocated the resource | |||||
* @param _type the type of resource | |||||
* @param _r the resource to map | |||||
* @param _args optional attributes of the mapping | |||||
* @param _map the mapping | |||||
*/ | |||||
METHOD int map_resource { | |||||
device_t _dev; | |||||
device_t _child; | |||||
int _type; | |||||
struct resource *_r; | |||||
struct resource_map_request *_args; | |||||
struct resource_map *_map; | |||||
} DEFAULT bus_generic_map_resource; | |||||
/** | |||||
* @brief Unmap a resource | |||||
* | |||||
* Release a mapping previously allocated with | |||||
* BUS_MAP_RESOURCE(). This may for instance unmap a memory region | |||||
* from the kernel's virtual address space. | |||||
* | |||||
* @param _dev the parent device of @p _child | |||||
* @param _child the device which allocated the resource | |||||
* @param _type the type of resource | |||||
* @param _r the resource | |||||
* @param _map the mapping to release | |||||
*/ | |||||
METHOD int unmap_resource { | |||||
device_t _dev; | |||||
device_t _child; | |||||
int _type; | |||||
struct resource *_r; | |||||
struct resource_map *_map; | |||||
} DEFAULT bus_generic_unmap_resource; | |||||
/** | |||||
* @brief Deactivate a resource | * @brief Deactivate a resource | ||||
* | * | ||||
* Deactivate a resource previously allocated with | * Deactivate a resource previously allocated with | ||||
* BUS_ALLOC_RESOURCE(). This may for instance unmap a memory region | * BUS_ALLOC_RESOURCE(). | ||||
* from the kernel's virtual address space. | |||||
* | * | ||||
* @param _dev the parent device of @p _child | * @param _dev the parent device of @p _child | ||||
* @param _child the device which allocated the resource | * @param _child the device which allocated the resource | ||||
* @param _type the type of resource | * @param _type the type of resource | ||||
* @param _rid the resource identifier | * @param _rid the resource identifier | ||||
* @param _r the resource to deactivate | * @param _r the resource to deactivate | ||||
*/ | */ | ||||
METHOD int deactivate_resource { | METHOD int deactivate_resource { | ||||
▲ Show 20 Lines • Show All 445 Lines • Show Last 20 Lines |