* 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) */
| 3532 | * (or equivalent) |
| 3533 | */ |
| 3534 | item_p |
| 3535 | ng_package_msg(struct ng_mesg *msg, int flags) |
| 3536 | { |
| 3537 | item_p item; |
| 3538 | |
| 3539 | if ((item = ng_alloc_item(NGQF_MESG, flags)) == NULL) { |
| 3540 | NG_FREE_MSG(msg); |
| 3541 | return (NULL); |
| 3542 | } |
| 3543 | ITEM_DEBUG_CHECKS; |
| 3544 | /* Messages items count as writers unless explicitly exempted. */ |
| 3545 | if (msg->header.cmd & NGM_READONLY) |
| 3546 | item->el_flags |= NGQF_READER; |
| 3547 | else |
| 3548 | item->el_flags |= NGQF_WRITER; |
| 3549 | /* |
| 3550 | * Set the current lasthook into the queue item |
| 3551 | */ |
| 3552 | NGI_MSG(item) = msg; |
| 3553 | NGI_RETADDR(item) = 0; |
| 3554 | return (item); |
| 3555 | } |
| 3556 | |
| 3557 | #define SET_RETADDR(item, here, retaddr) \ |
| 3558 | do { /* Data or fn items don't have retaddrs */ \ |
no test coverage detected