Lines Matching refs:msg

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