SAM function SAM-Memory-speculative-write-prepare()

From SoOS

Jump to: navigation, search

Contents

[edit] Name

SAM_Memory_speculative_write_prepare - Mark a region of memory for speculative write

[edit] Synopsis

#include <sam.h>
 
SAM_pdif_t SAM_Memory_speculative_write_prepare(SAM_t sam, void *addr);

[edit] Description

The SAM_Memory_speculative_write_prepare() function marks the registered region of memory in which addr is contained, as written by the calling worker thread. It shall be called before writing to memory. All the writing after the call to the function SAM_Memory_speculative_write_prepare() shall be used writing to __SAM_ADDR__() and not directly to the memory addresses.

[edit] Return value

The return value is a parameter of type SAM_pdif_t that shall be used with the address calculator macro __SAM_ADDR__() for reading or writing to that memory region.

[edit] Errors

None, assumes correct input parameters.

[edit] Examples

Example 4 - Executing speculatively, flashing back, and speculative writing
Example 5 - Using multiple protected memory regions within the same SAM context

[edit] See also

SAM_Memory_speculative_read(), SAM_Memory_write_prepare(), SAM_Memory_write(), __SAM_ADDR__(), <sam.h>.