port.h

Include dependency graph for port.h:

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

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

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c"]
    "7" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h" fillcolor="#BFBFBF"]
    "6" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c"]
    "4" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c"]
    "3" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c"]
    "5" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "5" [dir=back tooltip="include"]
    "1" -> "6" [dir=back tooltip="include"]
    "1" -> "7" [dir=back tooltip="include"]
}

Enums

enum GenMessageParseResult

Values:

enumerator GenCallMessage
enumerator GenMessageParseError

Functions

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 err)
term port_heap_create_ok_tuple(Heap *heap, term t)
term port_heap_create_reply(Heap *heap, term ref, term payload)
static inline term port_create_tuple2(Context *ctx, term a, term b)
static inline term port_create_tuple3(Context *ctx, term a, term b, term c)
static inline term port_create_tuple_n(Context *ctx, size_t num_terms, term *terms)
static inline term port_create_error_tuple(Context *ctx, term reason)
static inline term port_create_sys_error_tuple(Context *ctx, term syscall, int err)
static inline term port_create_ok_tuple(Context *ctx, term t)
static inline term port_create_reply(Context *ctx, term ref, term payload)
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_ensure_available(Context *ctx, size_t size)
static inline void port_send_reply(Context *ctx, term pid, term ref, term payload)
enum GenMessageParseResult port_parse_gen_message(term msg, GenMessage *gen_message)
struct GenMessage
#include <port.h>

Public Members

term req
term pid
term ref