/* Advance the receive pointer for the queue to the next message.  */
void gru_free_message(struct gru_message_queue_desc *mqd, void *mesg)
/* Advance the receive pointer for the queue to the next message.  */
void gru_free_message(struct gru_message_queue_desc *mqd, void *mesg)
{
	struct message_queue *mq = mqd->mq;
	struct message_header *mhdr = mq->next;
	void *next, *pnext;
	int half = -1;
	int lines = mhdr->lines;
	if (lines == 2)
		restore_present2(mhdr, MQS_EMPTY);
	mhdr->present = MQS_EMPTY;
	pnext = mq->next;
	next = pnext + GRU_CACHE_LINE_BYTES * lines;
	if (next == mq->limit) {
		next = mq->start;
		half = 1;
	} else if (pnext < mq->start2 && next >= mq->start2) {
		half = 0;
	}
	if (half >= 0)
		mq->hstatus[half] = 1;
	mq->next = next;
}