Linux Utils Application Programming Interface (API): Linux Utils API Reference

  • Main Page
  • Modules
  • Data Structures
  • Files
  • Directories
  • Related Pages

Linux Utils API Reference

linuxutils-l01

Modules

The Linux Utils product contains several components:

  • Contiguous Memory Manager
  • SDMA Manager
Copyright 2012, Texas Instruments Incorporated


Linux Utils Application Programming Interface (API):

  • Files
  • Directories
  • Related Pages
disclaimer.html
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI's terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI's standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of that third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265


Linux Utils Application Programming Interface (API): Module Index

Modules

Here is a list of all modules:
  • Contiguous Memory Manager
  • SDMA Manager


Linux Utils Application Programming Interface (API): Contiguous Memory Manager

Data Structures | Defines | Typedefs | Functions | Variables

Contiguous Memory Manager

Data Structures

struct | CMEM_AllocParams
Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free(). More...
struct | CMEM_BlockAttrs

Defines

#define | CMEM_VERSION 0x03000100U
#define | CMEM_WB 0x00010000
#define | CMEM_INV 0x00020000
#define | CMEM_HEAP 0x00040000
#define | CMEM_POOL 0x00000000
#define | CMEM_CACHED 0x00080000
#define | CMEM_NONCACHED 0x00000000
#define | CMEM_PHYS 0x00100000
#define | CMEM_IOCMAGIC 0x0000fe00
#define | CMEM_IOCALLOC 1
#define | CMEM_IOCALLOCHEAP 2
#define | CMEM_IOCFREE 3
#define | CMEM_IOCGETPHYS 4
#define | CMEM_IOCGETSIZE 5
#define | CMEM_IOCGETPOOL 6
#define | CMEM_IOCCACHE 7
#define | CMEM_IOCGETVERSION 8
#define | CMEM_IOCGETBLOCK 9
#define | CMEM_IOCREGUSER 10
#define | CMEM_IOCGETNUMBLOCKS 11
#define | CMEM_IOCCACHEWBINV CMEM_IOCCACHE | CMEM_WB | CMEM_INV
#define | CMEM_IOCCACHEWB CMEM_IOCCACHE | CMEM_WB
#define | CMEM_IOCCACHEINV CMEM_IOCCACHE | CMEM_INV
#define | CMEM_IOCALLOCCACHED CMEM_IOCALLOC | CMEM_CACHED
#define | CMEM_IOCALLOCHEAPCACHED CMEM_IOCALLOCHEAP | CMEM_CACHED
#define | CMEM_IOCFREEHEAP CMEM_IOCFREE | CMEM_HEAP
#define | CMEM_IOCFREEPHYS CMEM_IOCFREE | CMEM_PHYS
#define | CMEM_IOCFREEHEAPPHYS CMEM_IOCFREE | CMEM_HEAP | CMEM_PHYS
#define | CMEM_IOCCMDMASK 0x000000ff

Typedefs

typedef struct CMEM_AllocParams | CMEM_AllocParams
Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free().
typedef struct CMEM_BlockAttrs | CMEM_BlockAttrs

Functions

int | CMEM_init (void)
Initialize the CMEM module. Must be called before other API calls.
int | CMEM_getPool (size_t size)
Find the pool that best fits a given buffer size and has a buffer available.
int | CMEM_getPool2 (int blockid, size_t size)
Find the pool in memory block blockid that best fits a given buffer size and has a buffer available.
void * | CMEM_allocPool (int poolid, CMEM_AllocParams *params)
Allocate memory from a specified pool.
void * | CMEM_allocPool2 (int blockid, int poolid, CMEM_AllocParams *params)
Allocate memory from a specified pool in a specified memory block.
void * | CMEM_alloc (size_t size, CMEM_AllocParams *params)
Allocate memory of a specified size.
void * | CMEM_alloc2 (int blockid, size_t size, CMEM_AllocParams *params)
Allocate memory of a specified size from a specified memory block.
void * | CMEM_registerAlloc (unsigned long physp)
Register shared usage of an already-allocated buffer.
int | CMEM_free (void *ptr, CMEM_AllocParams *params)
Free a buffer previously allocated with CMEM_alloc()/CMEM_allocPool().
int | CMEM_unregister (void *ptr, CMEM_AllocParams *params)
Unregister use of a buffer previously registered with CMEM_registerAlloc().
unsigned long | CMEM_getPhys (void *ptr)
Get the physical address of a contiguous buffer.
int | CMEM_cacheWb (void *ptr, size_t size)
Do a cache writeback of the block pointed to by ptr/size.
int | CMEM_cacheInv (void *ptr, size_t size)
Do a cache invalidate of the block pointed to by ptr/size.
int | CMEM_cacheWbInv (void *ptr, size_t size)
Do a cache writeback/invalidate of the block pointed to by ptr/size.
int | CMEM_getVersion (void)
Retrieve version from CMEM driver.
int | CMEM_getBlock (unsigned long *pphys_base, size_t *psize)
Retrieve memory block bounds from CMEM driver.
int | CMEM_getBlockAttrs (int blockid, CMEM_BlockAttrs *pattrs)
Retrieve extended memory block attributes from CMEM driver.
int | CMEM_getNumBlocks (int *pnblocks)
Retrieve number of blocks configured into CMEM driver.
int | CMEM_exit (void)
Finalize the CMEM module.

Variables

CMEM_AllocParams CMEM_DEFAULTPARAMS

Detailed Description

This is the API for the Contiguous Memory Manager.

Define Documentation

#define CMEM_VERSION 0x03000100U
#define CMEM_WB 0x00010000
#define CMEM_INV 0x00020000
#define CMEM_HEAP 0x00040000

operation applies to heap

#define CMEM_POOL 0x00000000

operation applies to a pool

#define CMEM_CACHED 0x00080000

allocated buffer is cached

#define CMEM_NONCACHED 0x00000000

allocated buffer is not cached

#define CMEM_PHYS 0x00100000
#define CMEM_IOCMAGIC 0x0000fe00
#define CMEM_IOCALLOC 1
#define CMEM_IOCALLOCHEAP 2
#define CMEM_IOCFREE 3
#define CMEM_IOCGETPHYS 4
#define CMEM_IOCGETSIZE 5
#define CMEM_IOCGETPOOL 6
#define CMEM_IOCCACHE 7
#define CMEM_IOCGETVERSION 8
#define CMEM_IOCGETBLOCK 9
#define CMEM_IOCREGUSER 10
#define CMEM_IOCGETNUMBLOCKS 11
#define CMEM_IOCCACHEWBINV CMEM_IOCCACHE | CMEM_WB | CMEM_INV
#define CMEM_IOCCACHEWB CMEM_IOCCACHE | CMEM_WB
#define CMEM_IOCCACHEINV CMEM_IOCCACHE | CMEM_INV
#define CMEM_IOCALLOCCACHED CMEM_IOCALLOC | CMEM_CACHED
#define CMEM_IOCALLOCHEAPCACHED CMEM_IOCALLOCHEAP | CMEM_CACHED
#define CMEM_IOCFREEHEAP CMEM_IOCFREE | CMEM_HEAP
#define CMEM_IOCFREEPHYS CMEM_IOCFREE | CMEM_PHYS
#define CMEM_IOCFREEHEAPPHYS CMEM_IOCFREE | CMEM_HEAP | CMEM_PHYS
#define CMEM_IOCCMDMASK 0x000000ff

Typedef Documentation

typedef struct CMEM_AllocParams CMEM_AllocParams

Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free().

typedef struct CMEM_BlockAttrs CMEM_BlockAttrs

Function Documentation

int CMEM_init ( void )

Initialize the CMEM module. Must be called before other API calls.

Returns:
0 for success or -1 for failure.
See also:
CMEM_exit
int CMEM_getPool ( size_t size )

Find the pool that best fits a given buffer size and has a buffer available.

