[439] | 1 | /* |
---|
| 2 | * kernel_config.h - global kernel configuration arguments |
---|
| 3 | * |
---|
[667] | 4 | * Authors Alain Greiner (2016,2017,2018,2019,2020) |
---|
[439] | 5 | * |
---|
| 6 | * Copyright (c) UPMC Sorbonne Universites |
---|
| 7 | * |
---|
| 8 | * This file is part of ALMOS-MKH. |
---|
| 9 | * |
---|
| 10 | * ALMOS-MKH is free software; you can redistribute it and/or modify it |
---|
| 11 | * under the terms of the GNU General Public License as published by |
---|
| 12 | * the Free Software Foundation; version 2.0 of the License. |
---|
| 13 | * |
---|
| 14 | * ALMOS-MKH is distributed in the hope that it will be useful, but |
---|
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 17 | * General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with ALMOS-MKH; if not, write to the Free Software Foundation, |
---|
| 21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 22 | */ |
---|
| 23 | |
---|
[569] | 24 | #ifndef _KERNEL_CONFIG_H_ |
---|
| 25 | #define _KERNEL_CONFIG_H_ |
---|
[439] | 26 | |
---|
[683] | 27 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
[439] | 28 | // KERNEL DEBUG |
---|
[683] | 29 | // |
---|
| 30 | // 1) All errors detected by the kernel caused by a system call are reported to the |
---|
| 31 | // user process using the ERRNO mechanism. Moreover, the DEBUG_***_ERROR variables |
---|
| 32 | // force the compiler to display on TXT0 the error messages generated by |
---|
| 33 | // the low-level kernel function, to help the error cause analysis. |
---|
| 34 | // |
---|
| 35 | // 2) The other debug variable forece the compiler to display on TXT0 a trace for one |
---|
| 36 | // specific kernel function, or one small group of functions. |
---|
| 37 | // All these trace variables (but locks, kmem, kcm) respect the following rules: |
---|
| 38 | // - the trace is generated if the debug variable is non zeo. |
---|
| 39 | // - trace is generated only when cycle > debug_value. |
---|
| 40 | // - detailed trace is enabled when (debug_value & 0x1) is non zero. |
---|
| 41 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
[439] | 42 | |
---|
[683] | 43 | // error reporting variables |
---|
| 44 | |
---|
| 45 | #define DEBUG_DEV_NIC_ERROR 1 |
---|
| 46 | #define DEBUG_KCM_ERROR 1 |
---|
| 47 | #define DEBUG_KMEM_ERROR 1 |
---|
| 48 | #define DEBUG_MAPPER_ERROR 1 |
---|
| 49 | #define DEBUG_PPM_ERROR 1 |
---|
| 50 | #define DEBUG_PROCESS_ERROR 1 |
---|
| 51 | #define DEBUG_SOCKET_ERROR 1 |
---|
| 52 | #define DEBUG_SYSCALLS_ERROR 1 |
---|
| 53 | #define DEBUG_THREAD_ERROR 1 |
---|
| 54 | #define DEBUG_USER_DIR_ERROR 1 |
---|
| 55 | #define DEBUG_VFS_ERROR 1 |
---|
| 56 | #define DEBUG_VMM_ERROR 1 |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | // trace activation variables |
---|
| 60 | |
---|
[620] | 61 | #define DEBUG_BARRIER_CREATE 0 |
---|
| 62 | #define DEBUG_BARRIER_DESTROY 0 |
---|
[619] | 63 | #define DEBUG_BARRIER_WAIT 0 |
---|
[581] | 64 | |
---|
[683] | 65 | #define DEBUG_BUSYLOCK_TYPE 0 // type 0 undefined => no debug |
---|
| 66 | #define DEBUG_BUSYLOCK_PID 0 // owner process PID |
---|
| 67 | #define DEBUG_BUSYLOCK_TRDID 0 // owner thread TRDID |
---|
[569] | 68 | |
---|
[607] | 69 | #define DEBUG_CHDEV_CMD_RX 0 |
---|
| 70 | #define DEBUG_CHDEV_CMD_TX 0 |
---|
| 71 | #define DEBUG_CHDEV_SERVER_RX 0 |
---|
| 72 | #define DEBUG_CHDEV_SERVER_TX 0 |
---|
[439] | 73 | |
---|
[607] | 74 | #define DEBUG_CLUSTER_INIT 0 |
---|
| 75 | #define DEBUG_CLUSTER_PID_ALLOC 0 |
---|
| 76 | #define DEBUG_CLUSTER_PID_RELEASE 0 |
---|
| 77 | #define DEBUG_CLUSTER_PROCESS_COPIES 0 |
---|
[439] | 78 | |
---|
[607] | 79 | #define DEBUG_DEV_TXT_RX 0 |
---|
| 80 | #define DEBUG_DEV_TXT_TX 0 |
---|
| 81 | #define DEBUG_DEV_IOC_RX 0 |
---|
| 82 | #define DEBUG_DEV_IOC_TX 0 |
---|
| 83 | #define DEBUG_DEV_NIC_RX 0 |
---|
[667] | 84 | #define DEBUG_DEV_NIC_TX 0 |
---|
[651] | 85 | #define DEBUG_DEV_FBF 0 |
---|
[607] | 86 | #define DEBUG_DEV_DMA 0 |
---|
| 87 | #define DEBUG_DEV_MMC 0 |
---|
| 88 | #define DEBUG_DEV_PIC 0 |
---|
[439] | 89 | |
---|
[657] | 90 | #define DEBUG_DEVFS_GLOBAL_INIT 0 |
---|
[634] | 91 | #define DEBUG_DEVFS_LOCAL_INIT 0 |
---|
[607] | 92 | #define DEBUG_DEVFS_MOVE 0 |
---|
[439] | 93 | |
---|
[607] | 94 | #define DEBUG_ELF_LOAD 0 |
---|
[582] | 95 | |
---|
[637] | 96 | #define DEBUG_DQDT_GET_ROOT 0 |
---|
[607] | 97 | #define DEBUG_DQDT_INIT 0 |
---|
[637] | 98 | #define DEBUG_DQDT_SELECT_FOR_THREAD 0 |
---|
| 99 | #define DEBUG_DQDT_SELECT_FOR_MEMORY 0 |
---|
| 100 | #define DEBUG_DQDT_UPDATE_PAGES 0 |
---|
[607] | 101 | #define DEBUG_DQDT_UPDATE_THREADS 0 |
---|
[439] | 102 | |
---|
[607] | 103 | #define DEBUG_FATFS_ADD_DENTRY 0 |
---|
| 104 | #define DEBUG_FATFS_CLUSTER_ALLOC 0 |
---|
| 105 | #define DEBUG_FATFS_CTX_INIT 0 |
---|
| 106 | #define DEBUG_FATFS_FREE_CLUSTERS 0 |
---|
| 107 | #define DEBUG_FATFS_GET_CLUSTER 0 |
---|
[614] | 108 | #define DEBUG_FATFS_GET_USER_DIR 0 |
---|
[607] | 109 | #define DEBUG_FATFS_MOVE_PAGE 0 |
---|
[623] | 110 | #define DEBUG_FATFS_NEW_DENTRY 0 |
---|
[624] | 111 | #define DEBUG_FATFS_RELEASE_INODE 0 |
---|
[610] | 112 | #define DEBUG_FATFS_REMOVE_DENTRY 0 |
---|
[656] | 113 | #define DEBUG_FATFS_SCAN_DIRECTORY 0 |
---|
[607] | 114 | #define DEBUG_FATFS_SYNC_FAT 0 |
---|
| 115 | #define DEBUG_FATFS_SYNC_FSINFO 0 |
---|
| 116 | #define DEBUG_FATFS_SYNC_INODE 0 |
---|
[623] | 117 | #define DEBUG_FATFS_UPDATE_DENTRY 0 |
---|
[628] | 118 | #define DEBUG_FATFS_UPDATE_IOC 0 |
---|
[439] | 119 | |
---|
[656] | 120 | #define DEBUG_GRDXT_INSERT 0 |
---|
| 121 | |
---|
[651] | 122 | #define DEBUG_HAL_CONTEXT_FORK 0 |
---|
| 123 | #define DEBUG_HAL_CONTEXT_INIT 0 |
---|
[624] | 124 | #define DEBUG_HAL_EXCEPTIONS 0 |
---|
[667] | 125 | #define DEBUG_HAL_FBF 0 |
---|
[607] | 126 | #define DEBUG_HAL_GPT_COPY 0 |
---|
| 127 | #define DEBUG_HAL_GPT_CREATE 0 |
---|
| 128 | #define DEBUG_HAL_GPT_DESTROY 0 |
---|
[641] | 129 | #define DEBUG_HAL_GPT_LOCK_PTE 0 |
---|
[635] | 130 | #define DEBUG_HAL_GPT_SET_COW 0 |
---|
[632] | 131 | #define DEBUG_HAL_GPT_SET_PTE 0 |
---|
[624] | 132 | #define DEBUG_HAL_IOC_RX 0 |
---|
| 133 | #define DEBUG_HAL_IOC_TX 0 |
---|
| 134 | #define DEBUG_HAL_IRQS 0 |
---|
[607] | 135 | #define DEBUG_HAL_KENTRY 0 |
---|
[667] | 136 | #define DEBUG_HAL_NIC_RX 0 |
---|
| 137 | #define DEBUG_HAL_NIC_TX 0 |
---|
[607] | 138 | #define DEBUG_HAL_TXT_RX 0 |
---|
| 139 | #define DEBUG_HAL_TXT_TX 0 |
---|
[624] | 140 | #define DEBUG_HAL_USPACE 0 |
---|
| 141 | #define DEBUG_HAL_VMM 0 |
---|
[439] | 142 | |
---|
[607] | 143 | #define DEBUG_KCM 0 |
---|
[683] | 144 | #define DEBUG_KCM_ORDER 0 // filter for DEBUG_KCM |
---|
| 145 | #define DEBUG_KCM_CXY 0 // filter for DEBUG_KCM |
---|
[635] | 146 | |
---|
[683] | 147 | #define DEBUG_KERNEL_INIT 0 |
---|
| 148 | |
---|
[607] | 149 | #define DEBUG_KMEM 0 |
---|
[683] | 150 | #define DEBUG_KMEM_ORDER 0 // filter for DEBUG_KMEM |
---|
| 151 | #define DEBUG_KMEM_CXY 0 // filter for DEBUG_KMEM |
---|
[439] | 152 | |
---|
[610] | 153 | #define DEBUG_MAPPER_GET_PAGE 0 |
---|
[657] | 154 | #define DEBUG_MAPPER_GET_FAT_PAGE 0 |
---|
[607] | 155 | #define DEBUG_MAPPER_HANDLE_MISS 0 |
---|
[656] | 156 | #define DEBUG_MAPPER_MOVE_KERNEL 0 |
---|
[607] | 157 | #define DEBUG_MAPPER_MOVE_USER 0 |
---|
[623] | 158 | #define DEBUG_MAPPER_SYNC 0 |
---|
[569] | 159 | |
---|
[607] | 160 | #define DEBUG_MUTEX 0 |
---|
[439] | 161 | |
---|
[607] | 162 | #define DEBUG_PPM_ALLOC_PAGES 0 |
---|
| 163 | #define DEBUG_PPM_FREE_PAGES 0 |
---|
| 164 | |
---|
| 165 | #define DEBUG_PROCESS_COPY_INIT 0 |
---|
| 166 | #define DEBUG_PROCESS_DESTROY 0 |
---|
[610] | 167 | #define DEBUG_PROCESS_FD_REGISTER 0 |
---|
[667] | 168 | #define DEBUG_PROCESS_FD_REMOVE 0 |
---|
| 169 | #define DEBUG_PROCESS_FD_CLEAN_ALL 0 |
---|
[607] | 170 | #define DEBUG_PROCESS_GET_LOCAL_COPY 0 |
---|
| 171 | #define DEBUG_PROCESS_INIT_CREATE 0 |
---|
[651] | 172 | #define DEBUG_PROCESS_MAKE_EXEC 0 |
---|
| 173 | #define DEBUG_PROCESS_MAKE_FORK 0 |
---|
[607] | 174 | #define DEBUG_PROCESS_REFERENCE_INIT 0 |
---|
| 175 | #define DEBUG_PROCESS_SIGACTION 0 |
---|
| 176 | #define DEBUG_PROCESS_TXT 0 |
---|
| 177 | #define DEBUG_PROCESS_ZERO_CREATE 0 |
---|
[439] | 178 | |
---|
[683] | 179 | #define DEBUG_QUEUELOCK_TYPE 0 // type 0 undefined => no debug |
---|
| 180 | #define DEBUG_QUEUELOCK_PTR 0 // lock local pointer |
---|
| 181 | #define DEBUG_QUEUELOCK_CXY 0 // lock cluster identifier |
---|
[569] | 182 | |
---|
[634] | 183 | #define DEBUG_RPC_CLIENT_GENERIC 0 |
---|
| 184 | #define DEBUG_RPC_SERVER_GENERIC 0 |
---|
[439] | 185 | |
---|
[657] | 186 | #define DEBUG_RPC_FBF_DISPLAY 0 |
---|
[607] | 187 | #define DEBUG_RPC_PROCESS_MAKE_FORK 0 |
---|
| 188 | #define DEBUG_RPC_PROCESS_SIGACTION 0 |
---|
| 189 | #define DEBUG_RPC_THREAD_USER_CREATE 0 |
---|
| 190 | #define DEBUG_RPC_THREAD_KERNEL_CREATE 0 |
---|
[657] | 191 | #define DEBUG_RPC_USER_DIR_CREATE 0 |
---|
| 192 | #define DEBUG_RPC_USER_DIR_DESTROY 0 |
---|
[611] | 193 | #define DEBUG_RPC_VMM_CREATE_VSEG 0 |
---|
[657] | 194 | #define DEBUG_RPC_VMM_RESIZE_VSEG 0 |
---|
| 195 | #define DEBUG_RPC_VMM_REMOVE_VSEG 0 |
---|
| 196 | #define DEBUG_RPC_VMM_SET_COW 0 |
---|
[439] | 197 | |
---|
[683] | 198 | #define DEBUG_RWLOCK_TYPE 0 // type 0 undefined => no debug |
---|
| 199 | #define DEBUG_RWLOCK_PTR 0 // lock local pointer |
---|
| 200 | #define DEBUG_RWLOCK_CXY 0 // lock cluster identifier |
---|
[569] | 201 | |
---|
[637] | 202 | #define DEBUG_SCHED_HANDLE_SIGNALS 0 |
---|
[625] | 203 | #define DEBUG_SCHED_YIELD 0 |
---|
[607] | 204 | #define DEBUG_SCHED_RPC_ACTIVATE 0 |
---|
[439] | 205 | |
---|
[607] | 206 | #define DEBUG_SEM 0 |
---|
[569] | 207 | |
---|
[667] | 208 | #define DEBUG_SOCKET_ACCEPT 0 |
---|
[675] | 209 | #define DEBUG_SOCKET_ALARM 0 |
---|
[667] | 210 | #define DEBUG_SOCKET_BIND 0 |
---|
| 211 | #define DEBUG_SOCKET_BUILD 0 |
---|
| 212 | #define DEBUG_SOCKET_CLOSE 0 |
---|
| 213 | #define DEBUG_SOCKET_CONNECT 0 |
---|
| 214 | #define DEBUG_SOCKET_CREATE 0 |
---|
| 215 | #define DEBUG_SOCKET_DESTROY 0 |
---|
| 216 | #define DEBUG_SOCKET_LISTEN 0 |
---|
[683] | 217 | #define DEBUG_SOCKET_SEND 0 |
---|
[667] | 218 | #define DEBUG_SOCKET_RECV 0 |
---|
| 219 | #define DEBUG_SOCKET_LINK 0 |
---|
| 220 | |
---|
[607] | 221 | #define DEBUG_SYS_BARRIER 0 |
---|
| 222 | #define DEBUG_SYS_CLOSE 0 |
---|
[611] | 223 | #define DEBUG_SYS_CLOSEDIR 0 |
---|
[607] | 224 | #define DEBUG_SYS_CONDVAR 0 |
---|
| 225 | #define DEBUG_SYS_DISPLAY 0 |
---|
[651] | 226 | #define DEBUG_SYS_EXEC 0 |
---|
[607] | 227 | #define DEBUG_SYS_EXIT 0 |
---|
[647] | 228 | #define DEBUG_SYS_FBF 0 |
---|
[607] | 229 | #define DEBUG_SYS_FG 0 |
---|
[651] | 230 | #define DEBUG_SYS_FORK 0 |
---|
[683] | 231 | #define DEBUG_SYS_GET 0 |
---|
[610] | 232 | #define DEBUG_SYS_GETCWD 0 |
---|
[607] | 233 | #define DEBUG_SYS_GETPID 0 |
---|
| 234 | #define DEBUG_SYS_ISATTY 0 |
---|
| 235 | #define DEBUG_SYS_IS_FG 0 |
---|
| 236 | #define DEBUG_SYS_KILL 0 |
---|
[651] | 237 | #define DEBUG_SYS_LSEEK 0 |
---|
[611] | 238 | #define DEBUG_SYS_MKDIR 0 |
---|
[607] | 239 | #define DEBUG_SYS_MMAP 0 |
---|
| 240 | #define DEBUG_SYS_MUNMAP 0 |
---|
| 241 | #define DEBUG_SYS_MUTEX 0 |
---|
[625] | 242 | #define DEBUG_SYS_OPEN 0 |
---|
| 243 | #define DEBUG_SYS_OPENDIR 0 |
---|
[607] | 244 | #define DEBUG_SYS_READ 0 |
---|
[611] | 245 | #define DEBUG_SYS_READDIR 0 |
---|
[607] | 246 | #define DEBUG_SYS_SEM 0 |
---|
[667] | 247 | #define DEBUG_SYS_SOCKET 0 |
---|
[607] | 248 | #define DEBUG_SYS_STAT 0 |
---|
| 249 | #define DEBUG_SYS_THREAD_CANCEL 0 |
---|
| 250 | #define DEBUG_SYS_THREAD_CREATE 0 |
---|
| 251 | #define DEBUG_SYS_THREAD_EXIT 0 |
---|
| 252 | #define DEBUG_SYS_THREAD_JOIN 0 |
---|
| 253 | #define DEBUG_SYS_THREAD_SLEEP 0 |
---|
| 254 | #define DEBUG_SYS_THREAD_WAKEUP 0 |
---|
| 255 | #define DEBUG_SYS_THREAD_YIELD 0 |
---|
| 256 | #define DEBUG_SYS_TRACE 0 |
---|
| 257 | #define DEBUG_SYS_UNLINK 0 |
---|
| 258 | #define DEBUG_SYS_WAIT 0 |
---|
| 259 | #define DEBUG_SYS_WRITE 0 |
---|
[439] | 260 | |
---|
[607] | 261 | #define DEBUG_THREAD_BLOCK 0 |
---|
| 262 | #define DEBUG_THREAD_DELETE 0 |
---|
| 263 | #define DEBUG_THREAD_DESTROY 0 |
---|
| 264 | #define DEBUG_THREAD_GET_XPTR 0 |
---|
| 265 | #define DEBUG_THREAD_IDLE 0 |
---|
| 266 | #define DEBUG_THREAD_INIT 0 |
---|
| 267 | #define DEBUG_THREAD_KERNEL_CREATE 0 |
---|
| 268 | #define DEBUG_THREAD_USER_CREATE 0 |
---|
| 269 | #define DEBUG_THREAD_USER_FORK 0 |
---|
| 270 | #define DEBUG_THREAD_USER_EXEC 0 |
---|
[439] | 271 | |
---|
[683] | 272 | #define DEBUG_USER_DIR_CREATE 0 |
---|
| 273 | #define DEBUG_USER_DIR_DESTROY 0 |
---|
[612] | 274 | |
---|
[634] | 275 | #define DEBUG_VFS_ADD_CHILD 0 |
---|
[614] | 276 | #define DEBUG_VFS_ADD_SPECIAL 0 |
---|
[611] | 277 | #define DEBUG_VFS_CHDIR 0 |
---|
[607] | 278 | #define DEBUG_VFS_CLOSE 0 |
---|
[635] | 279 | #define DEBUG_VFS_DENTRY_CREATE 0 |
---|
[610] | 280 | #define DEBUG_VFS_FILE_CREATE 0 |
---|
[675] | 281 | #define DEBUG_VFS_FILE_DESTROY 0 |
---|
[610] | 282 | #define DEBUG_VFS_GET_PATH 0 |
---|
[657] | 283 | #define DEBUG_VFS_INODE_CREATE 0 |
---|
[607] | 284 | #define DEBUG_VFS_INODE_LOAD_ALL 0 |
---|
[625] | 285 | #define DEBUG_VFS_KERNEL_MOVE 0 |
---|
[610] | 286 | #define DEBUG_VFS_LINK 0 |
---|
[611] | 287 | #define DEBUG_VFS_LOOKUP 0 |
---|
[607] | 288 | #define DEBUG_VFS_LSEEK 0 |
---|
[611] | 289 | #define DEBUG_VFS_MKDIR 0 |
---|
[625] | 290 | #define DEBUG_VFS_NEW_DENTRY_INIT 0 |
---|
[607] | 291 | #define DEBUG_VFS_OPEN 0 |
---|
[614] | 292 | #define DEBUG_VFS_OPENDIR 0 |
---|
[675] | 293 | #define DEBUG_VFS_REMOVE_CHILD 0 |
---|
[607] | 294 | #define DEBUG_VFS_STAT 0 |
---|
[625] | 295 | #define DEBUG_VFS_USER_MOVE 0 |
---|
[624] | 296 | #define DEBUG_VFS_UNLINK 0 |
---|
[439] | 297 | |
---|
[683] | 298 | |
---|
[607] | 299 | #define DEBUG_VMM_CREATE_VSEG 0 |
---|
| 300 | #define DEBUG_VMM_DESTROY 0 |
---|
| 301 | #define DEBUG_VMM_FORK_COPY 0 |
---|
[634] | 302 | #define DEBUG_VMM_GET_ONE_PPN 0 |
---|
[607] | 303 | #define DEBUG_VMM_GET_PTE 0 |
---|
[640] | 304 | #define DEBUG_VMM_GLOBAL_DELETE_VSEG 0 |
---|
| 305 | #define DEBUG_VMM_GLOBAL_RESIZE_VSEG 0 |
---|
[635] | 306 | #define DEBUG_VMM_HANDLE_PAGE_FAULT 0 |
---|
[607] | 307 | #define DEBUG_VMM_HANDLE_COW 0 |
---|
[651] | 308 | #define DEBUG_VMM_MMAP 0 |
---|
[634] | 309 | #define DEBUG_VMM_PAGE_ALLOCATE 0 |
---|
[625] | 310 | #define DEBUG_VMM_REMOVE_VSEG 0 |
---|
[623] | 311 | #define DEBUG_VMM_RESIZE_VSEG 0 |
---|
[607] | 312 | #define DEBUG_VMM_SET_COW 0 |
---|
| 313 | #define DEBUG_VMM_UPDATE_PTE 0 |
---|
[625] | 314 | #define DEBUG_VMM_USER_INIT 0 |
---|
| 315 | #define DEBUG_VMM_USER_RESET 0 |
---|
[439] | 316 | |
---|
[607] | 317 | #define DEBUG_XHTAB 0 |
---|
[440] | 318 | |
---|
[569] | 319 | |
---|
[439] | 320 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[569] | 321 | // KERNEL LOCKS TYPES MNEMONICS (for debug) |
---|
| 322 | // It must be kept consistent with the lock_name[] array defined in kernel_init.c file. |
---|
| 323 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 324 | |
---|
| 325 | #define LOCK_CLUSTER_KCM 1 // local (B) protect dynamic KCM creation in cluster |
---|
[632] | 326 | #define LOCK_SCHED_STATE 2 // local (B) protect scheduler state for given core |
---|
| 327 | #define LOCK_VMM_STACK 3 // local (B) protect VMM stack vseg allocator |
---|
| 328 | #define LOCK_VMM_MMAP 4 // local (B) protect VMM mmap vseg allocator |
---|
[657] | 329 | #define LOCK_KCM_STATE 5 // local (B) protect KCM allocator state |
---|
| 330 | #define LOCK_KHM_STATE 6 // local (B) protect KHM allocator state |
---|
| 331 | #define LOCK_HTAB_STATE 7 // local (B) protect a local htab state |
---|
[675] | 332 | #define LOCK_CORE_ALARMS 8 // local (B) protect list of alarms in core desc. |
---|
[569] | 333 | |
---|
[675] | 334 | #define LOCK_VFS_CTX 9 // remote (B) protect vfs context state |
---|
| 335 | #define LOCK_PPM_FREE 10 // remote (B) protect PPM allocator free_pages lists |
---|
| 336 | #define LOCK_THREAD_JOIN 11 // remote (B) protect join/exit between two threads |
---|
| 337 | #define LOCK_XHTAB_STATE 12 // remote (B) protect a distributed xhtab state |
---|
| 338 | #define LOCK_CHDEV_QUEUE 13 // remote (B) protect chdev threads waiting queue |
---|
| 339 | #define LOCK_CHDEV_TXT0 14 // remote (B) protect access to kernel terminal TXT0 |
---|
| 340 | #define LOCK_CHDEV_TXTLIST 15 // remote (B) protect xlist of processes using same TXT |
---|
| 341 | #define LOCK_PAGE_STATE 16 // remote (B) protect physical page descriptor state |
---|
| 342 | #define LOCK_MUTEX_STATE 17 // remote (B) protect user mutex state |
---|
| 343 | #define LOCK_CONDVAR_STATE 18 // remote (B) protect user condvar state |
---|
| 344 | #define LOCK_SEM_STATE 19 // remote (B) protect user semaphore state |
---|
| 345 | #define LOCK_PROCESS_CWD 20 // remote (B) protect current working directory in process |
---|
| 346 | #define LOCK_BARRIER_STATE 21 // remote (B) protect user barrier state |
---|
| 347 | #define LOCK_LISTEN_SOCKET 22 // remote (B) protect xlist of listening sockets |
---|
[569] | 348 | |
---|
[675] | 349 | #define LOCK_CLUSTER_PREFTBL 23 // local (Q) protect array of ref. processes in cluster |
---|
[569] | 350 | |
---|
[675] | 351 | #define LOCK_SOCKET_STATE 24 // remote (Q) protect kernel socket state |
---|
| 352 | #define LOCK_PPM_DIRTY 25 // remote (Q) protect PPM dirty_pages list |
---|
| 353 | #define LOCK_CLUSTER_LOCALS 26 // remote (Q) protect xlist of local processes in cluster |
---|
| 354 | #define LOCK_CLUSTER_COPIES 27 // remote (Q) protect xlist of process copies in cluster |
---|
| 355 | #define LOCK_PROCESS_CHILDREN 28 // remote (Q) protect xlist of chidren process in process |
---|
| 356 | #define LOCK_PROCESS_USERSYNC 29 // remote (Q) protect lists of user synchros in process |
---|
| 357 | #define LOCK_PROCESS_FDARRAY 30 // remote (Q) protect array of open files in owner process |
---|
| 358 | #define LOCK_PROCESS_DIR 31 // remote (Q) protect xlist of open directories in process |
---|
| 359 | #define LOCK_VMM_VSL 32 // remote (Q) protect VSL (local list of vsegs) |
---|
[569] | 360 | |
---|
[675] | 361 | #define LOCK_PROCESS_THTBL 33 // local (RW) protect local array of threads in a process |
---|
[569] | 362 | |
---|
[675] | 363 | #define LOCK_MAPPER_STATE 34 // remote (RW) protect mapper state |
---|
| 364 | #define LOCK_VFS_SIZE 35 // remote (RW) protect inode state and associated mapper |
---|
| 365 | #define LOCK_VFS_FILE 36 // remote (RW) protect file descriptor state |
---|
| 366 | #define LOCK_VFS_MAIN 37 // remote (RW) protect vfs traversal (in root inode) |
---|
| 367 | #define LOCK_FATFS_FAT 38 // remote (RW) protect exclusive access to the VFS FAT |
---|
| 368 | #define LOCK_FBF_WINDOWS 39 // remote (RW) protect FBF windows set |
---|
[569] | 369 | |
---|
[635] | 370 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 371 | // GENERAL CONFIGURATION |
---|
| 372 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[590] | 373 | |
---|
[683] | 374 | #define CONFIG_VERSION "Version 2.4 / November 2020" |
---|
[635] | 375 | |
---|
[569] | 376 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[439] | 377 | // HARDWARE CONFIGURATION |
---|
| 378 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 379 | |
---|
| 380 | #define CONFIG_KERNEL_IDENTITY_MAP true // True for 32 bits cores |
---|
[569] | 381 | #define CONFIG_MAX_CLUSTERS_X 16 // max number of clusters in row |
---|
| 382 | #define CONFIG_MAX_CLUSTERS_Y 16 // max number of clusters in column |
---|
| 383 | #define CONFIG_MAX_CLUSTERS (CONFIG_MAX_CLUSTERS_X * CONFIG_MAX_CLUSTERS_Y) |
---|
[439] | 384 | #define CONFIG_MAX_LOCAL_CORES 4 // max number of cores per cluster |
---|
| 385 | #define CONFIG_MAX_INT_DEV 4 // max number of internal peripherals |
---|
| 386 | #define CONFIG_MAX_EXT_DEV 8 // max number of external peripherals |
---|
[569] | 387 | #define CONFIG_MAX_INTERNAL_IRQS 32 // max number of internal IRQs |
---|
| 388 | #define CONFIG_MAX_EXTERNAL_IRQS 32 // max number of external IRQs |
---|
[439] | 389 | #define CONFIG_IRQS_PER_CORE 4 // number of input IRQs per core |
---|
| 390 | #define CONFIG_CLUSTER_SPAN 32 // ln(phys. address space per cluster) |
---|
| 391 | #define CONFIG_CACHE_LINE_SIZE 64 // number of bytes in cache line |
---|
[683] | 392 | #define CONFIG_CACHE_LINE_ORDER 6 // ln( cache line size ) |
---|
[439] | 393 | |
---|
| 394 | #define CONFIG_CACHE_LINE_ALIGNED __attribute__((aligned(CONFIG_CACHE_LINE_SIZE))) |
---|
| 395 | |
---|
| 396 | #define CONFIG_MAX_IOC_CHANNELS 1 // max number of IOC device channels |
---|
| 397 | #define CONFIG_MAX_FBF_CHANNELS 1 // max number of FBF device channels |
---|
| 398 | #define CONFIG_MAX_TXT_CHANNELS 8 // max number of TXT device channels |
---|
| 399 | #define CONFIG_MAX_DMA_CHANNELS 4 // max number of DMA device channels |
---|
| 400 | #define CONFIG_MAX_NIC_CHANNELS 4 // max number of NIC device channels |
---|
| 401 | |
---|
| 402 | #define CONFIG_TXT_ECHO_MODE 1 // echo mode for TXT peripheral |
---|
[443] | 403 | #define CONFIG_TXT_KBUF_SIZE 512 // kernel buffer for TXT write |
---|
[439] | 404 | |
---|
| 405 | #define CONFIG_FBF_WIDTH 128 |
---|
| 406 | #define CONFIG_FBF_HEIGHT 128 |
---|
| 407 | |
---|
| 408 | #define CONFIG_CPU_CTX_SIZE 256 // up to 64 uint32_t registers |
---|
| 409 | #define CONFIG_FPU_CTX_SIZE 256 // up to 32 uint64_t registers |
---|
| 410 | |
---|
| 411 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[683] | 412 | // DQDT |
---|
| 413 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 414 | |
---|
| 415 | #define CONFIG_DQDT_LEVELS_NR 5 |
---|
| 416 | |
---|
| 417 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 418 | // FBF WINDOWS |
---|
| 419 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 420 | |
---|
| 421 | #define CONFIG_FBF_WINDOWS_MAX_NR 64 // max number of windows |
---|
| 422 | #define CONFIG_FBF_WINDOWS_MAX_WIDTH 1024 // max number of pixels in FBF line |
---|
| 423 | #define CONFIG_FBF_WINDOWS_MAX_HEIGHT 1024 // max number of lines in FBF |
---|
| 424 | |
---|
| 425 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[439] | 426 | // PROCESS MANAGEMENT |
---|
| 427 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 428 | |
---|
[683] | 429 | #define CONFIG_PROCESS_INIT_PATH "/bin/user/init.elf" |
---|
[607] | 430 | #define CONFIG_MAX_PROCESS_PER_CLUSTER 16 // max number of owned process |
---|
[675] | 431 | #define CONFIG_PROCESS_ARGS_MAX_NR 4 // max number of args per process |
---|
| 432 | #define CONFIG_PROCESS_ENVS_MAX_NR 256 // max number of envs per process |
---|
| 433 | #define CONFIG_PROCESS_FILE_MAX_NR 256 // max number of files per process |
---|
[439] | 434 | #define CONFIG_PROCESS_MAX_CHILDREN 1024 // max number of children process |
---|
| 435 | #define CONFIG_PROCESS_HEAP_MIN_SIZE 0x00010000 // user heap min size (bytes) |
---|
| 436 | #define CONFIG_PROCESS_HEAP_MAX_SIZE 0x30000000 // user heap max size (bytes) |
---|
[683] | 437 | #define CONFIG_PROCESS_DISPLAY_BUF_SIZE 128 // display one process on one line |
---|
[439] | 438 | |
---|
| 439 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[683] | 440 | // PHYSICAL MEMORY MANAGEMENT |
---|
[439] | 441 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 442 | |
---|
[683] | 443 | #define CONFIG_PPM_PAGE_SIZE 4096 // physical page size (bytes) |
---|
| 444 | #define CONFIG_PPM_PAGE_ORDER 12 // ln(physical page size) |
---|
| 445 | #define CONFIG_PPM_PAGE_MASK 0x00000FFF // physical page mask |
---|
| 446 | #define CONFIG_PPM_MAX_ORDER 16 // ln(total number of pages per cluster) |
---|
| 447 | #define CONFIG_PPM_MAX_RSVD 32 // max reserved zones on the machine |
---|
[657] | 448 | |
---|
[683] | 449 | #define CONFIG_PPM_PAGE_ALIGNED __attribute__((aligned(CONFIG_PPM_PAGE_SIZE))) |
---|
[439] | 450 | |
---|
| 451 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[683] | 452 | // RANDOM NUMBERS |
---|
[657] | 453 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 454 | |
---|
[683] | 455 | #define CONFIG_RDNG_PARAM_A 65519 |
---|
| 456 | #define CONFIG_RDNG_PARAM_C 64037 |
---|
[657] | 457 | |
---|
| 458 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[683] | 459 | // REMOTE PROCEDURE CALL |
---|
[439] | 460 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 461 | |
---|
[683] | 462 | #define CONFIG_RPC_FIFO_SLOTS 16 |
---|
| 463 | #define CONFIG_RPC_FIFO_MAX_ITERATIONS 1024 |
---|
| 464 | #define CONFIG_RPC_THREADS_MAX 4 // max number of RPC threads per core |
---|
[439] | 465 | |
---|
| 466 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 467 | // SCHEDULING |
---|
| 468 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 469 | |
---|
[683] | 470 | #define CONFIG_SCHED_TICKS_PER_SECOND 1 // number of TICKS per seconds |
---|
[657] | 471 | #define CONFIG_SCHED_TICKS_PER_QUANTUM 1 // number of ticks between scheduling |
---|
| 472 | #define CONFIG_SCHED_MAX_THREADS_NR 32 // max number of threads per core |
---|
| 473 | #define CONFIG_SCHED_IDLE_MODE_SLEEP 0 // idle thread use sleep mode if non 0 |
---|
[439] | 474 | |
---|
| 475 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[683] | 476 | // TCP/UDP/IP |
---|
| 477 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 478 | |
---|
| 479 | #define CONFIG_SOCK_ISS_CLIENT 0x10000 // initial sequence number for TCP client |
---|
| 480 | #define CONFIG_SOCK_ISS_SERVER 0x20000 // initial sequence number for TCP server |
---|
| 481 | #define CONFIG_SOCK_MAX_WINDOW 0xFFFFF // initial window (bytes) for TCP |
---|
| 482 | #define CONFIG_SOCK_RETRY_TIMEOUT 1000000 // number of cycles before retry for TCP |
---|
| 483 | #define CONFIG_SOCK_QUEUES_DEPTH 4 // max number of packets in RX/TX queues |
---|
| 484 | #define CONFIG_SOCK_RX_BUF_ORDER 20 // ln( number of bytes in socket rx_buf ) |
---|
| 485 | #define CONFIG_SOCK_TX_BUF_ORDER 20 // ln( number of bytes in socket tx_buf ) |
---|
| 486 | #define CONFIG_SOCK_R2T_BUF_SIZE 8 // max number of requests in R2T queue |
---|
| 487 | #define CONFIG_SOCK_CRQ_BUF_SIZE 8 // max number of requests in CRQ queue |
---|
| 488 | #define CONFIG_SOCK_PKT_BUF_SIZE 2048 // max length for one ETH/IP/TCP packet |
---|
| 489 | #define CONFIG_SOCK_PAYLOAD_MAX 1500 // max user payload length for packet |
---|
| 490 | |
---|
| 491 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[439] | 492 | // THREADS |
---|
| 493 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 494 | |
---|
[657] | 495 | #define CONFIG_THREADS_MAX_PER_CLUSTER 32 // max threads per cluster per process |
---|
| 496 | #define CONFIG_THREAD_DESC_SIZE 0x4000 // thread desc size (with kernel stack) |
---|
[683] | 497 | #define CONFIG_THREAD_DESC_ORDER 14 // ln( number of bytes ) |
---|
[439] | 498 | |
---|
| 499 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[683] | 500 | // VIRTUAL FILE SYSTEM |
---|
[439] | 501 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 502 | |
---|
[683] | 503 | #define CONFIG_VFS_ROOT_CXY 0 // VFS_ROOT and FAT mapper cluster |
---|
[439] | 504 | |
---|
[683] | 505 | #define CONFIG_VFS_MAX_INODES 128 // max number of inodes per cluster |
---|
| 506 | #define CONFIG_VFS_MAX_NAME_LENGTH 56 // dentry name max length (bytes) |
---|
| 507 | #define CONFIG_VFS_MAX_PATH_LENGTH 256 // pathname max length (bytes) |
---|
| 508 | #define CONFIG_VFS_FREE_CLUSTERS_MIN 32 // min number of free clusters |
---|
| 509 | #define CONFIG_VFS_MAX_DENTRIES 63 // max number of dentries in one dir |
---|
| 510 | |
---|
| 511 | #define CONFIG_VFS_ROOT_IS_FATFS 1 // root FS is FATFS if non zero |
---|
| 512 | #define CONFIG_VFS_ROOT_IS_EX2FS 0 // root FS is EX2FS if non zero |
---|
| 513 | |
---|
| 514 | #define CONFIG_MAPPER_GRDXT_W1 6 // number of bits for RADIX_TREE_IX1 |
---|
| 515 | #define CONFIG_MAPPER_GRDXT_W2 7 // number of bits for RADIX_TREE_IX2 |
---|
| 516 | #define CONFIG_MAPPER_GRDXT_W3 7 // number of bits for RADIX_TREE_IX3 |
---|
| 517 | |
---|
[439] | 518 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[651] | 519 | // 32 bits USER SPACE SEGMENTATION / all bases and sizes are numbers of pages |
---|
[439] | 520 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 521 | |
---|
[657] | 522 | #define CONFIG_VMM_VSPACE_SIZE 0x100000 // virtual space : 4 Gbytes |
---|
[439] | 523 | |
---|
[657] | 524 | #define CONFIG_VMM_UTILS_BASE 0x000200 // UTILS zone base : 2 Mbytes |
---|
| 525 | #define CONFIG_VMM_ELF_BASE 0x000400 // ELF zone base : 4 Mbytes |
---|
| 526 | #define CONFIG_VMM_HEAP_BASE 0x040000 // HEAP zone base : 32 Mbytes |
---|
| 527 | #define CONFIG_VMM_STACK_BASE 0x0C0000 // STACK zone base : 3 Gbytes |
---|
| 528 | |
---|
[675] | 529 | #define CONFIG_VMM_ARGS_SIZE 0x000001 // args vseg size : 4 Kbytes |
---|
| 530 | #define CONFIG_VMM_ENVS_SIZE 0x000004 // envs vseg size : 16 Kbytes |
---|
[683] | 531 | #define CONFIG_VMM_STACK_SIZE 0x000100 // single stack vseg size : 1 Mbytes |
---|
[439] | 532 | |
---|
[683] | 533 | #define CONFIG_VMM_HEAP_MAX_ORDER 18 // max size of MMAP vseg : 1 Gbytes |
---|
[675] | 534 | |
---|
[439] | 535 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[675] | 536 | // MISCELANEOUS BUFFER SIZES |
---|
| 537 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 538 | |
---|
| 539 | #define CONFIG_PRINTK_BUF_SIZE 0x800 // max length of a formated string |
---|
| 540 | #define CONFIG_PIPE_BUF_SIZE 0x1000 // max number of bytes in a pipe buffer |
---|
| 541 | |
---|
| 542 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[569] | 543 | // INSTRUMENTATION |
---|
[439] | 544 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 545 | |
---|
[635] | 546 | #define CONFIG_INSTRUMENTATION_SYSCALLS 0 |
---|
[651] | 547 | #define CONFIG_INSTRUMENTATION_PGFAULTS 0 |
---|
[657] | 548 | #define CONFIG_INSTRUMENTATION_FOOTPRINT 1 |
---|
| 549 | #define CONFIG_INSTRUMENTATION_CHDEVS 0 |
---|
[651] | 550 | #define CONFIG_INSTRUMENTATION_GPT 0 |
---|
[439] | 551 | |
---|
| 552 | |
---|
| 553 | |
---|
| 554 | |
---|
| 555 | #endif /* _KERNEL_CONFIG_H_ */ |
---|