Safe Haskell | None |
---|---|
Language | Haskell2010 |
Codegen.LibSSM
Description
Bindings to the ssm-runtime library.
Synopsis
- newtype CIdent = CIdent Identifier
- ctype :: CIdent -> Type
- cexpr :: CIdent -> Exp
- csizeof :: Type -> Exp
- cint :: Int -> Exp
- ccall :: Exp -> [Exp] -> Exp
- amp :: Exp -> Exp
- star :: Exp -> Exp
- data CSize
- size_to_int :: CSize -> Int
- size_to_string :: IsString s => CSize -> s
- data SSMError
- throw :: SSMError -> Exp
- word_t :: Type
- value_t :: Type
- packed_val :: CIdent
- heap_ptr :: CIdent
- marshal :: Exp -> Exp
- unmarshal :: Exp -> Exp
- on_heap :: Exp -> Exp
- dup :: Exp -> Exp
- dups :: Exp -> Exp -> Exp
- drop :: Exp -> Exp
- time_t :: Type
- time_obj_t :: Type
- never :: Exp
- now :: Exp
- new_time :: Exp -> Exp
- read_time :: Exp -> Exp
- sv_last_updated :: Exp -> Exp
- priority_t :: Type
- depth_t :: Type
- root_priority :: Exp
- root_depth :: Exp
- act_t :: Type
- act_pc :: CIdent
- act_caller :: CIdent
- act_depth :: CIdent
- act_priority :: CIdent
- trigger_t :: Type
- enter :: Exp -> Exp -> Exp -> Exp -> Exp -> Exp
- leave :: Exp -> Exp -> Exp
- has_children :: Exp -> Exp
- activate :: Exp -> Exp
- top_parent :: Exp
- sv_t :: Type
- new_sv :: Exp -> Exp
- to_sv :: Exp -> Exp
- deref :: Exp -> Exp
- assign :: Exp -> Exp -> Exp -> Exp
- later :: Exp -> Exp -> Exp -> Exp
- sensitize :: Exp -> Exp -> Exp
- desensitize :: Exp -> Exp
- new_adt :: Int -> DConId -> Exp
- adt_field :: Exp -> Int -> Exp
- adt_tag :: Exp -> Exp
- closure1_t :: Type
- static_closure :: Exp -> Int -> Initializer
- static_value :: CIdent -> Exp
- new_closure :: CIdent -> Int -> Exp
- closure_push :: Exp -> Exp -> Exp
- closure_pop :: Exp -> Exp
- closure_apply :: Exp -> Exp -> Exp -> Exp -> Exp -> Exp -> Exp
- closure_apply_final :: Exp -> Exp -> Exp -> Exp -> Exp -> Exp -> Exp
- closure_free :: Exp -> Exp
- container_of :: CIdent
- program_init :: CIdent
- program_exit :: CIdent
- stdout_handler_enter :: CIdent
- stdin_handler_spawn :: CIdent
- stdin_handler_kill :: CIdent
- act_typename :: VarId -> CIdent
- act_member :: CIdent
- act_ :: VarId -> Type
- to_act :: Exp -> VarId -> Exp
- enter_ :: VarId -> CIdent
- closure_ :: VarId -> CIdent
- step_ :: VarId -> CIdent
- trig_ :: Int -> CIdent
- tmp_ :: Int -> CIdent
- label_ :: Int -> CIdent
- arg_ :: Int -> CIdent
- argv :: CIdent
- ret_val :: CIdent
- actg :: CIdent
- acts :: CIdent
- acts_ :: CIdent -> Exp
- enter_caller :: CIdent
- enter_priority :: CIdent
- enter_depth :: CIdent
- leave_label :: CIdent
- cast_to_signed :: CSize -> Exp -> Exp
- cast_to_unsigned :: CSize -> Exp -> Exp
- cast_to_int :: Bool -> CSize -> Exp -> Exp
- shl :: Exp -> Exp -> Exp
- shr :: Exp -> Exp -> Exp
Documentation
Identifiers in C.
Constructors
CIdent Identifier |
size_to_string :: IsString s => CSize -> s Source #
Convert a CSize
into some string identifier of the size.
enum ssm_error
, an enumeration of possible runtime errors.
Constructors
INTERNAL_ERROR | Reserved for unforeseen, non-user-facing errors. |
EXHAUSTED_ACT_QUEUE | Tried to insert into full ready queue. |
EXHAUSTED_EVENT_QUEUE | Tried to insert into full event queue. |
EXHAUSTED_MEMORY | Could not allocate more memory. |
EXHAUSTED_PRIORITY | Tried to exceed available recursion depth. |
NOT_READY | Not yet ready to perform the requested action. |
INVALID_TIME | Specified invalid time. |
INVALID_MEMORY | Invalid memory layout. |
packed_val :: CIdent Source #
Name of the packed_val
field in a value_t
.
time_obj_t :: Type Source #
struct ssm_time
, the heap-representation of a time_t
.
new_time :: Exp -> Exp Source #
ssm_new_time
, allocate a time_obj_t
on the heap.
read_time :: Exp -> Exp Source #
ssm_time_read
, read the time in a time_obj_t
.
sv_last_updated :: Exp -> Exp Source #
Read the last_updated
field of an ssm_value_t
pointing to a scheduled variable.
priority_t :: Type Source #
ssm_priority_t
, thread priority.
root_priority :: Exp Source #
SSM_ROOT_PRIORITY
, the depth of the root process.
root_depth :: Exp Source #
SSM_ROOT_DEPTH
, the depth of the root process.
act_caller :: CIdent Source #
Name of the caller field in an act_t
.
act_priority :: CIdent Source #
Name of the priority field in an act_t
.
enter :: Exp -> Exp -> Exp -> Exp -> Exp -> Exp Source #
ssm_enter
, allocate and initialize activation record.
has_children :: Exp -> Exp Source #
ssm_has_children
, returns non-zero if act
has at least one child.
top_parent :: Exp Source #
ssm_top_parent
, Name of top level parent activation record
later :: Exp -> Exp -> Exp -> Exp Source #
ssm_later
, schedule a delayed assignment to a scheduled variable.
desensitize :: Exp -> Exp Source #
ssm_sensitize
, sensitize a trigger to a variable.
adt_field :: Exp -> Int -> Exp Source #
ssm_adt_field
, access the i
th field of an ADT object. Assignable.
closure1_t :: Type Source #
ssm_closure1_t
, the (template) type of a closure with a single argument.
static_closure :: Exp -> Int -> Initializer Source #
Inintializer for a "static" closure that contains no arguments.
FIXME: An ugly hack that shouldn't exist because John didn't have the foresight to provide an interface to define static closures.
static_value :: CIdent -> Exp Source #
Promote a static object to an ssm_value_t
(warning: hacky!).
new_closure :: CIdent -> Int -> Exp Source #
ssm_new_closure
, allocate a new closure object on the heap.
closure_push :: Exp -> Exp -> Exp Source #
ssm_closure_push
, add a new argument to a closure.
closure_pop :: Exp -> Exp Source #
ssm_closure_pop
, remove an argument from a closure.
closure_apply :: Exp -> Exp -> Exp -> Exp -> Exp -> Exp -> Exp Source #
ssm_closure_apply
, apply a closure to an argument.
closure_apply_final :: Exp -> Exp -> Exp -> Exp -> Exp -> Exp -> Exp Source #
ssm_closure_apply
, apply a closure to an argument, consuming the closure.
closure_free :: Exp -> Exp Source #
ssm_closure_free
, free a closure (without performing reference counting).
container_of :: CIdent Source #
Name of the pseudonymous macro from the Linux kernel.
program_init :: CIdent Source #
Name of program initialization hook, called to set up program with runtime.
program_exit :: CIdent Source #
Name of program destruction hook, called before gracefully exiting program.
stdout_handler_enter :: CIdent Source #
Name of stdout handler enter function, used to bind stdout for POSIX platforms. NOTE: this is a hack
stdin_handler_spawn :: CIdent Source #
Name of stdin handler spawner, used to bind stdin for POSIX platforms. NOTE: this is a hack
stdin_handler_kill :: CIdent Source #
Name of stdin handler killer, used to destroy handler thread on POSIX. NOTE: this is a hack
act_typename :: VarId -> CIdent Source #
Obtain the name of a process activation record struct.
act_member :: CIdent Source #
Identifier for act member in act struct.
to_act :: Exp -> VarId -> Exp Source #
Obtain the process-specific activation record from a generic one.
enter_caller :: CIdent Source #
Name of the caller argument of an enter call.
enter_priority :: CIdent Source #
Name of the priority argument of an enter call.
enter_depth :: CIdent Source #
Name of the depth argument of an enter call.
leave_label :: CIdent Source #
Label to jump to terminate execution.
cast_to_signed :: CSize -> Exp -> Exp Source #
Cast to a signed integer of a particular size.
cast_to_unsigned :: CSize -> Exp -> Exp Source #
Cast to an unsigned integer of a particular size.
cast_to_int :: Bool -> CSize -> Exp -> Exp Source #
Cast to an integer of a particular size and signedness.