[439] | 1 | /* |
---|
| 2 | * kernel_config.h - global kernel configuration arguments |
---|
| 3 | * |
---|
[634] | 4 | * Authors Alain Greiner (2016,2017,2018,2019) |
---|
[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 | |
---|
| 27 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 28 | // KERNEL DEBUG |
---|
| 29 | // Each debug variable control one kernel function, or one small group of functions. |
---|
| 30 | // - trace is generated only when cycle > debug_value. |
---|
| 31 | // - detailed trace is enabled when (debug_value & Ox1) is non zero. |
---|
| 32 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 33 | |
---|
[620] | 34 | #define DEBUG_BARRIER_CREATE 0 |
---|
| 35 | #define DEBUG_BARRIER_DESTROY 0 |
---|
[619] | 36 | #define DEBUG_BARRIER_WAIT 0 |
---|
[581] | 37 | |
---|
[620] | 38 | #define DEBUG_BUSYLOCK 0 |
---|
[629] | 39 | #define DEBUG_BUSYLOCK_PID 0 // for busylock detailed debug |
---|
| 40 | #define DEBUG_BUSYLOCK_TRDID 0 // for busylock detailed debug |
---|
[569] | 41 | |
---|
[607] | 42 | #define DEBUG_CHDEV_CMD_RX 0 |
---|
| 43 | #define DEBUG_CHDEV_CMD_TX 0 |
---|
| 44 | #define DEBUG_CHDEV_SERVER_RX 0 |
---|
| 45 | #define DEBUG_CHDEV_SERVER_TX 0 |
---|
[439] | 46 | |
---|
[607] | 47 | #define DEBUG_CLUSTER_INIT 0 |
---|
| 48 | #define DEBUG_CLUSTER_PID_ALLOC 0 |
---|
| 49 | #define DEBUG_CLUSTER_PID_RELEASE 0 |
---|
| 50 | #define DEBUG_CLUSTER_PROCESS_COPIES 0 |
---|
[439] | 51 | |
---|
[607] | 52 | #define DEBUG_DEV_TXT_RX 0 |
---|
| 53 | #define DEBUG_DEV_TXT_TX 0 |
---|
| 54 | #define DEBUG_DEV_IOC_RX 0 |
---|
| 55 | #define DEBUG_DEV_IOC_TX 0 |
---|
| 56 | #define DEBUG_DEV_NIC_RX 0 |
---|
| 57 | #define DEBUG_DEV_NIC_RX 0 |
---|
| 58 | #define DEBUG_DEV_FBF_RX 0 |
---|
| 59 | #define DEBUG_DEV_FBF_TX 0 |
---|
| 60 | #define DEBUG_DEV_DMA 0 |
---|
| 61 | #define DEBUG_DEV_MMC 0 |
---|
| 62 | #define DEBUG_DEV_PIC 0 |
---|
[439] | 63 | |
---|
[614] | 64 | #define DEBUG_DEVFS_GLOBAL_INIT 0 |
---|
[634] | 65 | #define DEBUG_DEVFS_LOCAL_INIT 0 |
---|
[607] | 66 | #define DEBUG_DEVFS_MOVE 0 |
---|
[439] | 67 | |
---|
[607] | 68 | #define DEBUG_ELF_LOAD 0 |
---|
[582] | 69 | |
---|
[637] | 70 | #define DEBUG_DQDT_GET_ROOT 0 |
---|
[607] | 71 | #define DEBUG_DQDT_INIT 0 |
---|
[637] | 72 | #define DEBUG_DQDT_SELECT_FOR_THREAD 0 |
---|
| 73 | #define DEBUG_DQDT_SELECT_FOR_MEMORY 0 |
---|
| 74 | #define DEBUG_DQDT_UPDATE_PAGES 0 |
---|
[607] | 75 | #define DEBUG_DQDT_UPDATE_THREADS 0 |
---|
[439] | 76 | |
---|
[607] | 77 | #define DEBUG_FATFS_ADD_DENTRY 0 |
---|
| 78 | #define DEBUG_FATFS_CLUSTER_ALLOC 0 |
---|
| 79 | #define DEBUG_FATFS_CTX_INIT 0 |
---|
| 80 | #define DEBUG_FATFS_FREE_CLUSTERS 0 |
---|
| 81 | #define DEBUG_FATFS_GET_CLUSTER 0 |
---|
[614] | 82 | #define DEBUG_FATFS_GET_USER_DIR 0 |
---|
[607] | 83 | #define DEBUG_FATFS_MOVE_PAGE 0 |
---|
[623] | 84 | #define DEBUG_FATFS_NEW_DENTRY 0 |
---|
[624] | 85 | #define DEBUG_FATFS_RELEASE_INODE 0 |
---|
[610] | 86 | #define DEBUG_FATFS_REMOVE_DENTRY 0 |
---|
[607] | 87 | #define DEBUG_FATFS_SYNC_FAT 0 |
---|
| 88 | #define DEBUG_FATFS_SYNC_FSINFO 0 |
---|
| 89 | #define DEBUG_FATFS_SYNC_INODE 0 |
---|
[623] | 90 | #define DEBUG_FATFS_UPDATE_DENTRY 0 |
---|
[628] | 91 | #define DEBUG_FATFS_UPDATE_IOC 0 |
---|
[439] | 92 | |
---|
[625] | 93 | #define DEBUG_HAL_CONTEXT 0 |
---|
[624] | 94 | #define DEBUG_HAL_EXCEPTIONS 0 |
---|
[607] | 95 | #define DEBUG_HAL_GPT_COPY 0 |
---|
| 96 | #define DEBUG_HAL_GPT_CREATE 0 |
---|
| 97 | #define DEBUG_HAL_GPT_DESTROY 0 |
---|
[640] | 98 | #define DEBUG_HAL_GPT_LOCK_PTE 2 |
---|
[635] | 99 | #define DEBUG_HAL_GPT_SET_COW 0 |
---|
[632] | 100 | #define DEBUG_HAL_GPT_SET_PTE 0 |
---|
[624] | 101 | #define DEBUG_HAL_IOC_RX 0 |
---|
| 102 | #define DEBUG_HAL_IOC_TX 0 |
---|
| 103 | #define DEBUG_HAL_IRQS 0 |
---|
[607] | 104 | #define DEBUG_HAL_KENTRY 0 |
---|
| 105 | #define DEBUG_HAL_TXT_RX 0 |
---|
| 106 | #define DEBUG_HAL_TXT_TX 0 |
---|
[624] | 107 | #define DEBUG_HAL_USPACE 0 |
---|
| 108 | #define DEBUG_HAL_VMM 0 |
---|
[439] | 109 | |
---|
[607] | 110 | #define DEBUG_KCM 0 |
---|
[635] | 111 | #define DEBUG_KCM_REMOTE 0 |
---|
| 112 | |
---|
[607] | 113 | #define DEBUG_KMEM 0 |
---|
[635] | 114 | #define DEBUG_KMEM_REMOTE 0 |
---|
[439] | 115 | |
---|
[634] | 116 | #define DEBUG_KERNEL_INIT 0 |
---|
[439] | 117 | |
---|
[610] | 118 | #define DEBUG_MAPPER_GET_PAGE 0 |
---|
[607] | 119 | #define DEBUG_MAPPER_HANDLE_MISS 0 |
---|
| 120 | #define DEBUG_MAPPER_MOVE_USER 0 |
---|
| 121 | #define DEBUG_MAPPER_MOVE_KERNEL 0 |
---|
[623] | 122 | #define DEBUG_MAPPER_SYNC 0 |
---|
[569] | 123 | |
---|
[607] | 124 | #define DEBUG_MUTEX 0 |
---|
[439] | 125 | |
---|
[607] | 126 | #define DEBUG_PPM_ALLOC_PAGES 0 |
---|
| 127 | #define DEBUG_PPM_FREE_PAGES 0 |
---|
[634] | 128 | #define DEBUG_PPM_REMOTE_ALLOC_PAGES 0 |
---|
| 129 | #define DEBUG_PPM_REMOTE_FREE_PAGES 0 |
---|
[607] | 130 | |
---|
| 131 | #define DEBUG_PROCESS_COPY_INIT 0 |
---|
| 132 | #define DEBUG_PROCESS_DESTROY 0 |
---|
[610] | 133 | #define DEBUG_PROCESS_FD_REGISTER 0 |
---|
[607] | 134 | #define DEBUG_PROCESS_GET_LOCAL_COPY 0 |
---|
| 135 | #define DEBUG_PROCESS_INIT_CREATE 0 |
---|
| 136 | #define DEBUG_PROCESS_MAKE_EXEC 0 |
---|
| 137 | #define DEBUG_PROCESS_MAKE_FORK 0 |
---|
| 138 | #define DEBUG_PROCESS_REFERENCE_INIT 0 |
---|
| 139 | #define DEBUG_PROCESS_SIGACTION 0 |
---|
| 140 | #define DEBUG_PROCESS_TXT 0 |
---|
| 141 | #define DEBUG_PROCESS_ZERO_CREATE 0 |
---|
[439] | 142 | |
---|
[629] | 143 | #define DEBUG_QUEUELOCK_TYPE 0 // lock type 0 is undefined => no debug |
---|
| 144 | #define DEBUG_QUEUELOCK_PTR 0 |
---|
| 145 | #define DEBUG_QUEUELOCK_CXY 0 |
---|
[569] | 146 | |
---|
[634] | 147 | #define DEBUG_RPC_CLIENT_GENERIC 0 |
---|
| 148 | #define DEBUG_RPC_SERVER_GENERIC 0 |
---|
[439] | 149 | |
---|
[607] | 150 | #define DEBUG_RPC_MAPPER_MOVE_USER 0 |
---|
| 151 | #define DEBUG_RPC_PROCESS_MAKE_FORK 0 |
---|
| 152 | #define DEBUG_RPC_PROCESS_SIGACTION 0 |
---|
| 153 | #define DEBUG_RPC_THREAD_USER_CREATE 0 |
---|
| 154 | #define DEBUG_RPC_THREAD_KERNEL_CREATE 0 |
---|
[634] | 155 | #define DEBUG_RPC_VFS_DENTRY_CREATE 0 |
---|
[607] | 156 | #define DEBUG_RPC_VFS_DENTRY_DESTROY 0 |
---|
[628] | 157 | #define DEBUG_RPC_VFS_DEVICE_GET_DENTRY 0 |
---|
[607] | 158 | #define DEBUG_RPC_VFS_FILE_CREATE 0 |
---|
| 159 | #define DEBUG_RPC_VFS_FILE_DESTROY 0 |
---|
[628] | 160 | #define DEBUG_RPC_VFS_FS_NEW_DENTRY 0 |
---|
| 161 | #define DEBUG_RPC_VFS_FS_ADD_DENTRY 0 |
---|
| 162 | #define DEBUG_RPC_VFS_INODE_CREATE 0 |
---|
| 163 | #define DEBUG_RPC_VFS_INODE_DESTROY 0 |
---|
[611] | 164 | #define DEBUG_RPC_VMM_CREATE_VSEG 0 |
---|
[607] | 165 | #define DEBUG_RPC_VMM_GET_PTE 0 |
---|
| 166 | #define DEBUG_RPC_VMM_GET_VSEG 0 |
---|
[619] | 167 | #define DEBUG_RPC_VMM_DELETE_VSEG 0 |
---|
[439] | 168 | |
---|
[633] | 169 | #define DEBUG_RWLOCK_TYPE 0 // lock type 0 is undefined => no debug |
---|
| 170 | #define DEBUG_RWLOCK_PTR 0 |
---|
| 171 | #define DEBUG_RWLOCK_CXY 0 |
---|
[569] | 172 | |
---|
[637] | 173 | #define DEBUG_SCHED_HANDLE_SIGNALS 0 |
---|
[625] | 174 | #define DEBUG_SCHED_YIELD 0 |
---|
[607] | 175 | #define DEBUG_SCHED_RPC_ACTIVATE 0 |
---|
[439] | 176 | |
---|
[607] | 177 | #define DEBUG_SEM 0 |
---|
[569] | 178 | |
---|
[637] | 179 | #define DEBUG_SYSCALLS_ERROR 2 |
---|
[439] | 180 | |
---|
[607] | 181 | #define DEBUG_SYS_BARRIER 0 |
---|
| 182 | #define DEBUG_SYS_CLOSE 0 |
---|
[611] | 183 | #define DEBUG_SYS_CLOSEDIR 0 |
---|
[607] | 184 | #define DEBUG_SYS_CONDVAR 0 |
---|
| 185 | #define DEBUG_SYS_DISPLAY 0 |
---|
| 186 | #define DEBUG_SYS_EXEC 0 |
---|
| 187 | #define DEBUG_SYS_EXIT 0 |
---|
| 188 | #define DEBUG_SYS_FG 0 |
---|
| 189 | #define DEBUG_SYS_FORK 0 |
---|
| 190 | #define DEBUG_SYS_GET_CONFIG 0 |
---|
[610] | 191 | #define DEBUG_SYS_GETCWD 0 |
---|
[607] | 192 | #define DEBUG_SYS_GETPID 0 |
---|
[637] | 193 | #define DEBUG_SYS_GET_BEST_CORE 0 |
---|
| 194 | #define DEBUG_SYS_GET_CORE_ID 0 |
---|
| 195 | #define DEBUG_SYS_GET_NB_CORES 0 |
---|
[607] | 196 | #define DEBUG_SYS_ISATTY 0 |
---|
| 197 | #define DEBUG_SYS_IS_FG 0 |
---|
| 198 | #define DEBUG_SYS_KILL 0 |
---|
[611] | 199 | #define DEBUG_SYS_MKDIR 0 |
---|
[607] | 200 | #define DEBUG_SYS_MMAP 0 |
---|
| 201 | #define DEBUG_SYS_MUNMAP 0 |
---|
| 202 | #define DEBUG_SYS_MUTEX 0 |
---|
[625] | 203 | #define DEBUG_SYS_OPEN 0 |
---|
| 204 | #define DEBUG_SYS_OPENDIR 0 |
---|
[607] | 205 | #define DEBUG_SYS_READ 0 |
---|
[611] | 206 | #define DEBUG_SYS_READDIR 0 |
---|
[607] | 207 | #define DEBUG_SYS_SEM 0 |
---|
| 208 | #define DEBUG_SYS_STAT 0 |
---|
| 209 | #define DEBUG_SYS_THREAD_CANCEL 0 |
---|
| 210 | #define DEBUG_SYS_THREAD_CREATE 0 |
---|
| 211 | #define DEBUG_SYS_THREAD_EXIT 0 |
---|
| 212 | #define DEBUG_SYS_THREAD_JOIN 0 |
---|
| 213 | #define DEBUG_SYS_THREAD_SLEEP 0 |
---|
| 214 | #define DEBUG_SYS_THREAD_WAKEUP 0 |
---|
| 215 | #define DEBUG_SYS_THREAD_YIELD 0 |
---|
| 216 | #define DEBUG_SYS_TRACE 0 |
---|
| 217 | #define DEBUG_SYS_UNLINK 0 |
---|
| 218 | #define DEBUG_SYS_WAIT 0 |
---|
| 219 | #define DEBUG_SYS_WRITE 0 |
---|
[439] | 220 | |
---|
[607] | 221 | #define DEBUG_THREAD_BLOCK 0 |
---|
| 222 | #define DEBUG_THREAD_DELETE 0 |
---|
| 223 | #define DEBUG_THREAD_DESTROY 0 |
---|
| 224 | #define DEBUG_THREAD_GET_XPTR 0 |
---|
| 225 | #define DEBUG_THREAD_IDLE 0 |
---|
| 226 | #define DEBUG_THREAD_INIT 0 |
---|
| 227 | #define DEBUG_THREAD_KERNEL_CREATE 0 |
---|
| 228 | #define DEBUG_THREAD_USER_CREATE 0 |
---|
| 229 | #define DEBUG_THREAD_USER_FORK 0 |
---|
| 230 | #define DEBUG_THREAD_USER_EXEC 0 |
---|
[439] | 231 | |
---|
[614] | 232 | #define DEBUG_USER_DIR 0 |
---|
[612] | 233 | |
---|
[634] | 234 | #define DEBUG_VFS_ADD_CHILD 0 |
---|
[614] | 235 | #define DEBUG_VFS_ADD_SPECIAL 0 |
---|
[611] | 236 | #define DEBUG_VFS_CHDIR 0 |
---|
[607] | 237 | #define DEBUG_VFS_CLOSE 0 |
---|
[635] | 238 | #define DEBUG_VFS_DENTRY_CREATE 0 |
---|
[610] | 239 | #define DEBUG_VFS_FILE_CREATE 0 |
---|
| 240 | #define DEBUG_VFS_GET_PATH 0 |
---|
[607] | 241 | #define DEBUG_VFS_INODE_CREATE 0 |
---|
| 242 | #define DEBUG_VFS_INODE_LOAD_ALL 0 |
---|
[625] | 243 | #define DEBUG_VFS_KERNEL_MOVE 0 |
---|
[610] | 244 | #define DEBUG_VFS_LINK 0 |
---|
[611] | 245 | #define DEBUG_VFS_LOOKUP 0 |
---|
[607] | 246 | #define DEBUG_VFS_LSEEK 0 |
---|
[611] | 247 | #define DEBUG_VFS_MKDIR 0 |
---|
[625] | 248 | #define DEBUG_VFS_NEW_DENTRY_INIT 0 |
---|
[607] | 249 | #define DEBUG_VFS_OPEN 0 |
---|
[614] | 250 | #define DEBUG_VFS_OPENDIR 0 |
---|
[607] | 251 | #define DEBUG_VFS_STAT 0 |
---|
[625] | 252 | #define DEBUG_VFS_USER_MOVE 0 |
---|
[624] | 253 | #define DEBUG_VFS_UNLINK 0 |
---|
[439] | 254 | |
---|
[607] | 255 | #define DEBUG_VMM_CREATE_VSEG 0 |
---|
[611] | 256 | #define DEBUG_VMM_DELETE_VSEG 0 |
---|
[607] | 257 | #define DEBUG_VMM_DESTROY 0 |
---|
| 258 | #define DEBUG_VMM_FORK_COPY 0 |
---|
[634] | 259 | #define DEBUG_VMM_GET_ONE_PPN 0 |
---|
[607] | 260 | #define DEBUG_VMM_GET_PTE 0 |
---|
[640] | 261 | #define DEBUG_VMM_GLOBAL_DELETE_VSEG 0 |
---|
| 262 | #define DEBUG_VMM_GLOBAL_RESIZE_VSEG 0 |
---|
[635] | 263 | #define DEBUG_VMM_HANDLE_PAGE_FAULT 0 |
---|
[607] | 264 | #define DEBUG_VMM_HANDLE_COW 0 |
---|
[614] | 265 | #define DEBUG_VMM_MMAP_ALLOC 0 |
---|
[634] | 266 | #define DEBUG_VMM_PAGE_ALLOCATE 0 |
---|
[625] | 267 | #define DEBUG_VMM_REMOVE_VSEG 0 |
---|
[623] | 268 | #define DEBUG_VMM_RESIZE_VSEG 0 |
---|
[607] | 269 | #define DEBUG_VMM_SET_COW 0 |
---|
| 270 | #define DEBUG_VMM_UPDATE_PTE 0 |
---|
[625] | 271 | #define DEBUG_VMM_USER_INIT 0 |
---|
| 272 | #define DEBUG_VMM_USER_RESET 0 |
---|
[439] | 273 | |
---|
[607] | 274 | #define DEBUG_XHTAB 0 |
---|
[440] | 275 | |
---|
[569] | 276 | |
---|
[439] | 277 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[569] | 278 | // KERNEL LOCKS TYPES MNEMONICS (for debug) |
---|
| 279 | // It must be kept consistent with the lock_name[] array defined in kernel_init.c file. |
---|
| 280 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 281 | |
---|
| 282 | #define LOCK_CLUSTER_KCM 1 // local (B) protect dynamic KCM creation in cluster |
---|
[632] | 283 | #define LOCK_SCHED_STATE 2 // local (B) protect scheduler state for given core |
---|
| 284 | #define LOCK_VMM_STACK 3 // local (B) protect VMM stack vseg allocator |
---|
| 285 | #define LOCK_VMM_MMAP 4 // local (B) protect VMM mmap vseg allocator |
---|
| 286 | #define LOCK_VFS_CTX 5 // local (B) protect vfs context state |
---|
| 287 | #define LOCK_KCM_STATE 6 // local (B) protect KCM allocator state |
---|
| 288 | #define LOCK_KHM_STATE 7 // local (B) protect KHM allocator state |
---|
| 289 | #define LOCK_HTAB_STATE 8 // local (B) protect a local htab state |
---|
[569] | 290 | |
---|
[632] | 291 | #define LOCK_PPM_FREE 9 // remote (B) protect PPM allocator free_pages lists |
---|
[569] | 292 | #define LOCK_THREAD_JOIN 10 // remote (B) protect join/exit between two threads |
---|
[610] | 293 | #define LOCK_XHTAB_STATE 11 // remote (B) protect a distributed xhtab state |
---|
[569] | 294 | #define LOCK_CHDEV_QUEUE 12 // remote (B) protect chdev threads waiting queue |
---|
| 295 | #define LOCK_CHDEV_TXT0 13 // remote (B) protect access to kernel terminal TXT0 |
---|
| 296 | #define LOCK_CHDEV_TXTLIST 14 // remote (B) protect xlist of processes using same TXT |
---|
| 297 | #define LOCK_PAGE_STATE 15 // remote (B) protect physical page descriptor state |
---|
| 298 | #define LOCK_MUTEX_STATE 16 // remote (B) protect user mutex state |
---|
| 299 | #define LOCK_CONDVAR_STATE 17 // remote (B) protect user condvar state |
---|
| 300 | #define LOCK_SEM_STATE 18 // remote (B) protect user semaphore state |
---|
[610] | 301 | #define LOCK_PROCESS_CWD 19 // remote (B) protect current working directory in process |
---|
[619] | 302 | #define LOCK_BARRIER_STATE 20 // remote (B) protect user barrier state |
---|
[569] | 303 | |
---|
| 304 | #define LOCK_CLUSTER_PREFTBL 21 // local (Q) protect array of ref. processes in cluster |
---|
| 305 | |
---|
[607] | 306 | #define LOCK_PPM_DIRTY 22 // remote (Q) protect PPM dirty_pages list |
---|
[569] | 307 | #define LOCK_CLUSTER_LOCALS 23 // remote (Q) protect xlist of local processes in cluster |
---|
| 308 | #define LOCK_CLUSTER_COPIES 24 // remote (Q) protect xlist of process copies in cluster |
---|
| 309 | #define LOCK_PROCESS_CHILDREN 25 // remote (Q) protect xlist of chidren process in process |
---|
[619] | 310 | #define LOCK_PROCESS_USERSYNC 26 // remote (Q) protect lists of user synchros in process |
---|
[569] | 311 | #define LOCK_PROCESS_FDARRAY 27 // remote (Q) protect array of open files in owner process |
---|
[628] | 312 | #define LOCK_PROCESS_DIR 28 // remote (Q) protect xlist of open directories in process |
---|
[640] | 313 | #define LOCK_VMM_VSL 29 // remote (Q) protect VSL (local list of vsegs) |
---|
[569] | 314 | |
---|
[611] | 315 | #define LOCK_PROCESS_THTBL 30 // local (RW) protect local array of threads in a process |
---|
[569] | 316 | |
---|
[611] | 317 | #define LOCK_MAPPER_STATE 31 // remote (RW) protect mapper state |
---|
| 318 | #define LOCK_VFS_SIZE 32 // remote (RW) protect inode state and associated mapper |
---|
| 319 | #define LOCK_VFS_FILE 33 // remote (RW) protect file descriptor state |
---|
[640] | 320 | #define LOCK_VFS_MAIN 34 // remote (RW) protect vfs traversal (in root inode) |
---|
| 321 | #define LOCK_FATFS_FAT 35 // remote (RW) protect exclusive access to the FATFS FAT |
---|
[569] | 322 | |
---|
[635] | 323 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 324 | // GENERAL CONFIGURATION |
---|
| 325 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[590] | 326 | |
---|
[635] | 327 | #define CONFIG_VERSION "Version 2.2 / June 2019" |
---|
| 328 | |
---|
[569] | 329 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[439] | 330 | // HARDWARE CONFIGURATION |
---|
| 331 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 332 | |
---|
| 333 | #define CONFIG_KERNEL_IDENTITY_MAP true // True for 32 bits cores |
---|
[569] | 334 | #define CONFIG_MAX_CLUSTERS_X 16 // max number of clusters in row |
---|
| 335 | #define CONFIG_MAX_CLUSTERS_Y 16 // max number of clusters in column |
---|
| 336 | #define CONFIG_MAX_CLUSTERS (CONFIG_MAX_CLUSTERS_X * CONFIG_MAX_CLUSTERS_Y) |
---|
[439] | 337 | #define CONFIG_MAX_LOCAL_CORES 4 // max number of cores per cluster |
---|
| 338 | #define CONFIG_MAX_INT_DEV 4 // max number of internal peripherals |
---|
| 339 | #define CONFIG_MAX_EXT_DEV 8 // max number of external peripherals |
---|
[569] | 340 | #define CONFIG_MAX_INTERNAL_IRQS 32 // max number of internal IRQs |
---|
| 341 | #define CONFIG_MAX_EXTERNAL_IRQS 32 // max number of external IRQs |
---|
[439] | 342 | #define CONFIG_IRQS_PER_CORE 4 // number of input IRQs per core |
---|
| 343 | #define CONFIG_CLUSTER_SPAN 32 // ln(phys. address space per cluster) |
---|
| 344 | #define CONFIG_CACHE_LINE_SIZE 64 // number of bytes in cache line |
---|
| 345 | |
---|
| 346 | #define CONFIG_CACHE_LINE_ALIGNED __attribute__((aligned(CONFIG_CACHE_LINE_SIZE))) |
---|
| 347 | |
---|
| 348 | #define CONFIG_MAX_IOC_CHANNELS 1 // max number of IOC device channels |
---|
| 349 | #define CONFIG_MAX_FBF_CHANNELS 1 // max number of FBF device channels |
---|
| 350 | #define CONFIG_MAX_TXT_CHANNELS 8 // max number of TXT device channels |
---|
| 351 | #define CONFIG_MAX_DMA_CHANNELS 4 // max number of DMA device channels |
---|
| 352 | #define CONFIG_MAX_NIC_CHANNELS 4 // max number of NIC device channels |
---|
| 353 | |
---|
| 354 | #define CONFIG_TXT_ECHO_MODE 1 // echo mode for TXT peripheral |
---|
[443] | 355 | #define CONFIG_TXT_KBUF_SIZE 512 // kernel buffer for TXT write |
---|
[439] | 356 | |
---|
| 357 | #define CONFIG_FBF_WIDTH 128 |
---|
| 358 | #define CONFIG_FBF_HEIGHT 128 |
---|
| 359 | |
---|
| 360 | #define CONFIG_CPU_CTX_SIZE 256 // up to 64 uint32_t registers |
---|
| 361 | #define CONFIG_FPU_CTX_SIZE 256 // up to 32 uint64_t registers |
---|
| 362 | #define CONFIG_NIC_CHBUF_DEPTH 1 // number of containers in NIC chbuf |
---|
| 363 | |
---|
| 364 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 365 | // PROCESS MANAGEMENT |
---|
| 366 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 367 | |
---|
[607] | 368 | #define CONFIG_MAX_PROCESS_PER_CLUSTER 16 // max number of owned process |
---|
| 369 | #define CONFIG_PROCESS_FILE_MAX_NR 16 // max number of open files |
---|
[439] | 370 | #define CONFIG_PROCESS_MAX_CHILDREN 1024 // max number of children process |
---|
| 371 | #define CONFIG_PROCESS_HEAP_MIN_SIZE 0x00010000 // user heap min size (bytes) |
---|
| 372 | #define CONFIG_PROCESS_HEAP_MAX_SIZE 0x30000000 // user heap max size (bytes) |
---|
| 373 | #define CONFIG_PROCESS_INIT_PATH "/bin/user/init.elf" |
---|
| 374 | |
---|
| 375 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 376 | // VIRTUAL FILE SYSTEM |
---|
| 377 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 378 | |
---|
| 379 | #define CONFIG_VFS_MAX_INODES 128 // max number of inodes per cluster |
---|
[611] | 380 | #define CONFIG_VFS_MAX_NAME_LENGTH 56 // dentry name max length (bytes) |
---|
[439] | 381 | #define CONFIG_VFS_MAX_PATH_LENGTH 256 // pathname max length (bytes) |
---|
[607] | 382 | #define CONFIG_VFS_FREE_CLUSTERS_MIN 32 // min number of free clusters |
---|
[611] | 383 | #define CONFIG_VFS_MAX_DENTRIES 63 // max number of dentries in one dir |
---|
[439] | 384 | |
---|
| 385 | #define CONFIG_VFS_ROOT_IS_FATFS 1 // root FS is FATFS if non zero |
---|
| 386 | #define CONFIG_VFS_ROOT_IS_EX2FS 0 // root FS is EX2FS if non zero |
---|
| 387 | |
---|
[635] | 388 | #define CONFIG_MAPPER_GRDXT_W1 6 // number of bits for RADIX_TREE_IX1 |
---|
| 389 | #define CONFIG_MAPPER_GRDXT_W2 7 // number of bits for RADIX_TREE_IX2 |
---|
| 390 | #define CONFIG_MAPPER_GRDXT_W3 7 // number of bits for RADIX_TREE_IX3 |
---|
[614] | 391 | |
---|
[439] | 392 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 393 | // DQDT |
---|
| 394 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 395 | |
---|
| 396 | #define CONFIG_DQDT_LEVELS_NR 5 |
---|
| 397 | #define CONFIG_DQDT_TICKS_PER_QUANTUM 1 // number of ticks between updates |
---|
| 398 | |
---|
| 399 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 400 | // RANDOM NUMBERS |
---|
| 401 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 402 | |
---|
| 403 | #define CONFIG_RDNG_PARAM_A 65519 |
---|
| 404 | #define CONFIG_RDNG_PARAM_C 64037 |
---|
| 405 | |
---|
| 406 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 407 | // SCHEDULING |
---|
| 408 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 409 | |
---|
| 410 | #define CONFIG_SCHED_TICK_MS_PERIOD 10000 // number of milliseconds per period |
---|
| 411 | #define CONFIG_SCHED_TICKS_PER_QUANTUM 1 // number of ticks between scheduling |
---|
| 412 | #define CONFIG_SCHED_MAX_THREADS_NR 32 // max number of threads per core |
---|
[590] | 413 | #define CONFIG_SCHED_IDLE_MODE_SLEEP 0 // idle thread use sleep mode if non 0 |
---|
[439] | 414 | |
---|
| 415 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 416 | // THREADS |
---|
| 417 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 418 | |
---|
[590] | 419 | #define CONFIG_THREADS_MAX_PER_CLUSTER 32 // max threads per cluster per process |
---|
[439] | 420 | #define CONFIG_THREAD_DESC_SIZE 0x4000 // thread desc size (with kernel stack) |
---|
| 421 | #define CONFIG_THREAD_DESC_ORDER 2 // ln( number of 4K pages ) |
---|
| 422 | |
---|
| 423 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 424 | // REMOTE PROCEDURE CALL |
---|
| 425 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 426 | |
---|
| 427 | #define CONFIG_REMOTE_FIFO_SLOTS 16 |
---|
| 428 | #define CONFIG_REMOTE_FIFO_MAX_ITERATIONS 1024 |
---|
[440] | 429 | #define CONFIG_RPC_THREADS_MAX 4 // max number of RPC threads per core |
---|
[439] | 430 | |
---|
| 431 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[624] | 432 | // 32 bits USER SPACE SEGMENTATION / all values are numbers of pages |
---|
[439] | 433 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 434 | |
---|
| 435 | #define CONFIG_VMM_VSPACE_SIZE 0x100000 // virtual space : 4 Gbytes |
---|
| 436 | |
---|
[624] | 437 | #define CONFIG_VMM_UTILS_BASE 0x000200 // UTILS zone base : 2 Mbytes |
---|
[439] | 438 | #define CONFIG_VMM_ELF_BASE 0x000400 // ELF zone base : 4 Mbytes |
---|
| 439 | #define CONFIG_VMM_HEAP_BASE 0x002000 // HEAP zone base : 32 Mbytes |
---|
[579] | 440 | #define CONFIG_VMM_STACK_BASE 0x0C0000 // STACK zone base : 3 Gbytes |
---|
[439] | 441 | |
---|
| 442 | #define CONFIG_VMM_ARGS_SIZE 0x000004 // args vseg size : 16 Kbytes |
---|
| 443 | #define CONFIG_VMM_ENVS_SIZE 0x000008 // envs vseg size : 32 Kbytes |
---|
[625] | 444 | #define CONFIG_VMM_STACK_SIZE 0x001000 // single stack vseg size : 16 Mbytes |
---|
[439] | 445 | |
---|
| 446 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[619] | 447 | // PHYSICAL MEMORY MANAGEMENT |
---|
[439] | 448 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 449 | |
---|
| 450 | #define CONFIG_PPM_PAGE_SIZE 4096 // physical page size (bytes) |
---|
| 451 | #define CONFIG_PPM_PAGE_SHIFT 12 // physical page shift (bits) |
---|
| 452 | #define CONFIG_PPM_PAGE_MASK 0x00000FFF // physical page mask |
---|
| 453 | #define CONFIG_PPM_MAX_ORDER 16 // ln(total number of pages per cluster) |
---|
| 454 | #define CONFIG_PPM_HEAP_ORDER 10 // ln(number of heap pages per cluster) |
---|
| 455 | #define CONFIG_PPM_MAX_RSVD 32 // max reserved zones on the machine |
---|
| 456 | |
---|
| 457 | #define CONFIG_PPM_PAGE_ALIGNED __attribute__((aligned(CONFIG_PPM_PAGE_SIZE))) |
---|
| 458 | |
---|
| 459 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
[569] | 460 | // INSTRUMENTATION |
---|
[439] | 461 | //////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 462 | |
---|
[635] | 463 | #define CONFIG_INSTRUMENTATION_SYSCALLS 0 |
---|
[637] | 464 | #define CONFIG_INSTRUMENTATION_PGFAULTS 0 |
---|
| 465 | #define CONFIG_INSTRUMENTATION_FOOTPRINT 0 |
---|
[640] | 466 | #define CONFIG_INSTRUMENTATION_GPT 1 |
---|
[439] | 467 | |
---|
| 468 | |
---|
| 469 | |
---|
| 470 | |
---|
| 471 | #endif /* _KERNEL_CONFIG_H_ */ |
---|