Parameters:
size The buffer size for which a pool is needed.
Returns:
A poolid that can be passed to CMEM_allocPool(), or -1 for error.
Precondition:
Must have called CMEM_init()
See also:
CMEM_allocPool()
CMEM_allocPool2()
CMEM_free()
CMEM_getPool2()
int CMEM_getPool2 | ( | int | blockid,
 |  | size_t | size
 | ) |  |

Find the pool in memory block blockid that best fits a given buffer size and has a buffer available.

Parameters:
blockid | Block number
size | The buffer size for which a pool is needed.
Returns:
A poolid that can be passed to CMEM_allocPool2(), or -1 for error.
Precondition:
Must have called CMEM_init()
See also:
CMEM_allocPool()
CMEM_allocPool2()
CMEM_free()
CMEM_getPool()
void* CMEM_allocPool | ( | int | poolid,
 |  | CMEM_AllocParams * | params
 | ) |  |

Allocate memory from a specified pool.

Parameters:
poolid | The pool from which to allocate memory.
params | Allocation parameters.
Remarks:
params->type is ignored - a pool will always be used.
params->alignment is unused, since pool buffers are already aligned to specific boundaries.
Returns:
A pointer to the allocated buffer, or NULL for failure.
Precondition:
Must have called CMEM_init()
See also:
CMEM_alloc()
CMEM_alloc2()
CMEM_allocPool2()
CMEM_registerAlloc()
CMEM_unregister()
CMEM_free()
void* CMEM_allocPool2 | ( | int | blockid,
 |  | int | poolid,
 |  | CMEM_AllocParams * | params
 | ) |  |

Allocate memory from a specified pool in a specified memory block.

Parameters:
blockid | The memory block from which to allocate.
poolid | The pool from which to allocate memory.
params | Allocation parameters.
Remarks:
params->type is ignored - a pool will always be used.
params->alignment is unused, since pool buffers are already aligned to specific boundaries.
Returns:
A pointer to the allocated buffer, or NULL for failure.
Precondition:
Must have called CMEM_init()
See also:
CMEM_alloc()
CMEM_alloc2()
CMEM_allocPool()
CMEM_registerAlloc()
CMEM_unregister()
CMEM_free()
void* CMEM_alloc | ( | size_t | size,
 |  | CMEM_AllocParams * | params
 | ) |  |

Allocate memory of a specified size.

Parameters:
size | The size of the buffer to allocate.
params | Allocation parameters.
Remarks:
Used to allocate memory from either a pool or the heap. If doing a pool allocation, the pool that best fits the requested size will be selected. Use CMEM_allocPool() to allocate from a specific pool. Allocation will be cached or noncached, as specified by params. params->alignment valid only for heap allocation.
Returns:
A pointer to the allocated buffer, or NULL for failure.
Precondition:
Must have called CMEM_init()
See also:
CMEM_allocPool()
CMEM_allocPool2()
CMEM_alloc2()
CMEM_registerAlloc()
CMEM_unregister()
CMEM_free()
void* CMEM_alloc2 | ( | int | blockid,
 |  | size_t | size,
 |  | CMEM_AllocParams * | params
 | ) |  |

Allocate memory of a specified size from a specified memory block.

Parameters:
blockid | The memory block from which to allocate.
size | The size of the buffer to allocate.
params | Allocation parameters.
Remarks:
Used to allocate memory from either a pool or the heap. If doing a pool allocation, the pool that best fits the requested size will be selected. Use CMEM_allocPool() to allocate from a specific pool.
Allocation will be cached or noncached, as specified by params. params->alignment valid only for heap allocation.
Returns:
A pointer to the allocated buffer, or NULL for failure.
Precondition:
Must have called CMEM_init()
See also:
CMEM_allocPool()
CMEM_allocPool2()
CMEM_alloc()
CMEM_registerAlloc()
CMEM_unregister()
CMEM_free()
void* CMEM_registerAlloc ( unsigned long physp )

Register shared usage of an already-allocated buffer.

Parameters:
physp Physical address of the already-allocated buffer.
Remarks:
Used to register the calling process for usage of an already-allocated buffer, for the purpose of shared usage of the buffer.
Allocation properties (such as cached/noncached or heap/pool) are inherited from original allocation call.
Returns:
A process-specific pointer to the allocated buffer, or NULL for failure.
Precondition:
Must have called some form of CMEM_alloc*()
See also:
CMEM_allocPool()
CMEM_allocPool2()
CMEM_alloc()
CMEM_free()
CMEM_unregister()
int CMEM_free | ( | void * | ptr,
 |  | CMEM_AllocParams * | params
 | ) |  |

Free a buffer previously allocated with CMEM_alloc()/CMEM_allocPool().

Parameters:
ptr | The pointer to the buffer.
params | Allocation parameters.
Remarks:
Use the same CMEM_AllocParams as was used for the allocation. params->flags is "don't care". params->alignment is "don't care".
Returns:
0 for success or -1 for failure.
Precondition:
Must have called CMEM_init()
See also:
CMEM_alloc()
CMEM_alloc2()
CMEM_allocPool()
CMEM_allocPool2()
CMEM_registerAlloc()
CMEM_unregister()
int CMEM_unregister | ( | void * | ptr,
 |  | CMEM_AllocParams * | params
 | ) |  |

Unregister use of a buffer previously registered with CMEM_registerAlloc().

Parameters:
ptr | The pointer to the buffer.
params | Allocation parameters.
Remarks:
Use the same CMEM_AllocParams as was used for the allocation. params->flags is "don't care". params->alignment is "don't care".
Returns:
0 for success or -1 for failure.
Precondition:
Must have called CMEM_init()
See also:
CMEM_alloc()
CMEM_alloc2()
CMEM_allocPool()
CMEM_allocPool2()
CMEM_registerAlloc()
CMEM_free()
unsigned long CMEM_getPhys ( void * ptr )

Get the physical address of a contiguous buffer.

Parameters:
ptr The pointer to the buffer.
Returns:
The physical address of the buffer or 0 for failure.
Precondition:
Must have called CMEM_init()
int CMEM_cacheWb | ( | void * | ptr,
 |  | size_t | size
 | ) |  |

Do a cache writeback of the block pointed to by ptr/size.

Parameters:
ptr | Pointer to block to writeback
size | Size in bytes of block to writeback.
Returns:
Success/failure boolean value
Precondition:
Must have called CMEM_init()
See also:
CMEM_cacheInv()
CMEM_cacheWbInv()
int CMEM_cacheInv | ( | void * | ptr,
 |  | size_t | size
 | ) |  |

Do a cache invalidate of the block pointed to by ptr/size.

Parameters:
ptr | Pointer to block to invalidate
size | Size in bytes of block to invalidate
Returns:
Success/failure boolean value
Precondition:
Must have called CMEM_init()
See also:
CMEM_cacheWb()
CMEM_cacheWbInv()
int CMEM_cacheWbInv | ( | void * | ptr,
 |  | size_t | size
 | ) |  |

Do a cache writeback/invalidate of the block pointed to by ptr/size.

Parameters:
ptr | Pointer to block to writeback/invalidate
size | Size in bytes of block to writeback/invalidate
Returns:
Success/failure boolean value
Precondition:
Must have called CMEM_init()
See also:
CMEM_cacheInv()
CMEM_cacheWb()
int CMEM_getVersion ( void )

Retrieve version from CMEM driver.

Returns:
Installed CMEM driver's version number.
Precondition:
Must have called CMEM_init()
int CMEM_getBlock | ( | unsigned long * | pphys_base,
 |  | size_t * | psize
 | ) |  |

Retrieve memory block bounds from CMEM driver.

