config.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef _CONFIG_H_
  17. /* Memory allocator ems */
  18. #define MEM_ALLOCATOR_EMS 0
  19. /* Memory allocator tlsf */
  20. #define MEM_ALLOCATOR_TLSF 1
  21. /* Default memory allocator */
  22. #define DEFAULT_MEM_ALLOCATOR MEM_ALLOCATOR_EMS
  23. /* Beihai log system */
  24. #define BEIHAI_ENABLE_LOG 1
  25. /* Beihai debugger support */
  26. #define BEIHAI_ENABLE_TOOL_AGENT 1
  27. /* Beihai debug monitoring server, must define
  28. BEIHAI_ENABLE_TOOL_AGENT firstly */
  29. #define BEIHAI_ENABLE_TOOL_AGENT_BDMS 1
  30. /* enable no signature on sdv since verify doesn't work as lacking public key */
  31. #ifdef CONFIG_SDV
  32. #define BEIHAI_ENABLE_NO_SIGNATURE 1
  33. #else
  34. #define BEIHAI_ENABLE_NO_SIGNATURE 0
  35. #endif
  36. /* WASM VM log system */
  37. #ifndef WASM_ENABLE_LOG
  38. #define WASM_ENABLE_LOG 1
  39. #endif
  40. /* WASM Interpreter labels-as-values feature */
  41. #define WASM_ENABLE_LABELS_AS_VALUES 1
  42. /* WASM Branch Block address hashmap */
  43. #define WASM_ENABLE_HASH_BLOCK_ADDR 0
  44. /* Heap and stack profiling */
  45. #define BEIHAI_ENABLE_MEMORY_PROFILING 0
  46. /* Max app number of all modules */
  47. #define MAX_APP_INSTALLATIONS 3
  48. /* Default timer number in one app */
  49. #define DEFAULT_TIMERS_PER_APP 20
  50. /* Max timer number in one app */
  51. #define MAX_TIMERS_PER_APP 30
  52. /* Max connection number in one app */
  53. #define MAX_CONNECTION_PER_APP 20
  54. /* Max resource registration number in one app */
  55. #define RESOURCE_REGISTRATION_NUM_MAX 16
  56. /* Max length of resource/event url */
  57. #define RESOUCE_EVENT_URL_LEN_MAX 256
  58. /* Default length of queue */
  59. #define DEFAULT_QUEUE_LENGTH 50
  60. /* Default watchdog interval in ms */
  61. #define DEFAULT_WATCHDOG_INTERVAL (3 * 60 * 1000)
  62. /* Workflow heap size */
  63. /*
  64. #define WORKING_FLOW_HEAP_SIZE 0
  65. */
  66. /* Support memory.grow opcode and enlargeMemory function */
  67. #define WASM_ENABLE_MEMORY_GROW 1
  68. /* The max percentage of global heap that app memory space can grow */
  69. #define APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT 1 / 3
  70. /* Default base offset of app heap space */
  71. #define DEFAULT_APP_HEAP_BASE_OFFSET (1 * BH_GB)
  72. /* Default min/max heap size of each app */
  73. #define APP_HEAP_SIZE_DEFAULT (8 * 1024)
  74. #define APP_HEAP_SIZE_MIN (2 * 1024)
  75. #define APP_HEAP_SIZE_MAX (1024 * 1024)
  76. /* Default wasm stack size of each app */
  77. #ifdef __x86_64__
  78. #define DEFAULT_WASM_STACK_SIZE (12 * 1024)
  79. #else
  80. #define DEFAULT_WASM_STACK_SIZE (8 * 1024)
  81. #endif
  82. /* Default/min/max stack size of each app thread */
  83. #ifndef __ZEPHYR__
  84. #define APP_THREAD_STACK_SIZE_DEFAULT (20 * 1024)
  85. #define APP_THREAD_STACK_SIZE_MIN (16 * 1024)
  86. #define APP_THREAD_STACK_SIZE_MAX (256 * 1024)
  87. #else
  88. #define APP_THREAD_STACK_SIZE_DEFAULT (4 * 1024)
  89. #define APP_THREAD_STACK_SIZE_MIN (2 * 1024)
  90. #define APP_THREAD_STACK_SIZE_MAX (256 * 1024)
  91. #endif
  92. #endif
  93. /* External memory space provided by user,
  94. but not wasm memory space and app heap space */
  95. #ifndef WASM_ENABLE_EXT_MEMORY_SPACE
  96. #define WASM_ENABLE_EXT_MEMORY_SPACE 0
  97. #endif
  98. /* Default base offset of external memory space */
  99. #define DEFAULT_EXT_MEM_BASE_OFFSET (-2 * BH_GB)
  100. #ifndef bh_printf
  101. #define bh_printf printf
  102. #endif