Exemplo n.º 1
0
static BOOL
sig_read_header(VISORCHANNEL *channel, U32 queue,
		SIGNAL_QUEUE_HEADER *sig_hdr)
{
	BOOL rc = FALSE;

	if (channel->chan_hdr.oChannelSpace < sizeof(CHANNEL_HEADER)) {
		ERRDRV("oChannelSpace too small: (status=%d)\n", rc);
		goto Away;
	}

	/* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */

	if (visor_memregion_read(channel->memregion,
				 SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
				 sig_hdr, sizeof(SIGNAL_QUEUE_HEADER)) < 0) {
		ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d",
		       queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue));
		ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n", rc);
		goto Away;
	}
	rc = TRUE;
Away:
	return rc;
}
Exemplo n.º 2
0
static BOOL
sig_read_header(VISORCHANNEL *channel, u32 queue,
		struct signal_queue_header *sig_hdr)
{
	BOOL rc = FALSE;

	if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header)) {
		ERRDRV("oChannelSpace too small: (status=%d)\n", rc);
		goto cleanup;
	}

	/* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */

	if (visor_memregion_read(channel->memregion,
				 SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
				 sig_hdr,
				 sizeof(struct signal_queue_header)) < 0) {
		ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d",
		       queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue));
		ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n",
		       rc);
		goto cleanup;
	}
	rc = TRUE;
cleanup:
	return rc;
}
Exemplo n.º 3
0
static int
sig_read_header(struct visorchannel *channel, u32 queue,
		struct signal_queue_header *sig_hdr)
{
	if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header))
		return -EINVAL;

	/* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */
	return visorchannel_read(channel,
				 SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
				 sig_hdr, sizeof(struct signal_queue_header));
}