Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
QNX Documentation Library
usbd_alloc

usbd_alloc

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

usbd_alloc()

Allocate a memory area to use for data transfers

Synopsis:

#include <sys/usbdi.h>

void *usbd_alloc( size_t size );

Arguments:

size
The size, in bytes, of the area to allocate.

Library:

libusbdi

Description:

The usbd_alloc() function allocates a memory area that can then be used for data transfers. You should use the memory area allocated by this function, because it's allocated efficiently and because its physical address is quickly obtained via usbd_mphys().


Note: The usbd_setup_*() functions require usbd_alloc()'d data buffers.

To free the memory, use usbd_free().

Returns:

A pointer to the start of the allocated memory, or NULL if there's not enough memory.

Errors:

ENOMEM
Insufficient memory available.

Classification:

QNX Neutrino, QNX 4

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

usbd_alloc_urb(), usbd_free(), usbd_free_urb(), usbd_mphys()