* Initialize a message buffer of the specified size at the specified * location. This also zeros the buffer area. */
| 63 | * location. This also zeros the buffer area. |
| 64 | */ |
| 65 | void |
| 66 | msgbuf_init(struct msgbuf *mbp, void *ptr, int size) |
| 67 | { |
| 68 | |
| 69 | mbp->msg_ptr = ptr; |
| 70 | mbp->msg_size = size; |
| 71 | mbp->msg_seqmod = SEQMOD(size); |
| 72 | msgbuf_clear(mbp); |
| 73 | mbp->msg_magic = MSG_MAGIC; |
| 74 | mbp->msg_lastpri = -1; |
| 75 | mbp->msg_flags = 0; |
| 76 | bzero(&mbp->msg_lock, sizeof(mbp->msg_lock)); |
| 77 | mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN); |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | * Reinitialize a message buffer, retaining its previous contents if |
no test coverage detected