Parameters:
pphys_base | Pointer to storage for base physical address of CMEM's memory block
psize | Pointer to storage for size of CMEM's memory block
Returns:
Success (0) or failure (-1).
Precondition:
Must have called CMEM_init()
See also:
CMEM_getBlockAttrs()
CMEM_getNumBlocks()
int CMEM_getBlockAttrs | ( | int | blockid,
 |  | CMEM_BlockAttrs * | pattrs
 | ) |  |

Retrieve extended memory block attributes from CMEM driver.

Parameters:
blockid | Block number
pattrs | Pointer to CMEM_BlockAttrs struct
Returns:
Success (0) or failure (-1).
Remarks:
Currently this API returns the same values as CMEM_getBlock().
Precondition:
Must have called CMEM_init()
See also:
CMEM_getBlock()
CMEM_getNumBlocks()
int CMEM_getNumBlocks ( int * pnblocks )

Retrieve number of blocks configured into CMEM driver.

Parameters:
pnblocks | Pointer to storage for holding number of blocks
pattrs | Pointer to CMEM_BlockAttrs struct
Returns:
Success (0) or failure (-1).
Remarks:
Blocks are configured into CMEM through the Linux 'insmod' command.
Precondition:
Must have called CMEM_init()
See also:
CMEM_getBlock()
CMEM_getBlockAttrs()
int CMEM_exit ( void )

Finalize the CMEM module.

Returns:
0 for success or -1 for failure.
Remarks:
After this function has been called, no other CMEM function may be called (unless CMEM is reinitialized).
Precondition:
Must have called CMEM_init()
See also:
CMEM_init()

Variable Documentation

CMEM_AllocParams CMEM_DEFAULTPARAMS
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines


Linux Utils Application Programming Interface (API): SDMA Manager

Data Structures | Defines | Typedefs | Enumerations | Functions

SDMA Manager

Data Structures

struct | SDMA_transferState
State structure shared between SDMAK and SDMA user layers. More...
union | SDMA_requestDmaParams
SDMAK ioctl input/output parameters. More...
struct | SDMA_ChannelDescriptor
Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl(). More...

Defines

#define | SDMA_VERSION 0x01010000U
#define | SDMA_IOCMAGIC 0x0000fb00
SDMAK ioctl() commands.
#define | SDMA_IOCCMDMASK 0x000000ff
#define | SDMA_IOCREQUESTDMA 1
#define | SDMA_IOCRELEASEDMA 2
#define | SDMA_IOCWAITFORCOMPLETION 3
#define | SDMA_IOCGETVERSION 4

Typedefs

typedef struct
SDMA_ChannelDescriptor 		SDMA_ChannelDescriptor
Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl().
typedef enum SDMA_Status | SDMA_Status
Status codes for SDMA API return values.

Enumerations

enum SDMA_Status {
SDMA_OK = 0,
SDMA_EFAIL,
SDMA_ENOCHANNEL,
SDMA_ENOINIT
}

Status codes for SDMA API return values.

More...

Functions

int | SDMA_init (void)
SDMA initialization API.
int | SDMA_exit (void)
SDMA finalization API.
SDMA_Status | SDMA_getChannels (int numChannels, SDMA_ChannelDescriptor chanArray[])
Returns available logical channels.
SDMA_Status | SDMA_freeChannels (int numChannels, SDMA_ChannelDescriptor chanArray[])
Frees previously requested logical channels.
SDMA_Status | SDMA_wait (SDMA_ChannelDescriptor *channel)
Waits for the transfer corresponding to this descriptor to complete.
SDMA_Status | SDMA_check (SDMA_ChannelDescriptor *channel, int *pcompleted)
Checks the status of the transfer corresponding to this descriptor and returns it in the *pcompleted field.
int | SDMA_getVersion (void)
Retrieve version from SDMA driver.

Detailed Description

This is the API for the SDMA Manager.

Define Documentation

#define SDMA_VERSION 0x01010000U
#define SDMA_IOCMAGIC 0x0000fb00

SDMAK ioctl() commands.

#define SDMA_IOCCMDMASK 0x000000ff
#define SDMA_IOCREQUESTDMA 1
#define SDMA_IOCRELEASEDMA 2
#define SDMA_IOCWAITFORCOMPLETION 3
#define SDMA_IOCGETVERSION 4

Typedef Documentation

typedef struct SDMA_ChannelDescriptor SDMA_ChannelDescriptor

Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl().

Remarks:
The address of the transferState member is passed down to the SDMAK module during the SDMA_IOCREQUESTDMA ioctl(). The SDMAK module maps this address and queries and writes to it during the completion ISR activity. It is therefore vital that the address of the descriptor passed to SDMA_getChannels() is in persistent memory that is live for the duration of SDMA channel usage.
See also:
SDMA_getChannels()
SDMA_freeChannels()
SDMA_wait()
SDMA_check()
typedef enum SDMA_Status SDMA_Status

Status codes for SDMA API return values.

Enumeration Type Documentation

enum SDMA_Status

Status codes for SDMA API return values.

Enumerator:
SDMA_OK

OK

SDMA_EFAIL

general failure

SDMA_ENOCHANNEL

no channels available

SDMA_ENOINIT

SDMA_init() not called

Function Documentation

int SDMA_init ( void )

SDMA initialization API.

int SDMA_exit ( void )

SDMA finalization API.

SDMA_Status SDMA_getChannels | ( | int | numChannels,
 |  | SDMA_ChannelDescriptor | chanArray[]
 | ) |  |

Returns available logical channels.

Parameters:
numChannels | number of requested channels.
chanArray | pointer to SDMA_ChannelDescriptor storage of sufficient size to hold numChannels descriptors. All structure array fields are filled by this API (in other words, no fields need to be filled by the caller prior to the call).
Remarks:
chanArray must be allocated from memory that persists over the life of the channel's usage, since the address of the chanArray will be used by the SDMA kernel driver. This implies that the contents of the passed chanArray should not be copied to another SDMA_ChannelDescriptor that is then used for the subsequent operations.
Fails if the requested number of channels is not available.
See also:
SDMA_freeChannels()
SDMA_Status SDMA_freeChannels | ( | int | numChannels,
 |  | SDMA_ChannelDescriptor | chanArray[]
 | ) |  |

Frees previously requested logical channels.

Parameters:
numChannels | number of requested channels.
chanArray | pointer to SDMA_ChannelDescriptor storage of sufficient size to hold numChannels descriptors. This will typically be the same pointer passed to SDMA_getChannels().
See also:
SDMA_getChannels()
SDMA_Status SDMA_wait ( SDMA_ChannelDescriptor * channel )

Waits for the transfer corresponding to this descriptor to complete.

Parameters:
channel pointer to the single channel for which to wait.
Remarks:
SDMA_wait() first checks the transferComplete flag of the struct SDMA_transferState in channel. This flag is directly written by the SDMAK module's completion ISR. If this flag is not set to 1, SDMA_wait() will issue a SDMA_IOCWAITFORCOMPLETION ioctl(), which will block inside the SDMAK module and become unblocked by the completion ISR.
See also:
SDMA_check()
SDMA_Status SDMA_check | ( | SDMA_ChannelDescriptor * | channel,
 |  | int * | pcompleted
 | ) |  |

Checks the status of the transfer corresponding to this descriptor and returns it in the *pcompleted field.

Parameters:
channel | pointer to single channel to check.
pcompleted | pointer to completion status.
Remarks:
copies the contents of the transferComplete flag of the struct SDMA_transferState in channel into *pcompleted (does not issue any ioctl()).
See also:
SDMA_wait()
int SDMA_getVersion ( void )

Retrieve version from SDMA driver.

Returns:
Installed SDMA driver's version number.
Precondition:
Must have called SDMA_init()


Linux Utils Application Programming Interface (API): Data Structures

  • Data Structures
  • Data Structure Index
  • Data Fields

Data Structures

Here are the data structures with brief descriptions:
CMEM_AllocParams | Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free()
CMEM_BlockAttrs |
SDMA_ChannelDescriptor | Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl()
SDMA_requestDmaParams | SDMAK ioctl input/output parameters
SDMA_transferState | State structure shared between SDMAK and SDMA user layers


