* @brief Reclaim memory used by a resource list. * * This function frees the memory for all resource entries on the list * (if any). * * @param rl the resource list to free */
| 3137 | * @param rl the resource list to free |
| 3138 | */ |
| 3139 | void |
| 3140 | resource_list_free(struct resource_list *rl) |
| 3141 | { |
| 3142 | struct resource_list_entry *rle; |
| 3143 | |
| 3144 | while ((rle = STAILQ_FIRST(rl)) != NULL) { |
| 3145 | if (rle->res) |
| 3146 | panic("resource_list_free: resource entry is busy"); |
| 3147 | STAILQ_REMOVE_HEAD(rl, link); |
| 3148 | free(rle, M_BUS); |
| 3149 | } |
| 3150 | } |
| 3151 | |
| 3152 | /** |
| 3153 | * @brief Add a resource entry. |
no test coverage detected