Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

These macros copy data values from any CPU memory address to any other memory address.

Files

lib_mem.h

Prototypes

Arguments

addr_dest

Lowest CPU memory address to copy source address’s data value.

addr_src

Lowest CPU memory address of the data value to copy.

val_size

Number of data value octets to copy.

Returned Value

None.

Required Configuration

None.

Notes / Warnings

CPU memory addresses/pointers not checked for NULL nor overlapping memory addresses which may result in undefined copy behavior.

MEM_VAL_COPY_xxx() macros copy data values based on CPU’s native data-word order.

MEM_VAL_COPY_xxx() macros copy data values without regard to CPU word-aligned addresses. Thus for processors that require data word alignment, data words can be copied to/from any CPU addresses, word-aligned or not, without generating data-word-alignment exceptions/faults.

Fixed-size copy MEM_VAL_COPY_xxx() macros are more efficient than dynamic-size copy MEM_VAL_COPY() macro and should be used whenever possible.

MEM_VAL_COPY_xxx() macros are not atomic operations and must not be used on any non-static (i.e., volatile) variables, registers, hardware, etc; without the caller of the macros providing some form of additional protection (e.g. mutual exclusion).

Example Usage

  • No labels