allocb_physreq(D3) allocb_physreq(D3)
NAME
allocb_physreq - allocate a message block with physical
requirements
SYNOPSIS
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/kmem.h>
#include <sys/ddi.h>
mblk_t *allocb_physreq(int size, uint_t pri, physreq_t *preqp);
Arguments
size The number of bytes in the message block.
pri Priority of the request.
preqp Physical requirements for the data buffer.
DESCRIPTION
allocb_physreq tries to allocate a STREAMS message block. The
memory for the data buffer pointed to by db_base (see
datab(D4)) will satisfy the constraints specified by the
physreq(D4) structure pointed to by preqp.
Return Values
If successful, allocb_physreq returns a pointer to the
allocated message block of type M_DATA (defined in
sys/stream.h). If a block cannot be allocated, a NULL pointer
is returned.
USAGE
allocb_physreq should be used instead of allocb(D3) whenever
the data is to be made accessible to a hardware device via
DMA.
Buffer allocation fails only when the system is out of memory
which can satisfy the constraints. If no buffer is available,
the bufcall(D3) function can help a module recover from an
allocation failure.
The pri argument is a hint to the allocator indicating how
badly the message is needed. BPRI_LO should be used for
normal data allocations. BPRI_MED should be used for other
non-critical allocations. BPRI_HI should be used for
allocations that absolutely must succeed, although success is
not guaranteed. Some implementations may choose to ignore
Copyright 1994 Novell, Inc. Page 1
allocb_physreq(D3) allocb_physreq(D3)
this parameter.
Level
Base or Interrupt.
Synchronization Constraints
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
REFERENCES
allocb(D3), bufcall(D3), freeb(D3), kmem_alloc_physreq(D3),
datab(D4), msgb(D4), physreq(D4)
NOTICES
Portability
All processors
Applicability
ddi: 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2