1 /*
2  * Copyright (C) 2015-2021 Alibaba Group Holding Limited
3  */
4 
5 #ifndef K_CONFIG_H
6 #define K_CONFIG_H
7 
8 /* kernel feature conf */
9 #ifndef RHINO_CONFIG_SEM
10 #define RHINO_CONFIG_SEM                     1
11 #endif
12 #ifndef RHINO_CONFIG_QUEUE
13 #define RHINO_CONFIG_QUEUE                   1
14 #endif
15 #ifndef RHINO_CONFIG_TASK_SEM
16 #define RHINO_CONFIG_TASK_SEM                1
17 #endif
18 #ifndef RHINO_CONFIG_EVENT_FLAG
19 #define RHINO_CONFIG_EVENT_FLAG              1
20 #endif
21 #ifndef RHINO_CONFIG_TIMER
22 #define RHINO_CONFIG_TIMER                   1
23 #endif
24 #ifndef RHINO_CONFIG_BUF_QUEUE
25 #define RHINO_CONFIG_BUF_QUEUE               1
26 #endif
27 #ifndef RHINO_CONFIG_MM_BLK
28 #define RHINO_CONFIG_MM_BLK                  1
29 #endif
30 #ifndef RHINO_CONFIG_MM_DEBUG
31 #define RHINO_CONFIG_MM_DEBUG                0
32 #endif
33 #ifndef RHINO_CONFIG_MM_TLF
34 #define RHINO_CONFIG_MM_TLF                  1
35 #endif
36 #ifndef RHINO_CONFIG_MM_BLK_SIZE
37 #define RHINO_CONFIG_MM_BLK_SIZE             256
38 #endif
39 #ifndef RHINO_CONFIG_MM_MAXMSIZEBIT
40 #define RHINO_CONFIG_MM_MAXMSIZEBIT          28
41 #endif
42 #ifndef RHINO_CONFIG_MM_TLF_BLK_SIZE
43 #define RHINO_CONFIG_MM_TLF_BLK_SIZE         1024
44 #endif
45 #ifndef RHINO_CONFIG_MM_TRACE_LVL
46 #define RHINO_CONFIG_MM_TRACE_LVL            4//8
47 #endif
48 
49 /* kernel task conf */
50 #ifndef RHINO_CONFIG_TASK_INFO
51 #define RHINO_CONFIG_TASK_INFO               1
52 #endif
53 #ifndef RHINO_CONFIG_TASK_DEL
54 #define RHINO_CONFIG_TASK_DEL                1
55 #endif
56 
57 #ifndef RHINO_CONFIG_TASK_STACK_OVF_CHECK
58 #define RHINO_CONFIG_TASK_STACK_OVF_CHECK    1
59 #endif
60 #ifndef RHINO_CONFIG_SCHED_RR
61 #define RHINO_CONFIG_SCHED_RR                1
62 #endif
63 #ifndef RHINO_CONFIG_TIME_SLICE_DEFAULT
64 #define RHINO_CONFIG_TIME_SLICE_DEFAULT      50
65 #endif
66 #ifndef RHINO_CONFIG_PRI_MAX
67 #define RHINO_CONFIG_PRI_MAX                 62
68 #endif
69 #ifndef RHINO_CONFIG_USER_PRI_MAX
70 #define RHINO_CONFIG_USER_PRI_MAX            (RHINO_CONFIG_PRI_MAX - 2)
71 #endif
72 
73 /* kernel workqueue conf */
74 #ifndef RHINO_CONFIG_WORKQUEUE
75 #define RHINO_CONFIG_WORKQUEUE               1
76 #endif
77 #ifndef RHINO_CONFIG_WORKQUEUE_STACK_SIZE
78 #define RHINO_CONFIG_WORKQUEUE_STACK_SIZE    512
79 #endif
80 
81 /* kernel mm_region conf */
82 #ifndef RHINO_CONFIG_MM_REGION_MUTEX
83 #define RHINO_CONFIG_MM_REGION_MUTEX         1
84 #endif
85 
86 /* kernel timer&tick conf */
87 #ifndef RHINO_CONFIG_HW_COUNT
88 #define RHINO_CONFIG_HW_COUNT                0
89 #endif
90 
91 #ifndef RHINO_CONFIG_TICKS_PER_SECOND
92 #define RHINO_CONFIG_TICKS_PER_SECOND        100
93 #endif
94 
95 /*must reserve enough stack size for timer cb will consume*/
96 #ifndef RHINO_CONFIG_TIMER_TASK_STACK_SIZE
97 #define RHINO_CONFIG_TIMER_TASK_STACK_SIZE   512
98 #endif
99 #ifndef RHINO_CONFIG_TIMER_TASK_PRI
100 #define RHINO_CONFIG_TIMER_TASK_PRI          5
101 #endif
102 
103 /* kernel dyn alloc conf */
104 #ifndef RHINO_CONFIG_KOBJ_DYN_ALLOC
105 #define RHINO_CONFIG_KOBJ_DYN_ALLOC          1
106 #endif
107 
108 #if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0)
109 #ifndef RHINO_CONFIG_K_DYN_TASK_STACK
110 #define RHINO_CONFIG_K_DYN_TASK_STACK        512
111 #endif
112 #ifndef RHINO_CONFIG_K_DYN_MEM_TASK_PRI
113 #define RHINO_CONFIG_K_DYN_MEM_TASK_PRI      6
114 #endif
115 #endif
116 
117 /* kernel idle conf */
118 #ifndef RHINO_CONFIG_IDLE_TASK_STACK_SIZE
119 #define RHINO_CONFIG_IDLE_TASK_STACK_SIZE    512
120 #endif
121 
122 /* kernel hook conf */
123 #ifndef RHINO_CONFIG_USER_HOOK
124 #define RHINO_CONFIG_USER_HOOK               0
125 #endif
126 
127 #ifndef RHINO_CONFIG_CPU_NUM
128 #define RHINO_CONFIG_CPU_NUM                 1
129 #endif
130 
131 #ifndef RHINO_CONFIG_SYSTEM_STACK_SIZE
132 #define RHINO_CONFIG_SYSTEM_STACK_SIZE       0x180
133 #endif
134 
135 /*task user info index start*/
136 #ifndef RHINO_CONFIG_TASK_INFO_NUM
137 #define RHINO_CONFIG_TASK_INFO_NUM           5
138 #endif
139 
140 #ifndef PTHREAD_CONFIG_USER_INFO_POS
141 #define PTHREAD_CONFIG_USER_INFO_POS         0
142 #endif
143 
144 #ifndef RHINO_TASK_HOOK_USER_INFO_POS
145 #define RHINO_TASK_HOOK_USER_INFO_POS        1
146 #endif
147 
148 #ifndef RHINO_CLI_CONSOLE_USER_INFO_POS
149 #define RHINO_CLI_CONSOLE_USER_INFO_POS      2
150 #endif
151 
152 #ifndef RHINO_ERRNO_USER_INFO_POS
153 #define RHINO_ERRNO_USER_INFO_POS            3
154 #endif
155 /*task user info index end*/
156 
157 #endif /* K_CONFIG_H */
158 
159