native_interface.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _NATIVE_INTERFACE_H_
  6. #define _NATIVE_INTERFACE_H_
  7. /* Note: the bh_plaform.h is the only head file separately
  8. implemented by both [app] and [native] worlds */
  9. #include "bh_platform.h"
  10. #include "wasm_export.h"
  11. #define get_module_inst(exec_env) \
  12. wasm_runtime_get_module_inst(exec_env)
  13. #define validate_app_addr(offset, size) \
  14. wasm_runtime_validate_app_addr(module_inst, offset, size)
  15. #define validate_app_str_addr(offset) \
  16. wasm_runtime_validate_app_str_addr(module_inst, offset)
  17. #define addr_app_to_native(offset) \
  18. wasm_runtime_addr_app_to_native(module_inst, offset)
  19. #define addr_native_to_app(ptr) \
  20. wasm_runtime_addr_native_to_app(module_inst, ptr)
  21. #define module_malloc(size, p_native_addr) \
  22. wasm_runtime_module_malloc(module_inst, size, p_native_addr)
  23. #define module_free(offset) \
  24. wasm_runtime_module_free(module_inst, offset)
  25. /*char *wa_strdup(const char *);*/
  26. #endif /* end of _NATIVE_INTERFACE_H */