globalcontext.h

Include dependency graph for globalcontext.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="atom.h" tooltip="atom.h"]
    "5" [label="erl_nif.h" tooltip="erl_nif.h"]
    "1" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.h" fillcolor="#BFBFBF"]
    "9" [label="list.h" tooltip="list.h"]
    "17" [label="memory.h" tooltip="memory.h"]
    "20" [label="refc_binary.h" tooltip="refc_binary.h"]
    "21" [label="resources.h" tooltip="resources.h"]
    "10" [label="smp.h" tooltip="smp.h"]
    "13" [label="synclist.h" tooltip="synclist.h"]
    "15" [label="term.h" tooltip="term.h"]
    "6" [label="term_typedef.h" tooltip="term_typedef.h"]
    "22" [label="timer_list.h" tooltip="timer_list.h"]
    "18" [label="utils.h" tooltip="utils.h"]
    "8" [label="inttypes.h" tooltip="inttypes.h"]
    "7" [label="limits.h" tooltip="limits.h"]
    "12" [label="stdatomic.h" tooltip="stdatomic.h"]
    "11" [label="stdbool.h" tooltip="stdbool.h"]
    "19" [label="stddef.h" tooltip="stddef.h"]
    "2" [label="stdint.h" tooltip="stdint.h"]
    "14" [label="stdio.h" tooltip="stdio.h"]
    "4" [label="stdlib.h" tooltip="stdlib.h"]
    "16" [label="string.h" tooltip="string.h"]
    "3" -> "2" [dir=forward tooltip="include"]
    "3" -> "4" [dir=forward tooltip="include"]
    "5" -> "6" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "5" [dir=forward tooltip="include"]
    "1" -> "9" [dir=forward tooltip="include"]
    "1" -> "10" [dir=forward tooltip="include"]
    "1" -> "13" [dir=forward tooltip="include"]
    "1" -> "15" [dir=forward tooltip="include"]
    "1" -> "22" [dir=forward tooltip="include"]
    "17" -> "5" [dir=forward tooltip="include"]
    "17" -> "6" [dir=forward tooltip="include"]
    "17" -> "18" [dir=forward tooltip="include"]
    "17" -> "2" [dir=forward tooltip="include"]
    "17" -> "4" [dir=forward tooltip="include"]
    "20" -> "11" [dir=forward tooltip="include"]
    "20" -> "4" [dir=forward tooltip="include"]
    "20" -> "9" [dir=forward tooltip="include"]
    "20" -> "21" [dir=forward tooltip="include"]
    "20" -> "10" [dir=forward tooltip="include"]
    "21" -> "4" [dir=forward tooltip="include"]
    "21" -> "5" [dir=forward tooltip="include"]
    "21" -> "9" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "10" -> "12" [dir=forward tooltip="include"]
    "13" -> "9" [dir=forward tooltip="include"]
    "13" -> "14" [dir=forward tooltip="include"]
    "13" -> "10" [dir=forward tooltip="include"]
    "15" -> "11" [dir=forward tooltip="include"]
    "15" -> "2" [dir=forward tooltip="include"]
    "15" -> "14" [dir=forward tooltip="include"]
    "15" -> "4" [dir=forward tooltip="include"]
    "15" -> "16" [dir=forward tooltip="include"]
    "15" -> "17" [dir=forward tooltip="include"]
    "15" -> "20" [dir=forward tooltip="include"]
    "15" -> "18" [dir=forward tooltip="include"]
    "15" -> "6" [dir=forward tooltip="include"]
    "6" -> "7" [dir=forward tooltip="include"]
    "6" -> "8" [dir=forward tooltip="include"]
    "6" -> "2" [dir=forward tooltip="include"]
    "22" -> "11" [dir=forward tooltip="include"]
    "22" -> "2" [dir=forward tooltip="include"]
    "22" -> "9" [dir=forward tooltip="include"]
    "18" -> "19" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include globalcontext.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/avmpack.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/avmpack.c"]
    "2" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/avmpack.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/avmpack.h"]
    "9" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.c"]
    "8" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.h"]
    "6" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/context.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/context.c"]
    "7" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/context.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/context.h"]
    "13" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/debug.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/debug.c"]
    "12" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/debug.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/debug.h"]
    "35" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/defaultatoms.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/defaultatoms.c"]
    "34" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/defaultatoms.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/defaultatoms.h"]
    "36" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/dictionary.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/dictionary.c"]
    "16" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/erl_nif_priv.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/erl_nif_priv.h"]
    "20" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/externalterm.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/externalterm.c"]
    "4" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.c"]
    "1" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.h" fillcolor="#BFBFBF"]
    "22" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/interop.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/interop.c"]
    "21" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/interop.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/interop.h"]
    "33" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/mailbox.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/mailbox.c"]
    "14" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/memory.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/memory.c"]
    "10" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.c"]
    "24" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.h"]
    "5" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/nifs.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/nifs.c"]
    "29" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/nifs.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/nifs.h"]
    "11" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/opcodesswitch.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/opcodesswitch.h"]
    "25" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/platform_nifs.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/platform_nifs.h"]
    "30" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/port.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/port.c"]
    "31" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/port.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/port.h"]
    "17" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/posix_nifs.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/posix_nifs.c"]
    "37" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/posix_nifs.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/posix_nifs.h"]
    "18" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/refc_binary.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/refc_binary.c"]
    "19" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/resources.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/resources.c"]
    "15" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/scheduler.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/scheduler.c"]
    "32" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/scheduler.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/scheduler.h"]
    "27" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.c"]
    "26" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.h"]
    "28" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/sys.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/sys.h"]
    "23" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/term.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/term.c"]
    "2" -> "3" [dir=back tooltip="include"]
    "2" -> "4" [dir=back tooltip="include"]
    "2" -> "5" [dir=back tooltip="include"]
    "8" -> "9" [dir=back tooltip="include"]
    "8" -> "10" [dir=back tooltip="include"]
    "8" -> "5" [dir=back tooltip="include"]
    "8" -> "11" [dir=back tooltip="include"]
    "7" -> "8" [dir=back tooltip="include"]
    "7" -> "6" [dir=back tooltip="include"]
    "7" -> "12" [dir=back tooltip="include"]
    "7" -> "16" [dir=back tooltip="include"]
    "7" -> "20" [dir=back tooltip="include"]
    "7" -> "4" [dir=back tooltip="include"]
    "7" -> "21" [dir=back tooltip="include"]
    "7" -> "14" [dir=back tooltip="include"]
    "7" -> "10" [dir=back tooltip="include"]
    "7" -> "24" [dir=back tooltip="include"]
    "7" -> "5" [dir=back tooltip="include"]
    "7" -> "29" [dir=back tooltip="include"]
    "7" -> "30" [dir=back tooltip="include"]
    "7" -> "31" [dir=back tooltip="include"]
    "7" -> "18" [dir=back tooltip="include"]
    "7" -> "19" [dir=back tooltip="include"]
    "7" -> "32" [dir=back tooltip="include"]
    "7" -> "26" [dir=back tooltip="include"]
    "7" -> "23" [dir=back tooltip="include"]
    "12" -> "13" [dir=back tooltip="include"]
    "12" -> "14" [dir=back tooltip="include"]
    "12" -> "11" [dir=back tooltip="include"]
    "12" -> "15" [dir=back tooltip="include"]
    "34" -> "9" [dir=back tooltip="include"]
    "34" -> "35" [dir=back tooltip="include"]
    "34" -> "36" [dir=back tooltip="include"]
    "34" -> "4" [dir=back tooltip="include"]
    "34" -> "22" [dir=back tooltip="include"]
    "34" -> "5" [dir=back tooltip="include"]
    "34" -> "11" [dir=back tooltip="include"]
    "34" -> "30" [dir=back tooltip="include"]
    "34" -> "31" [dir=back tooltip="include"]
    "34" -> "17" [dir=back tooltip="include"]
    "34" -> "19" [dir=back tooltip="include"]
    "34" -> "27" [dir=back tooltip="include"]
    "16" -> "6" [dir=back tooltip="include"]
    "16" -> "4" [dir=back tooltip="include"]
    "16" -> "14" [dir=back tooltip="include"]
    "16" -> "17" [dir=back tooltip="include"]
    "16" -> "18" [dir=back tooltip="include"]
    "16" -> "19" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "6" [dir=back tooltip="include"]
    "1" -> "7" [dir=back tooltip="include"]
    "1" -> "34" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "10" [dir=back tooltip="include"]
    "1" -> "24" [dir=back tooltip="include"]
    "1" -> "30" [dir=back tooltip="include"]
    "1" -> "31" [dir=back tooltip="include"]
    "1" -> "17" [dir=back tooltip="include"]
    "1" -> "37" [dir=back tooltip="include"]
    "1" -> "32" [dir=back tooltip="include"]
    "1" -> "28" [dir=back tooltip="include"]
    "21" -> "22" [dir=back tooltip="include"]
    "21" -> "5" [dir=back tooltip="include"]
    "21" -> "17" [dir=back tooltip="include"]
    "21" -> "23" [dir=back tooltip="include"]
    "24" -> "8" [dir=back tooltip="include"]
    "24" -> "10" [dir=back tooltip="include"]
    "24" -> "5" [dir=back tooltip="include"]
    "24" -> "11" [dir=back tooltip="include"]
    "24" -> "25" [dir=back tooltip="include"]
    "24" -> "26" [dir=back tooltip="include"]
    "24" -> "28" [dir=back tooltip="include"]
    "29" -> "10" [dir=back tooltip="include"]
    "29" -> "5" [dir=back tooltip="include"]
    "29" -> "11" [dir=back tooltip="include"]
    "29" -> "17" [dir=back tooltip="include"]
    "11" -> "6" [dir=back tooltip="include"]
    "11" -> "10" [dir=back tooltip="include"]
    "25" -> "5" [dir=back tooltip="include"]
    "31" -> "5" [dir=back tooltip="include"]
    "31" -> "30" [dir=back tooltip="include"]
    "37" -> "4" [dir=back tooltip="include"]
    "37" -> "5" [dir=back tooltip="include"]
    "37" -> "17" [dir=back tooltip="include"]
    "32" -> "33" [dir=back tooltip="include"]
    "32" -> "5" [dir=back tooltip="include"]
    "32" -> "11" [dir=back tooltip="include"]
    "32" -> "15" [dir=back tooltip="include"]
    "26" -> "11" [dir=back tooltip="include"]
    "26" -> "27" [dir=back tooltip="include"]
    "28" -> "6" [dir=back tooltip="include"]
    "28" -> "4" [dir=back tooltip="include"]
    "28" -> "10" [dir=back tooltip="include"]
    "28" -> "5" [dir=back tooltip="include"]
    "28" -> "19" [dir=back tooltip="include"]
    "28" -> "15" [dir=back tooltip="include"]
}

