DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

msgphysreq(D3str)


msgphysreq -- ensure that a message meets physical requirements

Synopsis (Not in ODDI)

   #include <sys/stream.h>
   #include <sys/kmem.h>
   #include <sys/ddi.h>
   

mblk_t *msgphysreq(mblk_t *mp, physreq_t *preqp);

Description

msgphysreq ensures that data blocks for a message satisfy a set of physical requirements.

If the memory for the data pointed to by b_rptr up to b_wptr (see msgb(D4str)) of the message block(s) in mp satisfy the constraints specified by the physreq(D4) structure pointed to by preqp, this message is simply returned unaltered.

Otherwise, the data are copied as necessary into buffers which do meet the constraints. If copied, the data will always be in the front of the new buffer; that is, b_rptr will equal db_base (see datab(D4str)). In this case, some or all of the original message will be freed, and a new message pointer may be returned.

The original message pointer must not be used after calling msgphysreq.

Arguments


mp
Pointer to the message whose physical properties should be checked.

preqp
Physical requirements for the data buffer.

Return values

On success, msgphysreq returns a pointer to the new message. On failure (due to inability to allocate new buffers), msgphysreq returns NULL and the original message pointer is still valid.

Usage

msgphysreq should be used when a message of (initially) unknown physical properties must be made accessible to a hardware device via DMA.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

Hardware applicability

All

Version applicability

ddi: 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

References

allocb_physreq(D3str), datab(D4str) kmem_alloc_physreq(D3), msgb(D4str) msgpullup_physreq(D3str), physreq(D4)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005