Lines Matching refs:msg

157 xc_insert(void *queue, xc_msg_t *msg)  in xc_insert()  argument
165 ASSERT(msg->xc_command != XC_MSG_FREE || in xc_insert()
166 cpu[msg->xc_master] == NULL || /* possible only during init */ in xc_insert()
167 queue == &cpu[msg->xc_master]->cpu_m.xc_free); in xc_insert()
171 msg->xc_next = old_head; in xc_insert()
172 } while (atomic_cas_ptr(queue, old_head, msg) != old_head); in xc_insert()
203 xc_msg_t *msg; in xc_init_cpu() local
216 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
217 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
218 msg->xc_master = cpup->cpu_id; in xc_init_cpu()
219 xc_insert(&cpup->cpu_m.xc_free, msg); in xc_init_cpu()
228 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
229 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
230 msg->xc_master = c; in xc_init_cpu()
231 xc_insert(&cpu[c]->cpu_m.xc_free, msg); in xc_init_cpu()
233 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
234 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
235 msg->xc_master = cpup->cpu_id; in xc_init_cpu()
236 xc_insert(&cpup->cpu_m.xc_free, msg); in xc_init_cpu()
244 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
245 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
246 msg->xc_master = cpup->cpu_id; in xc_init_cpu()
247 xc_insert(&cpup->cpu_m.xc_free, msg); in xc_init_cpu()
257 xc_msg_t *msg; in xc_fini_cpu() local
263 while ((msg = xc_extract(&cpup->cpu_m.xc_free)) != NULL) { in xc_fini_cpu()
264 kmem_free(msg, sizeof (*msg)); in xc_fini_cpu()
315 xc_msg_t *msg; in xc_serv() local
331 for (msg = NULL; msg == NULL; in xc_serv()
332 msg = xc_extract(&mcpup->xc_msgbox)) { in xc_serv()
359 switch (msg->xc_command) { in xc_serv()
366 data = &cpu[msg->xc_master]->cpu_m.xc_data; in xc_serv()
371 msg->xc_command = XC_MSG_DONE; in xc_serv()
372 xc_insert(&cpu[msg->xc_master]->cpu_m.xc_msgbox, msg); in xc_serv()
383 data = &cpu[msg->xc_master]->cpu_m.xc_data; in xc_serv()
387 msg->xc_command = XC_MSG_WAITING; in xc_serv()
388 xc_insert(&cpu[msg->xc_master]->cpu_m.xc_msgbox, msg); in xc_serv()
397 xc_insert(&xc_waiters, msg); in xc_serv()
400 while ((msg = xc_extract(&xc_waiters)) != NULL) { in xc_serv()
401 msg->xc_command = XC_MSG_RELEASED; in xc_serv()
402 xc_insert(&cpu[msg->xc_slave]->cpu_m.xc_msgbox, in xc_serv()
403 msg); in xc_serv()
416 data = &cpu[msg->xc_master]->cpu_m.xc_data; in xc_serv()
422 msg->xc_command = XC_MSG_DONE; in xc_serv()
423 xc_insert(&cpu[msg->xc_master]->cpu_m.xc_msgbox, msg); in xc_serv()
433 msg->xc_command = XC_MSG_FREE; in xc_serv()
434 xc_insert(&mcpup->xc_free, msg); in xc_serv()
439 panic("free message 0x%p in msgbox", (void *)msg); in xc_serv()
443 panic("bad message 0x%p in msgbox", (void *)msg); in xc_serv()
464 xc_msg_t *msg; in xc_common() local
501 msg = xc_extract(&CPU->cpu_m.xc_free); in xc_common()
502 if (msg == NULL) in xc_common()
504 msg->xc_command = command; in xc_common()
505 if (msg->xc_master != CPU->cpu_id) in xc_common()
506 panic("msg %p has wrong xc_master", (void *)msg); in xc_common()
507 msg->xc_slave = c; in xc_common()
524 xc_insert(&cpup->cpu_m.xc_msgbox, msg); in xc_common()