Linux Utils Application Programming Interface (API): CMEM_AllocParams Struct Reference

  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields

CMEM_AllocParams Struct Reference
[Contiguous Memory Manager]

Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free(). More...

#include <cmem.h>

Data Fields

int | type
int | flags
size_t | alignment

Detailed Description

Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free().

Field Documentation

int CMEM_AllocParams::type

either CMEM_HEAP or CMEM_POOL

int CMEM_AllocParams::flags

either CMEM_CACHED or CMEM_NONCACHED

size_t CMEM_AllocParams::alignment

only used for heap allocations, must be power of 2

The documentation for this struct was generated from the following file:
  • cmem.h


Linux Utils Application Programming Interface (API): CMEM_BlockAttrs Struct Reference

  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields

CMEM_BlockAttrs Struct Reference
[Contiguous Memory Manager]

#include <cmem.h>

Data Fields

unsigned long | phys_base
size_t | size

Field Documentation

unsigned long CMEM_BlockAttrs::phys_base
size_t CMEM_BlockAttrs::size
The documentation for this struct was generated from the following file:
  • cmem.h


Linux Utils Application Programming Interface (API): SDMA_ChannelDescriptor Struct Reference

  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields

SDMA_ChannelDescriptor Struct Reference
[SDMA Manager]

Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl(). More...

#include <sdma.h>

Collaboration diagram for SDMA_ChannelDescriptor:
[legend]

Data Fields

int | chanNum
unsigned int * | addr
struct SDMA_transferState | transferState

Detailed Description

Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl().

Remarks:
The address of the transferState member is passed down to the SDMAK module during the SDMA_IOCREQUESTDMA ioctl(). The SDMAK module maps this address and queries and writes to it during the completion ISR activity. It is therefore vital that the address of the descriptor passed to SDMA_getChannels() is in persistent memory that is live for the duration of SDMA channel usage.
See also:
SDMA_getChannels()
SDMA_freeChannels()
SDMA_wait()
SDMA_check()

Field Documentation

int SDMA_ChannelDescriptor::chanNum

channel number

unsigned int* SDMA_ChannelDescriptor::addr

user virtual address of granted DMA registers

struct SDMA_transferState SDMA_ChannelDescriptor::transferState

used for completion checking, whose address is passed down to sdmak kernel driver

The documentation for this struct was generated from the following file:
  • sdma.h


Linux Utils Application Programming Interface (API): SDMA_requestDmaParams Union Reference

  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields

SDMA_requestDmaParams Union Reference
[SDMA Manager]

SDMAK ioctl input/output parameters. More...

#include <sdma.h>

Collaboration diagram for SDMA_requestDmaParams:
[legend]

Data Fields

struct SDMA_transferState * | ptransferState
int | channel

Detailed Description

SDMAK ioctl input/output parameters.

Field Documentation

struct SDMA_transferState* SDMA_requestDmaParams::ptransferState

user address of user-owned transfer state structure, input for REQEST_DMA ioctl()

int SDMA_requestDmaParams::channel

granted channel number, output from SDMA_IOCREQUESTDMA ioctl()

The documentation for this union was generated from the following file:
  • sdma.h


Linux Utils Application Programming Interface (API): SDMA_transferState Struct Reference

  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields

SDMA_transferState Struct Reference
[SDMA Manager]

State structure shared between SDMAK and SDMA user layers. More...

#include <sdma.h>

Data Fields

volatile int | transferCompleted
volatile int | checkPending

Detailed Description

State structure shared between SDMAK and SDMA user layers.

Remarks:
The address of a struct SDMA_transferState instance gets passed down to the SDMAK module during the SDMA_IOCREQUESTDMA ioctl() operation and is registered with the received channel. It is therefore vital that the structure address that is registered with the kernel module points to the actual location that is queried and written during a "wait" operation.

Field Documentation

volatile int SDMA_transferState::transferCompleted

flag for channel completion

volatile int SDMA_transferState::checkPending

completion check hand-shaking flag

The documentation for this struct was generated from the following file:
  • sdma.h


Linux Utils Application Programming Interface (API): Data Fields

  • Data Structures
  • Data Structure Index
  • Data Fields
  • All
  • Variables
Here is a list of all struct and union fields with links to the structures/unions they belong to:
  • addr : SDMA_ChannelDescriptor
  • alignment : CMEM_AllocParams
  • channel : SDMA_requestDmaParams
  • chanNum : SDMA_ChannelDescriptor
  • checkPending : SDMA_transferState
  • flags : CMEM_AllocParams
  • phys_base : CMEM_BlockAttrs
  • ptransferState : SDMA_requestDmaParams
  • size : CMEM_BlockAttrs
  • transferCompleted : SDMA_transferState
  • transferState : SDMA_ChannelDescriptor
  • type : CMEM_AllocParams


Linux Utils Application Programming Interface (API): File Index

  • File List
  • Globals

File List

Here is a list of all files with brief descriptions:
cmem.h [code] | Describes the interface to the contiguous memory allocator
sdma.h [code] | Describes the interface to the SDMA manager


Linux Utils Application Programming Interface (API): cmem.h File Reference

  • File List
  • Globals
  • packages
  • ti
  • sdo
  • linuxutils
  • cmem
  • include
Data Structures | Defines | Typedefs | Functions | Variables

cmem.h File Reference

Detailed Description

Describes the interface to the contiguous memory allocator.

The cmem user interface library wraps file system calls to an associated kernel module (cmemk.ko), which needs to be loaded in order for calls to this library to succeed.

The following is an example of installing the cmem kernel module:

/sbin/insmod cmemk.ko pools=4x30000,2x500000 phys_start=0x0 phys_end=0x3000000
  • phys_start and phys_end must be specified in hexadecimal format
  • phys_start is "inclusive" and phys_end is "exclusive", i.e., phys_end should be "end address + 1".
  • pools must be specified using decimal format (for both number and size), since using hexadecimal format would visually clutter the specification due to the use of "x" as a token separator
  • it's possible to insmod cmemk.ko without specifying any memory blocks, in which case CMEM_getPhys() and CMEM_cache*() APIs can still be utilized by an application.

This particular command creates 2 pools. The first pool is created with 4 buffers of size 30000 bytes and the second pool is created with 2 buffers of size 500000 bytes. The CMEM pool buffers start at 0x0 and end at 0x2FFFFFF (max).

There is also support for a 2nd contiguous memory block to be specified, with all the same features supported for the 2nd block as with the 1st. This 2nd block is specified with *_1 parameters. The following example expands upon the first example above:

/sbin/insmod cmemk.ko pools=4x30000,2x500000 phys_start=0x0 phys_end=0x3000000
    pools_1=4x65536 phys_start_1=0x80000000 phys_end_1=0x80010000

This particular command, in addition to the pools explained above, creates 1 pool (with 4 buffers of size 64KB) in a 2nd memory block which starts at 0x80000000 and ends at 0x8000FFFF (specified as "end + 1" on the insmod command).

In order to access this 2nd memory block, new APIs have been added to CMEM which allow specification of the block ID.

There are two more configuration "switches" for the cmemk.ko kernel module, which can be specified on the 'insmod' (or 'modprobe') command lines: useHeapIfPoolUnavailable=[0|1] allowOverlap=[0|1]

'useHeapIfPoolUnavailable', when set to 1, will cause pool-based allocations to fallback to a heap-based allocation if no pool buffer of sufficient size is available (the CMEM heap is described below).

