Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

lib_mem.h

Prototypes

Code Block
LanguageC++
CaptionTextCAPTION
languagecpp
          MEM_VAL_COPY_08(addr_dest, addr_src);
          MEM_VAL_COPY_16(addr_dest, addr_src);
          MEM_VAL_COPY_32(addr_dest, addr_src);
           
          MEM_VAL_COPY(addr_dest, addr_src, val_size);


Arguments

addr_dest

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

...

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

CAPTION
Code Block
LanguageC++
CaptionText
languagecpp
          CPU_INT16U  *pmem;
          CPU_INT16U  *pval;
         


          pmem = &SomeAddr;            /* Any CPU address */
          pval = &SomeVal;             /* Any CPU address */
          MEM_VAL_COPY_16(pmem, pval);