Defines

INVALID_PROCESS_ID
TYPEDEF_MODULE

Typedefs

typedef struct Module Module

Functions

GlobalContext *globalcontext_new()
void globalcontext_destroy(GlobalContext *glb)
Context *globalcontext_get_process_nolock(GlobalContext *glb, int32_t process_id)
Context *globalcontext_get_process_lock(GlobalContext *glb, int32_t process_id)
void globalcontext_get_process_unlock(GlobalContext *glb, Context *c)
bool globalcontext_process_exists(GlobalContext *glb, int32_t process_id)
void globalcontext_send_message(GlobalContext *glb, int32_t process_id, term t)
void globalcontext_send_message_nolock(GlobalContext *glb, int32_t process_id, term t)
void globalcontext_init_process(GlobalContext *glb, Context *ctx)
bool globalcontext_register_process(GlobalContext *glb, int atom_index, int local_process_id)
int globalcontext_get_registered_process(GlobalContext *glb, int atom_index)
bool globalcontext_unregister_process(GlobalContext *glb, int atom_index)
void globalcontext_maybe_unregister_process_id(GlobalContext *glb, int process_id)
int globalcontext_insert_atom(GlobalContext *glb, AtomString atom_string)
int globalcontext_insert_atom_maybe_copy(GlobalContext *glb, AtomString atom_string, int copy)
bool globalcontext_is_atom_index_equal_to_atom_string(GlobalContext *glb, int atom_index_a, AtomString atom_string_b)
static inline bool globalcontext_is_term_equal_to_atom_string(GlobalContext *global, term atom_a, AtomString atom_string_b)
static inline term globalcontext_make_atom(GlobalContext *glb, AtomString string)
AtomString globalcontext_atomstring_from_term(GlobalContext *glb, term t)
term globalcontext_existing_term_from_atom_string(GlobalContext *glb, AtomString atom_string)
int globalcontext_insert_module(GlobalContext *global, Module *module)
Module *globalcontext_get_module_by_index(GlobalContext *global, int index)
Module *globalcontext_get_module(GlobalContext *global, AtomString module_name_atom)
bool globalcontext_demonitor(GlobalContext *global, uint64_t ref_ticks)
static inline uint64_t globalcontext_get_ref_ticks(GlobalContext *global)
struct GlobalContext

