Lines Matching refs:msg

142 xc_insert(void *queue, xc_msg_t *msg)  in xc_insert()  argument
150 ASSERT(msg->xc_command != XC_MSG_FREE || in xc_insert()
151 cpu[msg->xc_master] == NULL || /* possible only during init */ in xc_insert()
152 queue == &cpu[msg->xc_master]->cpu_m.xc_free); in xc_insert()
156 msg->xc_next = old_head; in xc_insert()
157 } while (atomic_cas_ptr(queue, old_head, msg) != old_head); in xc_insert()
189 xc_msg_t *msg = xc_extract(&mcpup->xc_msgbox); in xc_get() local
190 mcpup->xc_curmsg = msg; in xc_get()
191 return (msg); in xc_get()
202 xc_msg_t *msg; in xc_init_cpu() local
215 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
216 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
217 msg->xc_master = cpup->cpu_id; in xc_init_cpu()
218 xc_insert(&cpup->cpu_m.xc_free, msg); in xc_init_cpu()
227 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
228 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
229 msg->xc_master = c; in xc_init_cpu()
230 xc_insert(&cpu[c]->cpu_m.xc_free, msg); in xc_init_cpu()
232 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
233 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
234 msg->xc_master = cpup->cpu_id; in xc_init_cpu()
235 xc_insert(&cpup->cpu_m.xc_free, msg); in xc_init_cpu()
243 msg = kmem_zalloc(sizeof (*msg), KM_SLEEP); in xc_init_cpu()
244 msg->xc_command = XC_MSG_FREE; in xc_init_cpu()
245 msg->xc_master = cpup->cpu_id; in xc_init_cpu()
246 xc_insert(&cpup->cpu_m.xc_free, msg); in xc_init_cpu()
256 xc_msg_t *msg; in xc_fini_cpu() local
262 while ((msg = xc_extract(&cpup->cpu_m.xc_free)) != NULL) { in xc_fini_cpu()
263 kmem_free(msg, sizeof (*msg)); in xc_fini_cpu()
314 xc_msg_t *msg; in xc_serv() local
330 for (msg = NULL; msg == NULL; msg = xc_get()) { in xc_serv()
357 switch (msg->xc_command) { in xc_serv()
364 data = &cpu[msg->xc_master]->cpu_m.xc_data; in xc_serv()
369 msg->xc_command = XC_MSG_DONE; in xc_serv()
370 xc_insert(&cpu[msg->xc_master]->cpu_m.xc_msgbox, msg); in xc_serv()
381 data = &cpu[msg->xc_master]->cpu_m.xc_data; in xc_serv()
385 msg->xc_command = XC_MSG_WAITING; in xc_serv()
386 xc_insert(&cpu[msg->xc_master]->cpu_m.xc_msgbox, msg); in xc_serv()
395 xc_insert(&xc_waiters, msg); in xc_serv()
398 while ((msg = xc_extract(&xc_waiters)) != NULL) { in xc_serv()
399 msg->xc_command = XC_MSG_RELEASED; in xc_serv()
400 xc_insert(&cpu[msg->xc_slave]->cpu_m.xc_msgbox, in xc_serv()
401 msg); in xc_serv()
414 data = &cpu[msg->xc_master]->cpu_m.xc_data; in xc_serv()
420 msg->xc_command = XC_MSG_DONE; in xc_serv()
421 xc_insert(&cpu[msg->xc_master]->cpu_m.xc_msgbox, msg); in xc_serv()
431 msg->xc_command = XC_MSG_FREE; in xc_serv()
432 xc_insert(&mcpup->xc_free, msg); in xc_serv()
437 panic("free message 0x%p in msgbox", (void *)msg); in xc_serv()
441 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()