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

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

WinCE Utils API Reference

winceutils-b01

Modules

The WinCE Utils product contains several components:

  • Contiguous Memory Manager
Copyright 2010, Texas Instruments Incorporated


WinCE 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


WinCE Utils Application Programming Interface (API): Module Index

Modules

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


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

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 0x02200000U
#define | CMEM_WB 0x0100
#define | CMEM_INV 0x0200
#define | CMEM_HEAP 0x0400
#define | CMEM_POOL 0x0000
#define | CMEM_CACHED 0x0800
#define | CMEM_NONCACHED 0x0000
#define | CMEM_PHYS 0x1000
#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_IOCMAPADDRESS 12
#define | CMEM_IOCUNMAPADDRESS 13
#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

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.
int | CMEM_free (void *ptr, CMEM_AllocParams *params)
Free a buffer previously allocated with CMEM_alloc()/ CMEM_allocPool().
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.
int | CMEM_mapAddress (unsigned long physAddr, unsigned long length, unsigned int flags, unsigned long *pVirtAddr)
Map a physical address to the calling process's virtual address space.
int | CMEM_unmapAddress (unsigned long virtAddr, unsigned long length)
Unmap a virtual address that was previously mapped to the calling process's virtual address space with CMEM_mapAddress().

Variables

CMEM_AllocParams CMEM_DEFAULTPARAMS

Detailed Description

This is the API for the Contiguous Memory Manager.

Define Documentation

#define CMEM_VERSION 0x02200000U
#define CMEM_WB 0x0100
#define CMEM_INV 0x0200
#define CMEM_HEAP 0x0400

operation applies to heap

#define CMEM_POOL 0x0000

operation applies to a pool

#define CMEM_CACHED 0x0800

allocated buffer is cached

#define CMEM_NONCACHED 0x0000

allocated buffer is not cached

#define CMEM_PHYS 0x1000
#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_IOCMAPADDRESS 12
#define CMEM_IOCUNMAPADDRESS 13
#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

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_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_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_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_free()
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()
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()
int CMEM_mapAddress | ( | unsigned long | physAddr,
 |  | unsigned long | length,
 |  | unsigned int | flags,
 |  | unsigned long * | pVirtAddr
 | ) |  |

Map a physical address to the calling process's virtual address space.

Parameters:
physAddr | The physical address to be mapped.
length | The number of bytes to be mapped.
flags | TBD.
pVirtAddr | Location to store the virtual address of the mapped region.
Returns:
0 for success or <0 for failure.
Precondition:
Must have called CMEM_init()
physAddr and length must be multiples of the page size.
See also:
CMEM_unmapAddress()
int CMEM_unmapAddress | ( | unsigned long | virtAddr,
 |  | unsigned long | length
 | ) |  |

Unmap a virtual address that was previously mapped to the calling process's virtual address space with CMEM_mapAddress().

Parameters:
virtAddr | The virtual address to be unmapped.
length | The number of bytes to be unmapped.
Returns:
0 for success or <0 for failure.
Precondition:
Must have called CMEM_mapAddress() to obtain virtAddr.
See also:
CMEM_mapAddress()

Variable Documentation

CMEM_AllocParams CMEM_DEFAULTPARAMS


WinCE 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 |


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

  • Data Structures
  • Data Structure Index
  • 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


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

  • Data Structures
  • Data Structure Index
  • 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


WinCE 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:
  • alignment : CMEM_AllocParams
  • flags : CMEM_AllocParams
  • phys_base : CMEM_BlockAttrs
  • size : CMEM_BlockAttrs
  • type : CMEM_AllocParams


WinCE 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


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

  • File List
  • Globals
packages » ti » sdo » winceutils » cmem

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 dll (cmemk.dll), which needs to be loaded in order for calls to this library to succeed.

#include <windows.h>
Include dependency graph for cmem.h:

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 0x02200000U
#define | CMEM_WB 0x0100
#define | CMEM_INV 0x0200
#define | CMEM_HEAP 0x0400
#define | CMEM_POOL 0x0000
#define | CMEM_CACHED 0x0800
#define | CMEM_NONCACHED 0x0000
#define | CMEM_PHYS 0x1000
#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_IOCMAPADDRESS 12
#define | CMEM_IOCUNMAPADDRESS 13
#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

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.
int | CMEM_free (void *ptr, CMEM_AllocParams *params)
Free a buffer previously allocated with CMEM_alloc()/ CMEM_allocPool().
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.
int | CMEM_mapAddress (unsigned long physAddr, unsigned long length, unsigned int flags, unsigned long *pVirtAddr)
Map a physical address to the calling process's virtual address space.
int | CMEM_unmapAddress (unsigned long virtAddr, unsigned long length)
Unmap a virtual address that was previously mapped to the calling process's virtual address space with CMEM_mapAddress().