'allowOverlap', when set to 1, causes cmemk.ko to not fail when it detects that a CMEM memory block location conflicts with the Linux kernel memory, and instead an informational message is printed on the console. When set to 0, cmemk.ko insertion will fail when this condition is detected. The overlap detection is fairly crude, however, checking only that the end of the kernel's memory (assigned by way of the u-boot 'bootargs' parameter "mem=##M") is not above the beginning location of a CMEM memory block. For example, on most TI processor-based systems the kernel's memory starts at 0x80000000 and ends at (0x80000000 + #M), so a CMEM block starting at 0x1000 would be detected as overlapping since the beginning location of that block is not greater than the end location of the kernel's memory. To allow this situation, cmemk.ko should be inserted using "allowOverlap=1".

Pool buffers are aligned on a module-dependent boundary, and their sizes are rounded up to this same boundary. This applies to each buffer within a pool. The total space used by an individual pool will therefore be greater than (or equal to) the exact amount requested in the installation of the module.

The poolid used in the driver calls would be 0 for the first pool and 1 for the second pool.

Pool allocations can be requested explicitly by pool number, or more generally by just a size. For size-based allocations, the pool which best fits the requested size is automatically chosen. Some CMEM APIs (newer ones) accept a blockid as a parameter, in order to specify which of the multiple blocks to operate on. For 'legacy' APIs (ones that existed before the support for multiple blocks) where a blockid is still needed, block 0 is assumed.

There is also support for a general purpose heap. In addition to the 2 pools described above, a general purpose heap block is created from which allocations of any size can be requested. Internally, allocation sizes are rounded up to a module-dependent boundary and allocation addresses are aligned either to this same boundary or to the requested alignment (whichever is greater).

The size of the heap block is the amount of CMEM memory remaining after all pool allocations. If more heap space is needed than is available after pool allocations, you must reduce the amount of CMEM memory granted to the pools.

Buffer allocation is tracked at the file descriptor level by way of a 'registration' list. The initial allocator of a buffer (the process that calls CMEM_alloc()) is automatically added to the registration list, and further processes can become registered for the same buffer by way of the CMEM_registerAlloc() API (and unregister with the CMEM_unregister() API). This registration list for each buffer allows for buffer ownership tracking and cleanup on a per-file-descriptor basis, so that when a process exits or dies without having explicitly freed/unregistered its buffers, they get automatically unregistered (and freed when no more registered file descriptors exist). Only when the last registered file descriptor frees a buffer (either explictily, or by auto-cleanup) does a buffer actually get freed back to the kernel module.

Since the CMEM interface library doesn't use the GT tracing facility, there is one configuration option available for the CMEM module to control whether the debug or release interface library is used for building the application. This config parameter is named 'debug' and is of type bool, and the default value is 'false'.

The following line is an example of enabling usage of the debug interface library: var cmem = xdc.useModule('ti.sdo.linuxutils.cmem.CMEM'); cmem.debug = true; This will enable "CMEM Debug" statements to be printed to stdout.

Go to the source code of this file.

Data Structures

struct | CMEM_AllocParams
Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free(). More...
struct | CMEM_BlockAttrs

Defines

#define | CMEM_VERSION 0x03000100U
#define | CMEM_WB 0x00010000
#define | CMEM_INV 0x00020000
#define | CMEM_HEAP 0x00040000
#define | CMEM_POOL 0x00000000
#define | CMEM_CACHED 0x00080000
#define | CMEM_NONCACHED 0x00000000
#define | CMEM_PHYS 0x00100000
#define | CMEM_IOCMAGIC 0x0000fe00
#define | CMEM_IOCALLOC 1
#define | CMEM_IOCALLOCHEAP 2
#define | CMEM_IOCFREE 3
#define | CMEM_IOCGETPHYS 4
#define | CMEM_IOCGETSIZE 5
#define | CMEM_IOCGETPOOL 6
#define | CMEM_IOCCACHE 7
#define | CMEM_IOCGETVERSION 8
#define | CMEM_IOCGETBLOCK 9
#define | CMEM_IOCREGUSER 10
#define | CMEM_IOCGETNUMBLOCKS 11
#define | CMEM_IOCCACHEWBINV CMEM_IOCCACHE | CMEM_WB | CMEM_INV
#define | CMEM_IOCCACHEWB CMEM_IOCCACHE | CMEM_WB
#define | CMEM_IOCCACHEINV CMEM_IOCCACHE | CMEM_INV
#define | CMEM_IOCALLOCCACHED CMEM_IOCALLOC | CMEM_CACHED
#define | CMEM_IOCALLOCHEAPCACHED CMEM_IOCALLOCHEAP | CMEM_CACHED
#define | CMEM_IOCFREEHEAP CMEM_IOCFREE | CMEM_HEAP
#define | CMEM_IOCFREEPHYS CMEM_IOCFREE | CMEM_PHYS
#define | CMEM_IOCFREEHEAPPHYS CMEM_IOCFREE | CMEM_HEAP | CMEM_PHYS
#define | CMEM_IOCCMDMASK 0x000000ff

Typedefs

typedef struct CMEM_AllocParams | CMEM_AllocParams
Parameters for CMEM_alloc(), CMEM_alloc2(), CMEM_allocPool(), CMEM_allocPool2(), CMEM_free().
typedef struct CMEM_BlockAttrs | CMEM_BlockAttrs

Functions

int | CMEM_init (void)
Initialize the CMEM module. Must be called before other API calls.
int | CMEM_getPool (size_t size)
Find the pool that best fits a given buffer size and has a buffer available.
int | CMEM_getPool2 (int blockid, size_t size)
Find the pool in memory block blockid that best fits a given buffer size and has a buffer available.
void * | CMEM_allocPool (int poolid, CMEM_AllocParams *params)
Allocate memory from a specified pool.
void * | CMEM_allocPool2 (int blockid, int poolid, CMEM_AllocParams *params)
Allocate memory from a specified pool in a specified memory block.
void * | CMEM_alloc (size_t size, CMEM_AllocParams *params)
Allocate memory of a specified size.
void * | CMEM_alloc2 (int blockid, size_t size, CMEM_AllocParams *params)
Allocate memory of a specified size from a specified memory block.
void * | CMEM_registerAlloc (unsigned long physp)
Register shared usage of an already-allocated buffer.
int | CMEM_free (void *ptr, CMEM_AllocParams *params)
Free a buffer previously allocated with CMEM_alloc()/CMEM_allocPool().
int | CMEM_unregister (void *ptr, CMEM_AllocParams *params)
Unregister use of a buffer previously registered with CMEM_registerAlloc().
unsigned long | CMEM_getPhys (void *ptr)
Get the physical address of a contiguous buffer.
int | CMEM_cacheWb (void *ptr, size_t size)
Do a cache writeback of the block pointed to by ptr/size.
int | CMEM_cacheInv (void *ptr, size_t size)
Do a cache invalidate of the block pointed to by ptr/size.
int | CMEM_cacheWbInv (void *ptr, size_t size)
Do a cache writeback/invalidate of the block pointed to by ptr/size.
int | CMEM_getVersion (void)
Retrieve version from CMEM driver.
int | CMEM_getBlock (unsigned long *pphys_base, size_t *psize)
Retrieve memory block bounds from CMEM driver.
int | CMEM_getBlockAttrs (int blockid, CMEM_BlockAttrs *pattrs)
Retrieve extended memory block attributes from CMEM driver.
int | CMEM_getNumBlocks (int *pnblocks)
Retrieve number of blocks configured into CMEM driver.
int | CMEM_exit (void)
Finalize the CMEM module.

Variables

CMEM_AllocParams CMEM_DEFAULTPARAMS
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines


Linux Utils Application Programming Interface (API): sdma.h File Reference

  • File List
  • Globals
  • packages
  • ti
  • sdo
  • linuxutils
  • sdma
  • include
Data Structures | Defines | Typedefs | Enumerations | Functions

sdma.h File Reference

Detailed Description

Describes the interface to the SDMA manager.

The sdma user interface library wraps file system calls to an associated kernel module (sdmak.ko), which needs to be loaded in order for calls to to this library to succeed.

To install sdmak.ko, enter % insmod sdmak.ko on a Linux command line.

SDMA channels are allocated (requested) from within the sdmak kernel driver through the SDMA_getChannels() API. This request is granted by way of the kernel's request_dma() functionality (omap_request_dma() for the OMAP35x), so it will work in conjuntion with independent kernel DMA usage without conflict or custom kernel configuration. The granted channel's registers are memory-mapped into the calling user address space to allow the application to directly access the DMA registers for that channel.

A DMA callback ISR is registered within the stock kernel DMA manager, and this ISR is used for completion notification (although it could be customized to handle any DMA-generated interrupt). Notification to the user interface layer is accomplished by way of a user state structure whose address is passed to the sdmak kernel driver and which is directly written upon completion. Atomic hand-shaking allows the kernel driver to know if the application is going to wait for the completion by way of the corresponding sdmak ioctl(), as opposed to just checking the user state structure, and post a channel-specific mutex only when needed (otherwise just the completion flag in the state structure is set).

Since the SDMA interface library doesn't use the GT tracing facility, there is one configuration option available for the SDMA module to control whether the debug or release interface library is used for building the application. This config parameter is named 'debug' and is of type bool, and the default value is 'false'.

The following line is an example of enabling usage of the debug interface library: var sdma = xdc.useModule('ti.sdo.linuxutils.sdma.SDMA'); sdma.debug = true; This will enable "SDMA Debug" statements to be printed to stdout.

Go to the source code of this file.

Data Structures

struct | SDMA_transferState
State structure shared between SDMAK and SDMA user layers. More...
union | SDMA_requestDmaParams
SDMAK ioctl input/output parameters. More...
struct | SDMA_ChannelDescriptor
Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl(). More...

Defines

#define | SDMA_VERSION 0x01010000U
#define | SDMA_IOCMAGIC 0x0000fb00
SDMAK ioctl() commands.
#define | SDMA_IOCCMDMASK 0x000000ff
#define | SDMA_IOCREQUESTDMA 1
#define | SDMA_IOCRELEASEDMA 2
#define | SDMA_IOCWAITFORCOMPLETION 3
#define | SDMA_IOCGETVERSION 4

Typedefs

typedef struct
SDMA_ChannelDescriptor 		SDMA_ChannelDescriptor
Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl().
typedef enum SDMA_Status | SDMA_Status
Status codes for SDMA API return values.

Enumerations

enum SDMA_Status {
SDMA_OK = 0,
SDMA_EFAIL,
SDMA_ENOCHANNEL,
SDMA_ENOINIT
}

Status codes for SDMA API return values.

More...

Functions

int | SDMA_init (void)
SDMA initialization API.
int | SDMA_exit (void)
SDMA finalization API.
SDMA_Status | SDMA_getChannels (int numChannels, SDMA_ChannelDescriptor chanArray[])
Returns available logical channels.
SDMA_Status | SDMA_freeChannels (int numChannels, SDMA_ChannelDescriptor chanArray[])
Frees previously requested logical channels.
SDMA_Status | SDMA_wait (SDMA_ChannelDescriptor *channel)
Waits for the transfer corresponding to this descriptor to complete.
SDMA_Status | SDMA_check (SDMA_ChannelDescriptor *channel, int *pcompleted)
Checks the status of the transfer corresponding to this descriptor and returns it in the *pcompleted field.
int | SDMA_getVersion (void)
Retrieve version from SDMA driver.


Linux Utils Application Programming Interface (API): Directory Hierarchy

Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • packages
    • ti
      • sdo
        • linuxutils
          • cmem
            • include
          • sdma
            • include


Linux Utils Application Programming Interface (API): packages/ Directory Reference

  • packages

packages Directory Reference

Directory dependency graph for packages/:

Directories

directory ti


Linux Utils Application Programming Interface (API): packages/ti/ Directory Reference

  • packages
  • ti

ti Directory Reference

Directory dependency graph for packages/ti/:

Directories

directory sdo


Linux Utils Application Programming Interface (API): packages/ti/sdo/ Directory Reference

  • packages
  • ti
  • sdo

sdo Directory Reference

Directory dependency graph for packages/ti/sdo/:

Directories

directory linuxutils


Linux Utils Application Programming Interface (API): packages/ti/sdo/linuxutils/ Directory Reference

  • packages
  • ti
  • sdo
  • linuxutils

linuxutils Directory Reference

Directory dependency graph for packages/ti/sdo/linuxutils/:

Directories

directory | cmem
directory | sdma


Linux Utils Application Programming Interface (API): packages/ti/sdo/linuxutils/cmem/ Directory Reference

  • packages
  • ti
  • sdo
  • linuxutils
  • cmem

cmem Directory Reference

Directory dependency graph for packages/ti/sdo/linuxutils/cmem/:

Directories

directory include


Linux Utils Application Programming Interface (API): packages/ti/sdo/linuxutils/cmem/include/ Directory Reference

  • packages
  • ti
  • sdo
  • linuxutils
  • cmem
  • include

include Directory Reference

Directory dependency graph for packages/ti/sdo/linuxutils/cmem/include/:

Files

file cmem.h [code]

Describes the interface to the contiguous memory allocator.


Linux Utils Application Programming Interface (API): packages/ti/sdo/linuxutils/sdma/ Directory Reference

  • packages
  • ti
  • sdo
  • linuxutils
  • sdma

sdma Directory Reference

Directory dependency graph for packages/ti/sdo/linuxutils/sdma/:

Directories

directory include


Linux Utils Application Programming Interface (API): packages/ti/sdo/linuxutils/sdma/include/ Directory Reference

  • packages
  • ti
  • sdo
  • linuxutils
  • sdma
  • include

include Directory Reference

Directory dependency graph for packages/ti/sdo/linuxutils/sdma/include/:

Files

file sdma.h [code]

Describes the interface to the SDMA manager.


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • c
  • s
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- c -

  • CMEM_alloc() : cmem.h
  • CMEM_alloc2() : cmem.h
  • CMEM_AllocParams : cmem.h
  • CMEM_allocPool() : cmem.h
  • CMEM_allocPool2() : cmem.h
  • CMEM_BlockAttrs : cmem.h
  • CMEM_CACHED : cmem.h
  • CMEM_cacheInv() : cmem.h
  • CMEM_cacheWb() : cmem.h
  • CMEM_cacheWbInv() : cmem.h
  • CMEM_DEFAULTPARAMS : cmem.h
  • CMEM_exit() : cmem.h
  • CMEM_free() : cmem.h
  • CMEM_getBlock() : cmem.h
  • CMEM_getBlockAttrs() : cmem.h
  • CMEM_getNumBlocks() : cmem.h
  • CMEM_getPhys() : cmem.h
  • CMEM_getPool() : cmem.h
  • CMEM_getPool2() : cmem.h
  • CMEM_getVersion() : cmem.h
  • CMEM_HEAP : cmem.h
  • CMEM_init() : cmem.h
  • CMEM_INV : cmem.h
  • CMEM_IOCALLOC : cmem.h
  • CMEM_IOCALLOCCACHED : cmem.h
  • CMEM_IOCALLOCHEAP : cmem.h
  • CMEM_IOCALLOCHEAPCACHED : cmem.h
  • CMEM_IOCCACHE : cmem.h
  • CMEM_IOCCACHEINV : cmem.h
  • CMEM_IOCCACHEWB : cmem.h
  • CMEM_IOCCACHEWBINV : cmem.h
  • CMEM_IOCCMDMASK : cmem.h
  • CMEM_IOCFREE : cmem.h
  • CMEM_IOCFREEHEAP : cmem.h
  • CMEM_IOCFREEHEAPPHYS : cmem.h
  • CMEM_IOCFREEPHYS : cmem.h
  • CMEM_IOCGETBLOCK : cmem.h
  • CMEM_IOCGETNUMBLOCKS : cmem.h
  • CMEM_IOCGETPHYS : cmem.h
  • CMEM_IOCGETPOOL : cmem.h
  • CMEM_IOCGETSIZE : cmem.h
  • CMEM_IOCGETVERSION : cmem.h
  • CMEM_IOCMAGIC : cmem.h
  • CMEM_IOCREGUSER : cmem.h
  • CMEM_NONCACHED : cmem.h
  • CMEM_PHYS : cmem.h
  • CMEM_POOL : cmem.h
  • CMEM_registerAlloc() : cmem.h
  • CMEM_unregister() : cmem.h
  • CMEM_VERSION : cmem.h
  • CMEM_WB : cmem.h

- s -

  • SDMA_ChannelDescriptor : sdma.h
  • SDMA_check() : sdma.h
  • SDMA_EFAIL : sdma.h
  • SDMA_ENOCHANNEL : sdma.h
  • SDMA_ENOINIT : sdma.h
  • SDMA_exit() : sdma.h
  • SDMA_freeChannels() : sdma.h
  • SDMA_getChannels() : sdma.h
  • SDMA_getVersion() : sdma.h
  • SDMA_init() : sdma.h
  • SDMA_IOCCMDMASK : sdma.h
  • SDMA_IOCGETVERSION : sdma.h
  • SDMA_IOCMAGIC : sdma.h
  • SDMA_IOCRELEASEDMA : sdma.h
  • SDMA_IOCREQUESTDMA : sdma.h
  • SDMA_IOCWAITFORCOMPLETION : sdma.h
  • SDMA_OK : sdma.h
  • SDMA_Status : sdma.h
  • SDMA_VERSION : sdma.h
  • SDMA_wait() : sdma.h


Linux Utils Application Programming Interface (API): Alphabetical List

  • Data Structures
  • Data Structure Index
  • Data Fields

Data Structure Index

C | S
C
CMEM_BlockAttrs SDMA_ChannelDescriptor SDMA_requestDmaParams SDMA_transferState
CMEM_AllocParams
S


Linux Utils Application Programming Interface (API): cmem.h Source File

  • File List
  • Globals
  • packages
  • ti
  • sdo
  • linuxutils
  • cmem
  • include

cmem.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2012, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  *
00032  */
00033
00158 #ifndef ti_sdo_linuxutils_cmem_CMEM_H
00159 #define ti_sdo_linuxutils_cmem_CMEM_H
00160
00161 #if defined (__cplusplus)
00162 extern "C" {
00163 #endif
00164
00167
00168 #define CMEM_VERSION    0x03000100U
00169
00170 /* ioctl cmd "flavors" */
00171 #define CMEM_WB                         0x00010000
00172 #define CMEM_INV                        0x00020000
00173 #define CMEM_HEAP                       0x00040000
00174 #define CMEM_POOL                       0x00000000
00175 #define CMEM_CACHED                     0x00080000
00176 #define CMEM_NONCACHED                  0x00000000
00177 #define CMEM_PHYS                       0x00100000
00178
00179 #define CMEM_IOCMAGIC                   0x0000fe00
00180
00181 /* supported "base" ioctl cmds for the driver. */
00182 #define CMEM_IOCALLOC                   1
00183 #define CMEM_IOCALLOCHEAP               2
00184 #define CMEM_IOCFREE                    3
00185 #define CMEM_IOCGETPHYS                 4
00186 #define CMEM_IOCGETSIZE                 5
00187 #define CMEM_IOCGETPOOL                 6
00188 #define CMEM_IOCCACHE                   7
00189 #define CMEM_IOCGETVERSION              8
00190 #define CMEM_IOCGETBLOCK                9
00191 #define CMEM_IOCREGUSER                 10
00192 #define CMEM_IOCGETNUMBLOCKS            11
00193 /*
00194  * New ioctl cmds should use integers greater than the largest current cmd
00195  * in order to not break backward compatibility.
00196  */
00197
00198 /* supported "flavors" to "base" ioctl cmds for the driver. */
00199 #define CMEM_IOCCACHEWBINV              CMEM_IOCCACHE | CMEM_WB | CMEM_INV
00200 #define CMEM_IOCCACHEWB                 CMEM_IOCCACHE | CMEM_WB
00201 #define CMEM_IOCCACHEINV                CMEM_IOCCACHE | CMEM_INV
00202 #define CMEM_IOCALLOCCACHED             CMEM_IOCALLOC | CMEM_CACHED
00203 #define CMEM_IOCALLOCHEAPCACHED         CMEM_IOCALLOCHEAP | CMEM_CACHED
00204 #define CMEM_IOCFREEHEAP                CMEM_IOCFREE | CMEM_HEAP
00205 #define CMEM_IOCFREEPHYS                CMEM_IOCFREE | CMEM_PHYS
00206 #define CMEM_IOCFREEHEAPPHYS            CMEM_IOCFREE | CMEM_HEAP | CMEM_PHYS
00207
00208 #define CMEM_IOCCMDMASK                 0x000000ff
00209
00214 typedef struct CMEM_AllocParams {
00215     int type;
00216     int flags;
00217     size_t alignment;
00220 } CMEM_AllocParams;
00221
00222 extern CMEM_AllocParams CMEM_DEFAULTPARAMS;
00223
00224 typedef struct CMEM_BlockAttrs {
00225     unsigned long phys_base;
00226     size_t size;
00227 } CMEM_BlockAttrs;
00228
00233 union CMEM_AllocUnion {
00234     struct {
00235         size_t size;
00236         size_t align;
00237         int blockid;
00238     } alloc_heap_inparams;
00239     struct {
00240         int poolid;
00241         int blockid;
00242     } alloc_pool_inparams;
00243     struct {
00244         int poolid;
00245         int blockid;
00246     } get_size_inparams;
00247     struct {
00248         size_t size;
00249         int blockid;
00250     } get_pool_inparams;
00251     struct {
00252         unsigned long physp;
00253         size_t size;
00254     } alloc_pool_outparams;
00255     struct {
00256         unsigned long physp;
00257         size_t size;
00258     } get_block_outparams;
00259     struct {
00260         int poolid;
00261         size_t size;
00262     } free_outparams;
00263     unsigned long physp;
00264     unsigned long virtp;
00265     size_t size;
00266     int poolid;
00267     int blockid;
00268 };
00269
00279 int CMEM_init(void);
00280
00296 int CMEM_getPool(size_t size);
00297
00314 int CMEM_getPool2(int blockid, size_t size);
00315
00337 void *CMEM_allocPool(int poolid, CMEM_AllocParams *params);
00338
00361 void *CMEM_allocPool2(int blockid, int poolid, CMEM_AllocParams *params);
00362
00387 void *CMEM_alloc(size_t size, CMEM_AllocParams *params);
00388
00415 void *CMEM_alloc2(int blockid, size_t size, CMEM_AllocParams *params);
00416
00440 void *CMEM_registerAlloc(unsigned long physp);
00441
00464 int CMEM_free(void *ptr, CMEM_AllocParams *params);
00465
00488 int CMEM_unregister(void *ptr, CMEM_AllocParams *params);
00489
00499 unsigned long CMEM_getPhys(void *ptr);
00500
00514 int CMEM_cacheWb(void *ptr, size_t size);
00515
00529 int CMEM_cacheInv(void *ptr, size_t size);
00530
00545 int CMEM_cacheWbInv(void *ptr, size_t size);
00546
00554 int CMEM_getVersion(void);
00555
00570 int CMEM_getBlock(unsigned long *pphys_base, size_t *psize);
00571
00587 int CMEM_getBlockAttrs(int blockid, CMEM_BlockAttrs *pattrs);
00588
00605 int CMEM_getNumBlocks(int *pnblocks);
00606
00619 int CMEM_exit(void);
00620
00623 #if defined (__cplusplus)
00624 }
00625 #endif
00626
00627 #endif
00628 /*
00629  *  @(#) ti.sdo.linuxutils.cmem; 2, 2, 0,1; 5-30-2012 11:50:08; /db/atree/library/trees/linuxutils/linuxutils-l01/src/ xlibrary
00630
00631  */
00632


Linux Utils Application Programming Interface (API): disclaimer.dox File Reference

  • File List
  • Globals

disclaimer.dox File Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines


Linux Utils Application Programming Interface (API): doxygen.txt File Reference

  • File List
  • Globals

doxygen.txt File Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines


Linux Utils Application Programming Interface (API): Data Fields - Variables

  • Data Structures
  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • addr : SDMA_ChannelDescriptor
  • alignment : CMEM_AllocParams
  • channel : SDMA_requestDmaParams
  • chanNum : SDMA_ChannelDescriptor
  • checkPending : SDMA_transferState
  • flags : CMEM_AllocParams
  • phys_base : CMEM_BlockAttrs
  • ptransferState : SDMA_requestDmaParams
  • size : CMEM_BlockAttrs
  • transferCompleted : SDMA_transferState
  • transferState : SDMA_ChannelDescriptor
  • type : CMEM_AllocParams


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • c
  • s

- c -

  • CMEM_CACHED : cmem.h
  • CMEM_HEAP : cmem.h
  • CMEM_INV : cmem.h
  • CMEM_IOCALLOC : cmem.h
  • CMEM_IOCALLOCCACHED : cmem.h
  • CMEM_IOCALLOCHEAP : cmem.h
  • CMEM_IOCALLOCHEAPCACHED : cmem.h
  • CMEM_IOCCACHE : cmem.h
  • CMEM_IOCCACHEINV : cmem.h
  • CMEM_IOCCACHEWB : cmem.h
  • CMEM_IOCCACHEWBINV : cmem.h
  • CMEM_IOCCMDMASK : cmem.h
  • CMEM_IOCFREE : cmem.h
  • CMEM_IOCFREEHEAP : cmem.h
  • CMEM_IOCFREEHEAPPHYS : cmem.h
  • CMEM_IOCFREEPHYS : cmem.h
  • CMEM_IOCGETBLOCK : cmem.h
  • CMEM_IOCGETNUMBLOCKS : cmem.h
  • CMEM_IOCGETPHYS : cmem.h
  • CMEM_IOCGETPOOL : cmem.h
  • CMEM_IOCGETSIZE : cmem.h
  • CMEM_IOCGETVERSION : cmem.h
  • CMEM_IOCMAGIC : cmem.h
  • CMEM_IOCREGUSER : cmem.h
  • CMEM_NONCACHED : cmem.h
  • CMEM_PHYS : cmem.h
  • CMEM_POOL : cmem.h
  • CMEM_VERSION : cmem.h
  • CMEM_WB : cmem.h

- s -

  • SDMA_IOCCMDMASK : sdma.h
  • SDMA_IOCGETVERSION : sdma.h
  • SDMA_IOCMAGIC : sdma.h
  • SDMA_IOCRELEASEDMA : sdma.h
  • SDMA_IOCREQUESTDMA : sdma.h
  • SDMA_IOCWAITFORCOMPLETION : sdma.h
  • SDMA_VERSION : sdma.h


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • SDMA_Status : sdma.h


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • SDMA_EFAIL : sdma.h
  • SDMA_ENOCHANNEL : sdma.h
  • SDMA_ENOINIT : sdma.h
  • SDMA_OK : sdma.h


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • CMEM_alloc() : cmem.h
  • CMEM_alloc2() : cmem.h
  • CMEM_allocPool() : cmem.h
  • CMEM_allocPool2() : cmem.h
  • CMEM_cacheInv() : cmem.h
  • CMEM_cacheWb() : cmem.h
  • CMEM_cacheWbInv() : cmem.h
  • CMEM_exit() : cmem.h
  • CMEM_free() : cmem.h
  • CMEM_getBlock() : cmem.h
  • CMEM_getBlockAttrs() : cmem.h
  • CMEM_getNumBlocks() : cmem.h
  • CMEM_getPhys() : cmem.h
  • CMEM_getPool() : cmem.h
  • CMEM_getPool2() : cmem.h
  • CMEM_getVersion() : cmem.h
  • CMEM_init() : cmem.h
  • CMEM_registerAlloc() : cmem.h
  • CMEM_unregister() : cmem.h
  • SDMA_check() : sdma.h
  • SDMA_exit() : sdma.h
  • SDMA_freeChannels() : sdma.h
  • SDMA_getChannels() : sdma.h
  • SDMA_getVersion() : sdma.h
  • SDMA_init() : sdma.h
  • SDMA_wait() : sdma.h


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • CMEM_AllocParams : cmem.h
  • CMEM_BlockAttrs : cmem.h
  • SDMA_ChannelDescriptor : sdma.h
  • SDMA_Status : sdma.h


Linux Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • CMEM_DEFAULTPARAMS : cmem.h


Linux Utils Application Programming Interface (API): Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented,
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};

