* Allocate a queue item and put items into it.. * Evaluate the address as this will be needed to queue it and * to work out what some of the fields should be. * Hook and node references will be removed when the item is dequeued. * (or equivalent) */
| 3562 | * (or equivalent) |
| 3563 | */ |
| 3564 | item_p |
| 3565 | ng_package_msg(struct ng_mesg *msg, int flags) |
| 3566 | { |
| 3567 | item_p item; |
| 3568 | |
| 3569 | if ((item = ng_alloc_item(NGQF_MESG, flags)) == NULL) { |
| 3570 | NG_FREE_MSG(msg); |
| 3571 | return (NULL); |
| 3572 | } |
| 3573 | ITEM_DEBUG_CHECKS; |
| 3574 | /* Messages items count as writers unless explicitly exempted. */ |
| 3575 | if (msg->header.cmd & NGM_READONLY) |
| 3576 | item->el_flags |= NGQF_READER; |
| 3577 | else |
| 3578 | item->el_flags |= NGQF_WRITER; |
| 3579 | /* |
| 3580 | * Set the current lasthook into the queue item |
| 3581 | */ |
| 3582 | NGI_MSG(item) = msg; |
| 3583 | NGI_RETADDR(item) = 0; |
| 3584 | return (item); |
| 3585 | } |
| 3586 | |
| 3587 | #define SET_RETADDR(item, here, retaddr) \ |
| 3588 | do { /* Data or fn items don't have retaddrs */ \ |
nothing calls this directly
no test coverage detected