Variables

CMEM_AllocParams CMEM_DEFAULTPARAMS


WinCE Utils Application Programming Interface (API): Directory Hierarchy

Directories

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


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

packages

packages Directory Reference

Directories

directory ti


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

packages » ti

ti Directory Reference

Directories

directory sdo


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

packages » ti » sdo

sdo Directory Reference

Directories

directory winceutils


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

packages » ti » sdo » winceutils

winceutils Directory Reference

Directories

directory cmem


WinCE Utils Application Programming Interface (API): packages/ti/sdo/winceutils/cmem/ Directory Reference

packages » ti » sdo » winceutils » cmem

cmem Directory Reference

Files

file cmem.h [code]

Describes the interface to the contiguous memory allocator.


WinCE Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines
  • c
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_allocPool() : cmem.h
  • CMEM_allocPool2() : 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_IOCMAPADDRESS : cmem.h
  • CMEM_IOCREGUSER : cmem.h
  • CMEM_IOCUNMAPADDRESS : cmem.h
  • CMEM_mapAddress() : cmem.h
  • CMEM_NONCACHED : cmem.h
  • CMEM_PHYS : cmem.h
  • CMEM_POOL : cmem.h
  • CMEM_unmapAddress() : cmem.h
  • CMEM_VERSION : cmem.h
  • CMEM_WB : cmem.h


WinCE Utils Application Programming Interface (API): Alphabetical List

  • Data Structures
  • Data Structure Index
  • Data Fields

Data Structure Index

C
C
CMEM_AllocParams CMEM_BlockAttrs
C


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

  • File List
  • Globals
packages » ti » sdo » winceutils » cmem

