Creates and initializes all the built-in Cilk keywords functions and three
structures: __cilkrts_stack_frame, __cilkrts_pedigree and __cilkrts_worker.
Detailed information about __cilkrts_stack_frame and
__cilkrts_worker structures are given in libcilkrts/include/internal/abi.h.
__cilkrts_pedigree is described in libcilkrts/include/cilk/common.h.
Now build the following __cilkrts_pedigree struct:
struct __cilkrts_pedigree {
uint64_t rank;
struct __cilkrts_pedigree *parent;
}
Build the Cilk Stack Frame:
struct __cilkrts_stack_frame {
uint32_t flags;
uint32_t size;
struct __cilkrts_stack_frame *call_parent;
__cilkrts_worker *worker;
void *except_data;
void *ctx[4];
uint32_t mxcsr;
uint16_t fpcsr;
uint16_t reserved;
__cilkrts_pedigree pedigree;
};
Now add them to a common structure whose fields are #defined to something
that is used at a later stage.
We don't care about reserved, so no need to store it in cilk_trees.
Now let's do the following worker struct:
struct __cilkrts_worker {
__cilkrts_stack_frame *volatile *volatile tail;
__cilkrts_stack_frame *volatile *volatile head;
__cilkrts_stack_frame *volatile *volatile exc;
__cilkrts_stack_frame *volatile *volatile protected_tail;
__cilkrts_stack_frame *volatile *ltq_limit;
int32_t self;
global_state_t *g;
local_state *l;
cilkred_map *reducer_map;
__cilkrts_stack_frame *current_stack_frame;
void *reserved;
__cilkrts_worker_sysdep_state *sysdep;
__cilkrts_pedigree pedigree;
}
void __cilkrts_enter_frame_1 (__cilkrts_stack_frame *);
void __cilkrts_enter_frame_fast_1 (__cilkrts_stack_frame *);
void __cilkrts_pop_frame (__cilkrts_stack_frame *);
void __cilkrts_leave_frame (__cilkrts_stack_frame *);
void __cilkrts_sync (__cilkrts_stack_frame *);
void __cilkrts_detach (__cilkrts_stack_frame *);
__cilkrts_rethrow (struct stack_frame *);
__cilkrts_save_fp_ctrl_state (__cilkrts_stack_frame *);