| 384 | } |
| 385 | |
| 386 | int |
| 387 | register_msgring_handler(int startb, int endb, msgring_handler action, |
| 388 | void *arg) |
| 389 | { |
| 390 | int i; |
| 391 | |
| 392 | if (bootverbose) |
| 393 | printf("Register handler %d-%d %p(%p)\n", |
| 394 | startb, endb, action, arg); |
| 395 | KASSERT(startb >= 0 && startb <= endb && endb < MSGRNG_NSTATIONS, |
| 396 | ("Invalid value for bucket range %d,%d", startb, endb)); |
| 397 | |
| 398 | mtx_lock_spin(&msgmap_lock); |
| 399 | for (i = startb; i <= endb; i++) { |
| 400 | KASSERT(msgmap[i].action == NULL, |
| 401 | ("Bucket %d already used [action %p]", i, msgmap[i].action)); |
| 402 | msgmap[i].action = action; |
| 403 | msgmap[i].arg = arg; |
| 404 | } |
| 405 | mtx_unlock_spin(&msgmap_lock); |
| 406 | return (0); |
| 407 | } |
| 408 | |
| 409 | /* |
| 410 | * Initialize the messaging subsystem. |
no test coverage detected