1 /*
2  * Copyright (C) 2015-2017 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 
28 /* kernel task conf */
29 #ifndef RHINO_CONFIG_TASK_INFO
30 #define RHINO_CONFIG_TASK_INFO 1
31 #endif
32 #ifndef RHINO_CONFIG_TASK_DEL
33 #define RHINO_CONFIG_TASK_DEL 1
34 #endif
35 
36 #ifndef RHINO_CONFIG_TASK_STACK_OVF_CHECK
37 #define RHINO_CONFIG_TASK_STACK_OVF_CHECK 1
38 #endif
39 #ifndef RHINO_CONFIG_SCHED_RR
40 #define RHINO_CONFIG_SCHED_RR 1
41 #endif
42 #ifndef RHINO_CONFIG_TIME_SLICE_DEFAULT
43 #define RHINO_CONFIG_TIME_SLICE_DEFAULT 50
44 #endif
45 #ifndef RHINO_CONFIG_PRI_MAX
46 #define RHINO_CONFIG_PRI_MAX 62
47 #endif
48 #ifndef RHINO_CONFIG_USER_PRI_MAX
49 #define RHINO_CONFIG_USER_PRI_MAX (RHINO_CONFIG_PRI_MAX - 2)
50 #endif
51 
52 /* kernel workqueue conf */
53 // #ifndef RHINO_CONFIG_WORKQUEUE
54 #define RHINO_CONFIG_WORKQUEUE 1
55 // #endif
56 #ifndef RHINO_CONFIG_WORKQUEUE_STACK_SIZE
57 #define RHINO_CONFIG_WORKQUEUE_STACK_SIZE 768
58 #endif
59 
60 /* kernel timer&tick conf */
61 #ifndef RHINO_CONFIG_TICKS_PER_SECOND
62 #define RHINO_CONFIG_TICKS_PER_SECOND 1000
63 #endif
64 
65 /* must reserve enough stack size for timer cb will consume */
66 #ifndef RHINO_CONFIG_TIMER_TASK_STACK_SIZE
67 #define RHINO_CONFIG_TIMER_TASK_STACK_SIZE 2048
68 #endif
69 #ifndef RHINO_CONFIG_TIMER_TASK_PRI
70 #define RHINO_CONFIG_TIMER_TASK_PRI 5
71 #endif
72 
73 /* kernel intrpt conf */
74 #ifndef RHINO_CONFIG_INTRPT_STACK_OVF_CHECK
75 #define RHINO_CONFIG_INTRPT_STACK_OVF_CHECK 0
76 #endif
77 
78 /* kernel dyn alloc conf */
79 #ifndef RHINO_CONFIG_KOBJ_DYN_ALLOC
80 #define RHINO_CONFIG_KOBJ_DYN_ALLOC 1
81 #endif
82 
83 #if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0)
84 #ifndef RHINO_CONFIG_K_DYN_TASK_STACK
85 #define RHINO_CONFIG_K_DYN_TASK_STACK 256
86 #endif
87 #ifndef RHINO_CONFIG_K_DYN_MEM_TASK_PRI
88 #define RHINO_CONFIG_K_DYN_MEM_TASK_PRI 6
89 #endif
90 #endif
91 
92 /* kernel idle conf */
93 #ifndef RHINO_CONFIG_IDLE_TASK_STACK_SIZE
94 #define RHINO_CONFIG_IDLE_TASK_STACK_SIZE 1024
95 #endif
96 
97 /* kernel hook conf */
98 #ifndef RHINO_CONFIG_USER_HOOK
99 #define RHINO_CONFIG_USER_HOOK 1
100 #endif
101 
102 #ifndef RHINO_CONFIG_CPU_NUM
103 #define RHINO_CONFIG_CPU_NUM 1
104 #endif
105 
106 /* task user info index start */
107 #ifndef RHINO_CONFIG_TASK_INFO_NUM
108 #define RHINO_CONFIG_TASK_INFO_NUM 5
109 #endif
110 
111 #ifndef PTHREAD_CONFIG_USER_INFO_POS
112 #define PTHREAD_CONFIG_USER_INFO_POS 0
113 #endif
114 
115 #ifndef RHINO_TASK_HOOK_USER_INFO_POS
116 #define RHINO_TASK_HOOK_USER_INFO_POS 1
117 #endif
118 
119 #ifndef RHINO_CLI_CONSOLE_USER_INFO_POS
120 #define RHINO_CLI_CONSOLE_USER_INFO_POS 2
121 #endif
122 
123 #ifndef RHINO_ERRNO_USER_INFO_POS
124 #define RHINO_ERRNO_USER_INFO_POS 3
125 #endif
126 /* task user info index end */
127 
128 #ifndef RHINO_CONFIG_SYS_STATS
129 #define RHINO_CONFIG_SYS_STATS 1
130 #endif
131 
132 #ifndef RHINO_CONFIG_HW_COUNT
133 #define RHINO_CONFIG_HW_COUNT 1
134 #endif
135 
136 #ifndef RHINO_CONFIG_MM_TRACE_LVL
137 #define RHINO_CONFIG_MM_TRACE_LVL 0
138 #endif
139 
140 #ifndef RHINO_CONFIG_CLI_AS_NMI
141 #define RHINO_CONFIG_CLI_AS_NMI 0
142 #endif
143 
144 #if (RHINO_CONFIG_CLI_AS_NMI > 0)
145 #ifndef RHINO_CONFIG_NMI_OFFSET
146 #define RHINO_CONFIG_NMI_OFFSET 40
147 #endif
148 #endif
149 
150 #endif /* K_CONFIG_H */
151