This will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.

The arrows have the following meaning:

  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


Linux Utils Application Programming Interface (API): Page Index

Related Pages

Here is a list of all related documentation pages:
  • Disclaimer


Linux Utils Application Programming Interface (API): sdma.h Source File

  • File List
  • Globals
  • packages
  • ti
  • sdo
  • linuxutils
  • sdma
  • include

sdma.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2012, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  *
00032  */
00033
00085 #ifndef ti_sdo_linuxutils_sdma_interface_sdma_
00086 #define ti_sdo_linuxutils_sdma_interface_sdma_
00087
00088 #if defined (__cplusplus)
00089 extern "C" {
00090 #endif
00091
00094
00095 #define SDMA_VERSION    0x01010000U
00096
00100 #define SDMA_IOCMAGIC                   0x0000fb00
00101 #define SDMA_IOCCMDMASK                 0x000000ff
00102
00103 #define SDMA_IOCREQUESTDMA              1
00104 #define SDMA_IOCRELEASEDMA              2
00105 #define SDMA_IOCWAITFORCOMPLETION       3
00106 #define SDMA_IOCGETVERSION              4
00107
00118 struct SDMA_transferState {
00119     volatile int transferCompleted;
00120     volatile int checkPending;
00121 };
00122
00126 union SDMA_requestDmaParams {
00127     struct SDMA_transferState *ptransferState;
00128     int channel;
00129 };
00130
00147 typedef struct SDMA_ChannelDescriptor {
00148     int chanNum;
00149     unsigned int * addr;
00150     struct SDMA_transferState transferState;
00151 } SDMA_ChannelDescriptor;
00152
00156 typedef enum SDMA_Status {
00157     SDMA_OK = 0,
00158     SDMA_EFAIL,
00159     SDMA_ENOCHANNEL,
00160     SDMA_ENOINIT
00161 } SDMA_Status;
00162
00163
00167 int SDMA_init(void);
00168
00172 int SDMA_exit(void);
00173
00194 SDMA_Status SDMA_getChannels(int numChannels,
00195         SDMA_ChannelDescriptor chanArray[]);
00196
00207 SDMA_Status SDMA_freeChannels(int numChannels,
00208         SDMA_ChannelDescriptor chanArray[]);
00209
00226 SDMA_Status SDMA_wait(SDMA_ChannelDescriptor * channel);
00227
00241 SDMA_Status SDMA_check(SDMA_ChannelDescriptor * channel, int *pcompleted);
00242
00250 int SDMA_getVersion(void);
00251
00254 #if defined (__cplusplus)
00255 }
00256 #endif
00257
00258 #endif
00259 /*
00260  *  @(#) ti.sdo.linuxutils.sdma; 1, 0, 0,1; 5-30-2012 11:50:35; /db/atree/library/trees/linuxutils/linuxutils-l01/src/ xlibrary
00261
00262  */
00263