cmem.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2010, 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 /*
00034  *  ======== cmem.h ========
00035  */
00036
00053 #ifndef ti_sdo_winceutils_cmem_CMEM_H
00054 #define ti_sdo_winceutils_cmem_CMEM_H
00055
00056 #include <windows.h>
00057
00058 #if defined (__cplusplus)
00059 extern "C" {
00060 #endif
00061
00064
00065 #define CMEM_VERSION    0x02200000U
00066
00067 /* ioctl cmd "flavors" */
00068 #define CMEM_WB                         0x0100
00069 #define CMEM_INV                        0x0200
00070 #define CMEM_HEAP                       0x0400
00071 #define CMEM_POOL                       0x0000
00072 #define CMEM_CACHED                     0x0800
00073 #define CMEM_NONCACHED                  0x0000
00074 #define CMEM_PHYS                       0x1000
00075
00076 /* supported "base" ioctl cmds for the driver. */
00077 #define CMEM_IOCALLOC                   1
00078 #define CMEM_IOCALLOCHEAP               2
00079 #define CMEM_IOCFREE                    3
00080 #define CMEM_IOCGETPHYS                 4
00081 #define CMEM_IOCGETSIZE                 5
00082 #define CMEM_IOCGETPOOL                 6
00083 #define CMEM_IOCCACHE                   7
00084 #define CMEM_IOCGETVERSION              8
00085 #define CMEM_IOCGETBLOCK                9
00086 #define CMEM_IOCREGUSER                 10
00087 #define CMEM_IOCGETNUMBLOCKS            11
00088 #define CMEM_IOCMAPADDRESS              12
00089 #define CMEM_IOCUNMAPADDRESS            13
00090
00091 /*
00092  * New ioctl cmds should use integers greater than the largest current cmd
00093  * in order to not break backward compatibility.
00094  */
00095
00096 /* supported "flavors" to "base" ioctl cmds for the driver. */
00097 #define CMEM_IOCCACHEWBINV              CMEM_IOCCACHE | CMEM_WB | CMEM_INV
00098 #define CMEM_IOCCACHEWB                 CMEM_IOCCACHE | CMEM_WB
00099 #define CMEM_IOCCACHEINV                CMEM_IOCCACHE | CMEM_INV
00100 #define CMEM_IOCALLOCCACHED             CMEM_IOCALLOC | CMEM_CACHED
00101 #define CMEM_IOCALLOCHEAPCACHED         CMEM_IOCALLOCHEAP | CMEM_CACHED
00102 #define CMEM_IOCFREEHEAP                CMEM_IOCFREE | CMEM_HEAP
00103 #define CMEM_IOCFREEPHYS                CMEM_IOCFREE | CMEM_PHYS
00104 #define CMEM_IOCFREEHEAPPHYS            CMEM_IOCFREE | CMEM_HEAP | CMEM_PHYS
00105
00106 #define CMEM_IOCCMDMASK                 0x000000ff
00107
00112 typedef struct CMEM_AllocParams {
00113     int type;
00114     int flags;
00115     size_t alignment;
00118 } CMEM_AllocParams;
00119
00120 extern CMEM_AllocParams CMEM_DEFAULTPARAMS;
00121
00122 typedef struct CMEM_BlockAttrs {
00123     unsigned long phys_base;
00124     size_t size;
00125 } CMEM_BlockAttrs;
00126
00131 union CMEM_AllocUnion {
00132     struct {
00133         size_t size;
00134         size_t align;
00135         int blockid;
00136         DWORD dwProcId; // caller process ID - used to call VirtualCopyEx()
00137     } alloc_heap_inparams;
00138     struct {
00139         int poolid;
00140         int blockid;
00141         DWORD dwProcId; // caller process ID - used to call VirtualCopyEx()
00142     } alloc_pool_inparams;
00143     struct {
00144         int poolid;
00145         int blockid;
00146     } get_size_inparams;
00147     struct {
00148         size_t size;
00149         int blockid;
00150     } get_pool_inparams;
00151     struct {
00152         unsigned long physp;
00153         unsigned long virtp;
00154         size_t size;
00155     } alloc_pool_outparams;
00156     struct {
00157         unsigned long physp;
00158         size_t size;
00159     } get_block_outparams;
00160     struct {
00161         int poolid;
00162         size_t size;
00163     } free_outparams;
00164     struct {
00165         unsigned long physp;
00166         size_t size;
00167         DWORD dwProcId; // caller process ID - used to call VirtualCopyEx()
00168     } map_inparams;
00169     struct {
00170         unsigned long virtp;
00171         size_t size;
00172         DWORD dwProcId; // caller process ID - used for VirtualFreeEx
00173     } unmap_inparams;
00174     unsigned long physp;
00175     unsigned long virtp;
00176     size_t size;
00177     int poolid;
00178     int blockid;
00179 };
00180
00190 int CMEM_init(void);
00191
00207 int CMEM_getPool(size_t size);
00208
00225 int CMEM_getPool2(int blockid, size_t size);
00226
00246 void *CMEM_allocPool(int poolid, CMEM_AllocParams *params);
00247
00268 void *CMEM_allocPool2(int blockid, int poolid, CMEM_AllocParams *params);
00269
00292 void *CMEM_alloc(size_t size, CMEM_AllocParams *params);
00293
00318 void *CMEM_alloc2(int blockid, size_t size, CMEM_AllocParams *params);
00319
00340 int CMEM_free(void *ptr, CMEM_AllocParams *params);
00341
00351 unsigned long CMEM_getPhys(void *ptr);
00352
00366 int CMEM_cacheWb(void *ptr, size_t size);
00367
00381 int CMEM_cacheInv(void *ptr, size_t size);
00382
00397 int CMEM_cacheWbInv(void *ptr, size_t size);
00398
00406 int CMEM_getVersion(void);
00407
00422 int CMEM_getBlock(unsigned long *pphys_base, size_t *psize);
00423
00439 int CMEM_getBlockAttrs(int blockid, CMEM_BlockAttrs *pattrs);
00440
00457 int CMEM_getNumBlocks(int *pnblocks);
00458
00471 int CMEM_exit(void);
00472
00490 int CMEM_mapAddress(unsigned long physAddr, unsigned long length,
00491         unsigned int flags, unsigned long *pVirtAddr);
00492
00506 int CMEM_unmapAddress(unsigned long virtAddr, unsigned long length);
00507
00510 #if defined (__cplusplus)
00511 }
00512 #endif
00513
00514 #endif
00515 /*
00516  *  @(#) ti.sdo.winceutils.cmem; 1, 0, 0,47; 11-9-2010 15:33:11; /db/atree/library/trees/winceutils/winceutils-b01x/src/ xlibrary
00517
00518  */
00519


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

  • File List
  • Globals

disclaimer.dox File Reference

Copyright 2010, Texas Instruments Incorporated


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

  • File List
  • Globals

doxygen.txt File Reference

Copyright 2010, Texas Instruments Incorporated


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

  • Data Structures
  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • alignment : CMEM_AllocParams
  • flags : CMEM_AllocParams
  • phys_base : CMEM_BlockAttrs
  • size : CMEM_BlockAttrs
  • type : CMEM_AllocParams


WinCE Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines
  • 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_IOCMAPADDRESS : cmem.h
  • CMEM_IOCREGUSER : cmem.h
  • CMEM_IOCUNMAPADDRESS : cmem.h
  • CMEM_NONCACHED : cmem.h
  • CMEM_PHYS : cmem.h
  • CMEM_POOL : cmem.h
  • CMEM_VERSION : cmem.h
  • CMEM_WB : cmem.h


WinCE Utils Application Programming Interface (API): Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • 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_mapAddress() : cmem.h
  • CMEM_unmapAddress() : cmem.h


WinCE Utils Application Programming Interface (API): Data Fields

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


WinCE 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.


WinCE Utils Application Programming Interface (API): Page Index

Related Pages

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