MCPcopy Create free account
hub / github.com/F-Stack/f-stack / register_msgring_handler

Function register_msgring_handler

freebsd/mips/nlm/cms.c:386–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386int
387register_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.

Callers 3

nlm_xlpnae_attachFunction · 0.85
xlp_rsa_initFunction · 0.85
xlp_sec_initFunction · 0.85

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected