1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 
5 #ifndef KV_CONF_H
6 #define KV_CONF_H
7 
8 /* The totally storage size for key-value store */
9 #ifndef KV_CONFIG_TOTAL_SIZE
10 #define KV_TOTAL_SIZE (8 * 1024)
11 #else
12 #define KV_TOTAL_SIZE KV_CONFIG_TOTAL_SIZE
13 #endif
14 
15 /* The physical parition for key-value store */
16 #ifndef KV_CONFIG_PARTITION
17 #if (CONFIG_U_FLASH_CORE > 0)
18 #define KV_PARTITION MTD_PART_ID_KV
19 #else
20 #define KV_PARTITION HAL_PARTITION_PARAMETER_2
21 #endif
22 #else
23 #define KV_PARTITION KV_CONFIG_PARTITION
24 #endif
25 
26 /* The number of bits in block size */
27 #ifndef KV_CONFIG_BLOCK_SIZE_BITS
28 /* Default is 4K bytes, should equal or larger than erase sector size */
29 #define KV_BLOCK_SIZE_BITS 12
30 #else
31 #define KV_BLOCK_SIZE_BITS KV_CONFIG_BLOCK_SIZE_BITS
32 #endif
33 
34 #ifndef KV_CONFIG_TASK_PRIORITY
35 #define KV_TASK_PRIORITY 32
36 #else
37 #define KV_TASK_PRIORITY KV_CONFIG_TASK_PRIORITY
38 #endif
39 
40 #ifndef KV_CONFIG_TASK_STACK_SIZE
41 #define KV_TASK_STACK_SIZE (4 * 1024)
42 #else
43 #define KV_TASK_STACK_SIZE KV_CONFIG_TASK_STACK_SIZE
44 #endif
45 
46 #ifndef KV_CONFIG_MAX_KEY_LEN
47 #define KV_MAX_KEY_LEN 128
48 #else
49 #define KV_MAX_KEY_LEN KV_CONFIG_MAX_KEY_LEN
50 #endif
51 
52 #ifndef KV_CONFIG_MAX_VAL_LEN
53 #define KV_MAX_VAL_LEN 512
54 #else
55 #define KV_MAX_VAL_LEN KV_CONFIG_MAX_VAL_LEN
56 #endif
57 
58 #ifndef KV_CONFIG_SECURE_SUPPORT
59 #define KV_SECURE_SUPPORT 0
60 #else
61 #define KV_SECURE_SUPPORT KV_CONFIG_SECURE_SUPPORT
62 #endif
63 
64 #if (KV_SECURE_SUPPORT > 0)
65 
66 #ifndef KV_CONFIG_SECURE_LEVEL
67 #define KV_SECURE_LEVEL 1
68 #else
69 #define KV_SECURE_LEVEL KV_CONFIG_SECURE_LEVEL
70 #endif
71 
72 #ifndef KV_CONFIG_SECURE_CRYPT_IMPL
73 #define KV_SECURE_CRYPT_IMPL 1
74 #else
75 #define KV_SECURE_CRYPT_IMPL KV_CONFIG_SECURE_CRYPT_IMPL
76 #endif
77 
78 #endif
79 
80 #endif  /* KV_CONF_H */
81 
82