port.c

Include dependency graph for port.c:

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

Functions

void port_send_message(GlobalContext *glb, term pid, term msg)

Send a message to a given pid. This function must be called from a driver’s native handler.

Parameters:
  • glb – the global context

  • pid – the pid of the process to send a message to.

  • msg – the message to send.

void port_send_message_nolock(GlobalContext *glb, term pid, term msg)

Send a message to a given pid. This function must be called from a driver’s native handler after a target context has been locked.

Parameters:
  • glb – the global context

  • pid – the pid of the process to send a message to.

  • msg – the message to send.

void port_send_message_from_task(GlobalContext *glb, term pid, term msg)

Send a message to a given pid. This function can be called from a driver’s task, such as an event callback.

Parameters:
  • glb – the global context

  • pid – the pid of the process to send a message to.

  • msg – the message to send.

void port_ensure_available(Context *ctx, size_t size)
term port_heap_create_tuple2(Heap *heap, term a, term b)
term port_heap_create_tuple3(Heap *heap, term a, term b, term c)
term port_heap_create_tuple_n(Heap *heap, size_t num_terms, term *terms)
term port_heap_create_error_tuple(Heap *heap, term reason)
term port_heap_create_sys_error_tuple(Heap *heap, term syscall, int errno)
term port_heap_create_ok_tuple(Heap *heap, term t)
term port_heap_create_reply(Heap *heap, term ref, term payload)
enum GenMessageParseResult port_parse_gen_message(term msg, GenMessage *gen_message)