1 /* 2 * Copyright (C) 2015-2017 Alibaba Group Holding Limited 3 */ 4 5 #ifndef K_DEFAULT_CONFIG_H 6 #define K_DEFAULT_CONFIG_H 7 8 #ifndef RHINO_CONFIG_USER_SPACE 9 #define RHINO_CONFIG_USER_SPACE 0 10 #endif 11 12 #ifndef RHINO_SCHED_NONE_PREEMPT 13 #define RHINO_SCHED_NONE_PREEMPT 0 14 #endif 15 16 #ifndef RHINO_CONFIG_STK_CHK_WORDS 17 #define RHINO_CONFIG_STK_CHK_WORDS 1 18 #endif 19 20 #ifndef RHINO_CONFIG_CPU_STACK_DOWN 21 #define RHINO_CONFIG_CPU_STACK_DOWN 1 22 #endif 23 24 /* kernel feature config */ 25 #ifndef RHINO_CONFIG_SEM 26 #define RHINO_CONFIG_SEM 1 27 #endif 28 29 #ifndef RHINO_CONFIG_TASK_SEM 30 #define RHINO_CONFIG_TASK_SEM 1 31 #endif 32 33 #ifndef RHINO_CONFIG_QUEUE 34 #define RHINO_CONFIG_QUEUE 1 35 #endif 36 37 #ifndef RHINO_CONFIG_BUF_QUEUE 38 #define RHINO_CONFIG_BUF_QUEUE 1 39 #endif 40 41 #ifndef RHINO_CONFIG_EVENT_FLAG 42 #define RHINO_CONFIG_EVENT_FLAG 1 43 #endif 44 45 #ifndef RHINO_CONFIG_TIMER 46 #define RHINO_CONFIG_TIMER 1 47 #endif 48 49 #if (RHINO_CONFIG_TIMER > 0) 50 51 #ifndef RHINO_CONFIG_TIMER_TASK_STACK_SIZE 52 #define RHINO_CONFIG_TIMER_TASK_STACK_SIZE 200 53 #endif 54 55 #ifndef RHINO_CONFIG_TIMER_TASK_PRI 56 #define RHINO_CONFIG_TIMER_TASK_PRI 5 57 #endif 58 59 #ifndef RHINO_CONFIG_TIMER_MSG_NUM 60 #define RHINO_CONFIG_TIMER_MSG_NUM 20 61 #endif 62 63 #endif /* RHINO_CONFIG_TIMER */ 64 65 #ifndef RHINO_CONFIG_WORKQUEUE 66 #define RHINO_CONFIG_WORKQUEUE 0 67 #endif 68 69 #ifndef RHINO_CONFIG_MUTEX_INHERIT 70 #define RHINO_CONFIG_MUTEX_INHERIT 0 71 #endif 72 73 #if (RHINO_CONFIG_WORKQUEUE > 0) 74 75 #ifndef RHINO_CONFIG_WORKQUEUE_STACK_SIZE 76 #define RHINO_CONFIG_WORKQUEUE_STACK_SIZE 512 77 #endif 78 79 #ifndef RHINO_CONFIG_WORKQUEUE_TASK_PRIO 80 #define RHINO_CONFIG_WORKQUEUE_TASK_PRIO 20 81 #endif 82 83 #endif /* RHINO_CONFIG_WORKQUEUE */ 84 85 /* kernel task config */ 86 #ifndef RHINO_CONFIG_TASK_INFO 87 #define RHINO_CONFIG_TASK_INFO 0 88 #endif 89 90 #ifndef RHINO_CONFIG_TASK_INFO_NUM 91 #define RHINO_CONFIG_TASK_INFO_NUM 2 92 #endif 93 94 #ifndef RHINO_CONFIG_TASK_DEL 95 #define RHINO_CONFIG_TASK_DEL 1 96 #endif 97 98 #ifndef RHINO_CONFIG_SCHED_RR 99 #define RHINO_CONFIG_SCHED_RR 1 100 #endif 101 102 #ifndef RHINO_CONFIG_SCHED_CFS 103 #define RHINO_CONFIG_SCHED_CFS 0 104 #endif 105 106 #if (RHINO_CONFIG_SCHED_RR > 0) 107 108 #ifndef RHINO_CONFIG_TIME_SLICE_DEFAULT 109 #define RHINO_CONFIG_TIME_SLICE_DEFAULT 50 110 #endif 111 112 #endif /* RHINO_CONFIG_SCHED_RR */ 113 114 #ifndef RHINO_CONFIG_PRI_MAX 115 #define RHINO_CONFIG_PRI_MAX 62 116 #endif 117 118 #ifndef RHINO_CONFIG_USER_PRI_MAX 119 #define RHINO_CONFIG_USER_PRI_MAX (RHINO_CONFIG_PRI_MAX - 2) 120 #endif 121 122 /* kernel timer&tick config */ 123 #ifndef RHINO_CONFIG_HW_COUNT 124 #define RHINO_CONFIG_HW_COUNT 0 125 #endif 126 127 #ifndef RHINO_CONFIG_TICKS_PER_SECOND 128 #define RHINO_CONFIG_TICKS_PER_SECOND 100 129 #endif 130 131 /* kernel intrpt config */ 132 /* kernel stack ovf check */ 133 #ifndef RHINO_CONFIG_INTRPT_STACK_OVF_CHECK 134 #define RHINO_CONFIG_INTRPT_STACK_OVF_CHECK 0 135 #endif 136 137 #if (RHINO_CONFIG_INTRPT_STACK_OVF_CHECK > 0) 138 139 #ifndef RHINO_CONFIG_INTRPT_STACK_TOP 140 #define RHINO_CONFIG_INTRPT_STACK_TOP 0 141 #endif 142 143 #endif /* RHINO_CONFIG_SCHED_RR */ 144 145 146 #ifndef RHINO_CONFIG_TASK_STACK_OVF_CHECK 147 #define RHINO_CONFIG_TASK_STACK_OVF_CHECK 0 148 #endif 149 150 /* kernel dyn alloc config */ 151 #ifndef RHINO_CONFIG_KOBJ_DYN_ALLOC 152 #define RHINO_CONFIG_KOBJ_DYN_ALLOC 1 153 #endif 154 155 #if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0) 156 157 #ifndef RHINO_CONFIG_K_DYN_TASK_STACK 158 #define RHINO_CONFIG_K_DYN_TASK_STACK 256 159 #endif 160 161 #ifndef RHINO_CONFIG_K_DYN_MEM_TASK_PRI 162 #define RHINO_CONFIG_K_DYN_MEM_TASK_PRI 6 163 #endif 164 165 #endif /* RHINO_CONFIG_KOBJ_DYN_ALLOC */ 166 167 /* kernel idle config */ 168 #ifndef RHINO_CONFIG_IDLE_TASK_STACK_SIZE 169 #define RHINO_CONFIG_IDLE_TASK_STACK_SIZE 100 170 #endif 171 172 /* kernel hook conf */ 173 #ifndef RHINO_CONFIG_USER_HOOK 174 #define RHINO_CONFIG_USER_HOOK 1 175 #endif 176 177 /* kernel stats config */ 178 #ifndef RHINO_CONFIG_KOBJ_LIST 179 #define RHINO_CONFIG_KOBJ_LIST 1 180 #endif 181 182 #ifndef RHINO_CONFIG_SYS_STATS 183 #define RHINO_CONFIG_SYS_STATS 0 184 #endif 185 186 #ifndef RHINO_CONFIG_CPU_NUM 187 #define RHINO_CONFIG_CPU_NUM 1 188 #endif 189 190 #ifndef RHINO_CONFIG_PWRMGMT 191 #define RHINO_CONFIG_PWRMGMT 0 192 #endif 193 194 #ifndef RHINO_CONFIG_CPU_USAGE_STATS 195 #define RHINO_CONFIG_CPU_USAGE_STATS 0 196 #endif 197 198 #ifndef RHINO_CONFIG_NEWLIBC_REENT 199 #define RHINO_CONFIG_NEWLIBC_REENT 1 200 #endif 201 202 #if (RHINO_CONFIG_SCHED_CFS >= 1) 203 #if (RHINO_CONFIG_PRI_MAX != 141) 204 #error "RHINO_CONFIG_SCHED_CFS priority set error" 205 #endif 206 #endif 207 208 #if ((RHINO_CONFIG_TIMER >= 1) && (RHINO_CONFIG_BUF_QUEUE == 0)) 209 #error "RHINO_CONFIG_BUF_QUEUE should be 1 when RHINO_CONFIG_TIMER is enabled." 210 #endif 211 212 #if (RHINO_CONFIG_PRI_MAX >= 256) 213 #error "RHINO_CONFIG_PRI_MAX must be <= 255." 214 #endif 215 216 #if ((RHINO_CONFIG_SEM == 0) && (RHINO_CONFIG_TASK_SEM >= 1)) 217 #error "you need enable RHINO_CONFIG_SEM as well." 218 #endif 219 220 #if ((RHINO_CONFIG_HW_COUNT == 0) && (RHINO_CONFIG_SYS_STATS >= 1)) 221 #error "you need enable RHINO_CONFIG_HW_COUNT as well." 222 #endif 223 224 #endif /* K_DEFAULT_CONFIG_H */ 225 226