config.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. #define WASM_ENABLE_LOG 1
  38. /* WASM Interpreter labels-as-values feature */
  39. #define WASM_ENABLE_LABELS_AS_VALUES 1
  40. /* WASM Branch Block address hashmap */
  41. #define WASM_ENABLE_HASH_BLOCK_ADDR 0
  42. /* Heap and stack profiling */
  43. #define BEIHAI_ENABLE_MEMORY_PROFILING 0
  44. /* Max app number of all modules */
  45. #define MAX_APP_INSTALLATIONS 3
  46. /* Default timer number in one app */
  47. #define DEFAULT_TIMERS_PER_APP 20
  48. /* Max timer number in one app */
  49. #define MAX_TIMERS_PER_APP 30
  50. /* Max connection number in one app */
  51. #define MAX_CONNECTION_PER_APP 20
  52. /* Max resource registration number in one app */
  53. #define RESOURCE_REGISTRATION_NUM_MAX 16
  54. /* Max length of resource/event url */
  55. #define RESOUCE_EVENT_URL_LEN_MAX 256
  56. /* Default length of queue */
  57. #define DEFAULT_QUEUE_LENGTH 50
  58. /* Default watchdog interval in ms */
  59. #define DEFAULT_WATCHDOG_INTERVAL (3 * 60 * 1000)
  60. /* Workflow heap size */
  61. /*
  62. #define WORKING_FLOW_HEAP_SIZE 0
  63. */
  64. /* Support memory.grow opcode and enlargeMemory function */
  65. #define WASM_ENABLE_MEMORY_GROW 1
  66. /* The max percentage of global heap that app memory space can grow */
  67. #define APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT 1 / 3
  68. /* Default base offset of app heap space */
  69. #define DEFAULT_APP_HEAP_BASE_OFFSET (1 * BH_GB)
  70. /* Default min/max heap size of each app */
  71. #define APP_HEAP_SIZE_DEFAULT (8 * 1024)
  72. #define APP_HEAP_SIZE_MIN (2 * 1024)
  73. #define APP_HEAP_SIZE_MAX (1024 * 1024)
  74. /* Default wasm stack size of each app */
  75. #ifdef __x86_64__
  76. #define DEFAULT_WASM_STACK_SIZE (12 * 1024)
  77. #else
  78. #define DEFAULT_WASM_STACK_SIZE (8 * 1024)
  79. #endif
  80. /* Default/min/max stack size of each app thread */
  81. #ifndef __ZEPHYR__
  82. #define APP_THREAD_STACK_SIZE_DEFAULT (20 * 1024)
  83. #define APP_THREAD_STACK_SIZE_MIN (16 * 1024)
  84. #define APP_THREAD_STACK_SIZE_MAX (256 * 1024)
  85. #else
  86. #define APP_THREAD_STACK_SIZE_DEFAULT (4 * 1024)
  87. #define APP_THREAD_STACK_SIZE_MIN (2 * 1024)
  88. #define APP_THREAD_STACK_SIZE_MAX (256 * 1024)
  89. #endif
  90. #endif