SAM Library Interface
From SoOS
(for version 0.0.6)
[edit] Data Types
SAM_t;
Main data structure, it is needed by all library calls. It is a pointer to an internal structure, so there is no data replication when it is just passed by value.
SAM_Workerid_t;
Unique identifier of a worker.
SAM_Thread_type_t;
Type of thread (can be SAM_TYPE_MAIN, SAM_TYPE_WORKER or SAM_TYPE_INVALID)
SAM_Worker_fb_policy_t;
Type for the flashback policy information.
SAM_Worker_status_t;
Type for the worker status information.
SAM_pdif_t;
Type that handles the parameter needed to use the macro for speculative writing.
[edit] Library Calls
void SAM_Init(SAM_t *sam)
void SAM_Destroy(SAM_t *sam)
void SAM_Memory_address_register(SAM_t sam, void *addr)
void SAM_Memory_region_register(SAM_t sam, void *addr, unsigned int size)
void SAM_Memory_region_unregister(SAM_t sam, void *addr)
void SAM_Memory_region_protect(SAM_t sam, void *addr)
void SAM_Memory_region_release(SAM_t sam, void *addr)
int SAM_Memory_region_is_protected(SAM_t sam, void *addr)
SAM_Workerid_t SAM_Execution_create(SAM_t sam, void *(*start_routine)(void*), void *arg)
void * SAM_Execution_join(SAM_t sam, SAM_Workerid_t wid)
void SAM_Execution_start(void *args, SAM_t *sam, void **arg)
void SAM_Execution_finish(SAM_t sam)
void SAM_Execution_restart(SAM_t sam, SAM_Workerid_t wid)
void SAM_Execution_cancel(SAM_t sam, SAM_Workerid_t wid) ** Do not use this function, it is buggy and may lead to inconsistent state **
void SAM_Memory_speculative_read(SAM_t sam, SAM_Workerid_t wid, void *addr)
SAM_pdif_t SAM_Memory_speculative_write_prepare(SAM_t sam, void *addr)
void SAM_Memory_write_prepare(SAM_t sam, void *addr)
void SAM_Memory_write(SAM_t sam, void *addr)
SAM_Worker_fb_policy_t SAM_Worker_fb_policy_get(SAM_t sam, SAM_Workerid_t wid)
SAM_Worker_fb_policy_t SAM_Worker_fb_policy_set(SAM_t sam, SAM_Workerid_t wid, SAM_Worker_fb_policy_t policy)
SAM_Thread_type_t SAM_My_type(SAM_t sam)
SAM_Workerid_t SAM_My_workid(SAM_t sam)
pthread_t SAM_My_pthreadid()
SAM_Worker_status_t SAM_Check_execution_status(SAM_t sam, SAM_Workerid_t wid)
void SAM_Delete_execution_info(SAM_t sam, SAM_Workerid_t wid)
useconds_t SAM_Execution_fbdelay_get(SAM_t sam, SAM_Workerid_t wid)
useconds_t SAM_Execution_fbdelay_set(SAM_t sam, SAM_Workerid_t wid, useconds_t time)