| 332 | } |
| 333 | |
| 334 | void |
| 335 | init_unrhdr(struct unrhdr *uh, int low, int high, struct mtx *mutex) |
| 336 | { |
| 337 | |
| 338 | KASSERT(low >= 0 && low <= high, |
| 339 | ("UNR: use error: new_unrhdr(%d, %d)", low, high)); |
| 340 | if (mutex != NULL) |
| 341 | uh->mtx = mutex; |
| 342 | else |
| 343 | uh->mtx = &unitmtx; |
| 344 | TAILQ_INIT(&uh->head); |
| 345 | TAILQ_INIT(&uh->ppfree); |
| 346 | uh->low = low; |
| 347 | uh->high = high; |
| 348 | uh->first = 0; |
| 349 | uh->last = 1 + (high - low); |
| 350 | check_unrhdr(uh, __LINE__); |
| 351 | } |
| 352 | |
| 353 | /* |
| 354 | * Allocate a new unrheader set. |
no test coverage detected