Faasm
stable

Topics

  • HTTP API
  • C++ support
  • Writing functions
  • Debugging
  • Faasm Development
  • Getting started
  • Host interface
  • Kubernetes integration
  • Troubleshooting
  • K8s Cluster set-up
  • LLVM use in Faasm
  • MPI support
  • Network isolation
  • Profiling
  • Proto-faaslets
  • Python
  • Releases
  • Building containers locally
  • Github config
  • SGX support
  • Shared files
  • State
  • Threading

Code

  • Namespace list
  • Class list
Faasm
  • »
  • File wavm/dynlink.cpp
  • Edit on GitHub

File wavm/dynlink.cpp

Defines

FFI_TYPE_CASE(nativeType)
namespace wasm

SYSCALL NUMBERING

Have a look in the sysroot at include/bits/syscall.h to determine the system call numbering.

Enums

enum libffi_type_value

Values:

enumerator VOID
enumerator INT
enumerator FLOAT
enumerator DOUBLE
enumerator LONGDOUBLE
enumerator UINT8
enumerator SINT8
enumerator UINT16
enumerator SINT16
enumerator UINT32
enumerator SINT32
enumerator UINT64
enumerator SINT64
enumerator STRUCT
enumerator POINTER
enumerator COMPLEX

Functions

void dynlinkLink()
WAVM_DEFINE_INTRINSIC_FUNCTION (env, "dlopen", I32, dlopen, I32 fileNamePtr, I32 flags)

WebAssembly official docs on dynamic linking: https://webassembly.org/docs/dynamic-linking/

Tool conventions: https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md

WAVM_DEFINE_INTRINSIC_FUNCTION (env, "dlsym", I32, dlsym, I32 handle, I32 symbolPtr)
WAVM_DEFINE_INTRINSIC_FUNCTION (env, "dlerror", I32, dlerror)
WAVM_DEFINE_INTRINSIC_FUNCTION (env, "dlclose", I32, dlclose, I32 handle)
WAVM_DEFINE_INTRINSIC_FUNCTION (env, "ffi_call", void, ffi_call, I32 cifPtr, I32 fnPtr, I32 retPtr, I32 argsPtrPtr)

The implementation of ffi_call is language-specific. The signature is:

void ffi_call(ffi_cif *cif, void (*fn)(void), void *ret, void **args);

  • cif = function definition

  • fn = function pointer

  • ret = return value address

  • args = arguments

WAVM_DEFINE_INTRINSIC_FUNCTION (env, "ffi_prep_closure_loc", I32, ffi_prep_closure_loc, I32 a, I32 b, I32 c, I32 d, I32 e)
struct libffi_cif

Public Members

uint32_t abi
uint32_t nargs
uint32_t argTypesPtrPtr
uint32_t retTypePtr
uint32_t bytes
uint32_t flags
struct libffi_type

Public Members

uint32_t size
uint16_t alignment
uint16_t type
uint32_t elementsPtrPtr

© Copyright 2022, Simon Shillaker. Revision 819fb1d4.

Built with Sphinx using a theme provided by Read the Docs.