Collaboration diagram for GlobalContext:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "5" [label="AtomsHashTable" tooltip="AtomsHashTable"]
    "10" [label="ExportedFunction" tooltip="ExportedFunction"]
    "1" [label="GlobalContext" tooltip="GlobalContext" fillcolor="#BFBFBF"]
    "6" [label="HNode" tooltip="HNode"]
    "2" [label="ListHead" tooltip="ListHead"]
    "11" [label="LiteralEntry" tooltip="LiteralEntry"]
    "8" [label="Module" tooltip="Module"]
    "9" [label="ModuleFilename" tooltip="ModuleFilename"]
    "3" [label="SpinLock" tooltip="SpinLock"]
    "4" [label="SyncList" tooltip="SyncList"]
    "12" [label="TimerList" tooltip="TimerList"]
    "7" [label="ValuesHashTable" tooltip="ValuesHashTable"]
    "5" -> "6" [dir=forward tooltip="usage"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "1" -> "3" [dir=forward tooltip="usage"]
    "1" -> "4" [dir=forward tooltip="usage"]
    "1" -> "5" [dir=forward tooltip="usage"]
    "1" -> "7" [dir=forward tooltip="usage"]
    "1" -> "8" [dir=forward tooltip="usage"]
    "1" -> "12" [dir=forward tooltip="usage"]
    "6" -> "6" [dir=forward tooltip="usage"]
    "2" -> "2" [dir=forward tooltip="usage"]
    "8" -> "1" [dir=forward tooltip="usage"]
    "8" -> "9" [dir=forward tooltip="usage"]
    "8" -> "2" [dir=forward tooltip="usage"]
    "8" -> "10" [dir=forward tooltip="usage"]
    "8" -> "11" [dir=forward tooltip="usage"]
    "4" -> "2" [dir=forward tooltip="usage"]
    "12" -> "2" [dir=forward tooltip="usage"]
    "7" -> "6" [dir=forward tooltip="usage"]
}

Public Members

struct ListHead ready_processes
struct ListHead running_processes
struct ListHead waiting_processes
SpinLock processes_spinlock
struct SyncList refc_binaries
struct SyncList processes_table
struct SyncList registered_processes
struct SyncList listeners
struct SyncList resource_types
struct SyncList select_events
int32_t last_process_id
struct AtomsHashTable *atoms_table
struct ValuesHashTable *atoms_ids_table
struct AtomsHashTable *modules_table
RWLock *modules_lock
Module **modules_by_index
int loaded_modules_count
struct SyncList avmpack_data
struct TimerList timer_list
SpinLock timer_spinlock
unsigned long long ref_ticks
SpinLock ref_ticks_spinlock
int ATOMIC online_schedulers
int running_schedulers
bool ATOMIC waiting_scheduler
Mutex *schedulers_mutex
CondVar *schedulers_cv
bool ATOMIC scheduler_stop_all
SpinLock env_spinlock
void *platform_data