rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2005 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | |
| 36 | /***************************************************************************** |
| 37 | * |
| 38 | * Filename: |
| 39 | * --------- |
| 40 | * syscomp_config.c |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * Maui_Software |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * The file contains definition of system component module configuration |
| 49 | * variables, and routines. |
| 50 | * |
| 51 | * Author: |
| 52 | * ------- |
| 53 | * ------- |
| 54 | * |
| 55 | *============================================================================ |
| 56 | * HISTORY |
| 57 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 58 | *------------------------------------------------------------------------------ |
| 59 | * removed! |
| 60 | * removed! |
| 61 | * removed! |
| 62 | * |
| 63 | * removed! |
| 64 | * removed! |
| 65 | * removed! |
| 66 | * |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * removed! |
| 70 | * removed! |
| 71 | * |
| 72 | * removed! |
| 73 | * removed! |
| 74 | * removed! |
| 75 | * |
| 76 | * removed! |
| 77 | * removed! |
| 78 | * removed! |
| 79 | * removed! |
| 80 | * |
| 81 | * removed! |
| 82 | * removed! |
| 83 | * removed! |
| 84 | * |
| 85 | * removed! |
| 86 | * removed! |
| 87 | * removed! |
| 88 | * |
| 89 | * removed! |
| 90 | * removed! |
| 91 | * removed! |
| 92 | * removed! |
| 93 | * |
| 94 | * removed! |
| 95 | * removed! |
| 96 | * removed! |
| 97 | * |
| 98 | * removed! |
| 99 | * removed! |
| 100 | * removed! |
| 101 | * |
| 102 | * removed! |
| 103 | * removed! |
| 104 | * removed! |
| 105 | * |
| 106 | * removed! |
| 107 | * removed! |
| 108 | * removed! |
| 109 | * |
| 110 | * removed! |
| 111 | * removed! |
| 112 | * removed! |
| 113 | * removed! |
| 114 | * |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * removed! |
| 118 | * |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * removed! |
| 122 | * |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * removed! |
| 126 | * |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * removed! |
| 130 | * |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * removed! |
| 134 | * |
| 135 | * removed! |
| 136 | * removed! |
| 137 | * removed! |
| 138 | * removed! |
| 139 | * |
| 140 | * removed! |
| 141 | * removed! |
| 142 | * removed! |
| 143 | * removed! |
| 144 | * |
| 145 | * removed! |
| 146 | * removed! |
| 147 | * removed! |
| 148 | * removed! |
| 149 | * |
| 150 | * removed! |
| 151 | * removed! |
| 152 | * removed! |
| 153 | * removed! |
| 154 | * |
| 155 | * removed! |
| 156 | * removed! |
| 157 | * |
| 158 | * removed! |
| 159 | * removed! |
| 160 | * removed! |
| 161 | * |
| 162 | * removed! |
| 163 | * removed! |
| 164 | * removed! |
| 165 | * |
| 166 | * removed! |
| 167 | * removed! |
| 168 | * removed! |
| 169 | * |
| 170 | * removed! |
| 171 | * removed! |
| 172 | * |
| 173 | * removed! |
| 174 | * removed! |
| 175 | * removed! |
| 176 | * |
| 177 | * removed! |
| 178 | * removed! |
| 179 | * removed! |
| 180 | * |
| 181 | * removed! |
| 182 | * removed! |
| 183 | * removed! |
| 184 | * |
| 185 | * removed! |
| 186 | * removed! |
| 187 | * removed! |
| 188 | * |
| 189 | * removed! |
| 190 | * removed! |
| 191 | * removed! |
| 192 | * |
| 193 | * removed! |
| 194 | * removed! |
| 195 | * removed! |
| 196 | * |
| 197 | * removed! |
| 198 | * removed! |
| 199 | * removed! |
| 200 | * |
| 201 | * removed! |
| 202 | * removed! |
| 203 | * |
| 204 | * removed! |
| 205 | * removed! |
| 206 | * removed! |
| 207 | * |
| 208 | * removed! |
| 209 | * removed! |
| 210 | * removed! |
| 211 | * |
| 212 | * removed! |
| 213 | * removed! |
| 214 | * removed! |
| 215 | * |
| 216 | * removed! |
| 217 | * removed! |
| 218 | * removed! |
| 219 | * |
| 220 | * removed! |
| 221 | * removed! |
| 222 | * removed! |
| 223 | * |
| 224 | * removed! |
| 225 | * removed! |
| 226 | * removed! |
| 227 | * |
| 228 | * removed! |
| 229 | * removed! |
| 230 | * removed! |
| 231 | * |
| 232 | * removed! |
| 233 | * removed! |
| 234 | * removed! |
| 235 | * |
| 236 | * removed! |
| 237 | * removed! |
| 238 | * removed! |
| 239 | * |
| 240 | * removed! |
| 241 | * removed! |
| 242 | * removed! |
| 243 | * |
| 244 | * removed! |
| 245 | * removed! |
| 246 | * removed! |
| 247 | * |
| 248 | * removed! |
| 249 | * removed! |
| 250 | * removed! |
| 251 | * |
| 252 | * removed! |
| 253 | * removed! |
| 254 | * removed! |
| 255 | * |
| 256 | * removed! |
| 257 | * removed! |
| 258 | * removed! |
| 259 | * |
| 260 | * removed! |
| 261 | * removed! |
| 262 | * removed! |
| 263 | * |
| 264 | * removed! |
| 265 | * removed! |
| 266 | * removed! |
| 267 | * |
| 268 | * removed! |
| 269 | * removed! |
| 270 | * removed! |
| 271 | * |
| 272 | * removed! |
| 273 | * removed! |
| 274 | * removed! |
| 275 | * |
| 276 | * removed! |
| 277 | * removed! |
| 278 | * removed! |
| 279 | * |
| 280 | * removed! |
| 281 | * removed! |
| 282 | * removed! |
| 283 | * |
| 284 | * removed! |
| 285 | * removed! |
| 286 | * removed! |
| 287 | * |
| 288 | * removed! |
| 289 | * removed! |
| 290 | * removed! |
| 291 | * removed! |
| 292 | * removed! |
| 293 | * removed! |
| 294 | * removed! |
| 295 | * removed! |
| 296 | * removed! |
| 297 | * removed! |
| 298 | * removed! |
| 299 | * removed! |
| 300 | * removed! |
| 301 | * removed! |
| 302 | * removed! |
| 303 | * |
| 304 | * removed! |
| 305 | * removed! |
| 306 | * removed! |
| 307 | * |
| 308 | * removed! |
| 309 | * removed! |
| 310 | * removed! |
| 311 | * |
| 312 | * removed! |
| 313 | * removed! |
| 314 | * removed! |
| 315 | * removed! |
| 316 | * removed! |
| 317 | *------------------------------------------------------------------------------ |
| 318 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 319 | *============================================================================ |
| 320 | ****************************************************************************/ |
| 321 | |
| 322 | /************************************************************************* |
| 323 | * Include Statements |
| 324 | *************************************************************************/ |
| 325 | #include "syscomp_config.h" |
| 326 | #include "task_config.h" |
| 327 | #include "kal_general_types.h" |
| 328 | #include "stack_config.h" |
| 329 | #include "kal_public_defs.h" |
| 330 | #include "hisr_config.h" |
| 331 | #include "intrCtrl.h" |
| 332 | |
| 333 | #include "ctrl_buff_pool.h" |
| 334 | #include "event_shed.h" |
| 335 | //#include "page.h" |
| 336 | #include "module_hisrid_range.h" |
| 337 | #include "kal_internal_def.h" |
| 338 | #include "module_id_range.h" |
| 339 | |
| 340 | #define I_C_C_H_ // Ugly hack. Fix this. |
| 341 | #include "kal_os.h" |
| 342 | #include "kal_debug_common_defs.h" |
| 343 | #include "kal_internal_api.h" |
| 344 | #include "mof_config.h" |
| 345 | |
| 346 | #undef TASK_PRIORITY_MACRO |
| 347 | |
| 348 | #undef task_name |
| 349 | #undef task_queue_name |
| 350 | #undef task_priority |
| 351 | #undef task_stack_size |
| 352 | #undef null_task_create_entry |
| 353 | #undef compatible_code |
| 354 | #undef task_create_function |
| 355 | #undef task_stack_internalRAM |
| 356 | #undef task_external_queue_size |
| 357 | #undef task_internal_queue_size |
| 358 | #undef task_boot_mode |
| 359 | #undef task_affinity_group |
| 360 | #undef task_affinity_group_id |
| 361 | #undef MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM |
| 362 | #undef MODULE_ID_FOR_PRINT_TRACE |
| 363 | #undef task_index |
| 364 | #undef task_module_map |
| 365 | |
| 366 | |
| 367 | /*Reset the macro in case of side effect*/ |
| 368 | #define task_name(p1) |
| 369 | #define task_queue_name(p1) |
| 370 | #define task_priority(p1, p2) |
| 371 | #define task_stack_size(p1) |
| 372 | #define null_task_create_entry(p1) |
| 373 | #define compatible_code(p1) |
| 374 | #define task_stack_internalRAM(p1) |
| 375 | #define task_external_queue_size(p1) |
| 376 | #define task_internal_queue_size(p1) |
| 377 | #define task_boot_mode(p1) |
| 378 | #define task_affinity_group(p1) |
| 379 | #define task_affinity_group_id(p1) |
| 380 | #define MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM(p1) |
| 381 | #define MODULE_ID_FOR_PRINT_TRACE(p1) |
| 382 | #define task_index(p1) |
| 383 | #define task_module_map(p1, p2) |
| 384 | |
| 385 | #define task_create_function(task_create_entry) \ |
| 386 | extern kal_bool task_create_entry(comptask_handler_struct **); |
| 387 | |
| 388 | #include "srv_task_config.h" |
| 389 | #include "modem_2g3g_task_config.h" |
| 390 | #include "modem_4g_task_config.h" |
| 391 | #include "modem_5g_task_config.h" |
| 392 | #include "middleWare_task_config.h" |
| 393 | #include "drv_task_config.h" |
| 394 | |
| 395 | #undef task_create_function |
| 396 | |
| 397 | /************************************************************************* |
| 398 | * define global variables to replace config internal macro |
| 399 | * **********************************************************************/ |
| 400 | const kal_uint32 total_stack_tasks = RPS_TOTAL_STACK_TASKS; |
| 401 | #if !defined(KTEST_RTOS_TEST) |
| 402 | const kal_uint32 total_stack_modules = RPS_TOTAL_STACK_MODULES; |
| 403 | #endif /*#if !defined(KTEST_RTOS_TEST) */ |
| 404 | const kal_uint32 last_of_module_id = LAST_MOD_ID; |
| 405 | const kal_uint32 end_of_module_id = END_OF_MOD_ID; |
| 406 | /***********************************************************************/ |
| 407 | #undef task_name |
| 408 | #undef task_queue_name |
| 409 | #undef task_priority |
| 410 | #undef task_stack_size |
| 411 | #undef null_task_create_entry |
| 412 | #undef compatible_code |
| 413 | #undef task_create_function |
| 414 | #undef task_stack_internalRAM |
| 415 | #undef task_external_queue_size |
| 416 | #undef task_internal_queue_size |
| 417 | #undef task_boot_mode |
| 418 | #undef task_affinity_group |
| 419 | #undef task_affinity_group_id |
| 420 | #undef MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM |
| 421 | #undef MODULE_ID_FOR_PRINT_TRACE |
| 422 | #undef task_index |
| 423 | #undef task_module_map |
| 424 | |
| 425 | #define task_name(p1) |
| 426 | #define task_queue_name(p1) |
| 427 | #define task_priority(p1, p2) |
| 428 | #define task_stack_size(p1) |
| 429 | #define null_task_create_entry(p1) |
| 430 | #define compatible_code(p1) |
| 431 | #define task_create_function(p1) |
| 432 | #define task_stack_internalRAM(p1) |
| 433 | #define task_external_queue_size(p1) |
| 434 | #define task_internal_queue_size(p1) |
| 435 | #define task_boot_mode(p1) |
| 436 | #define task_affinity_group(p1) |
| 437 | #define task_affinity_group_id(p1) |
| 438 | #define task_index(p1) |
| 439 | |
| 440 | #define task_module_map(task, mod) task, |
| 441 | #define MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM(p1) INDX_NIL, |
| 442 | #define MODULE_ID_FOR_PRINT_TRACE(p1) INDX_NIL, |
| 443 | |
| 444 | #if !defined(KTEST_RTOS_TEST) |
| 445 | /**RPS_TOTAL_STACK_MODULES: boundary check when access mod_task_g*/ |
| 446 | kal_uint32 mod_task_g[RPS_TOTAL_STACK_MODULES] = { |
| 447 | #include "srv_task_config.h" |
| 448 | #include "modem_2g3g_task_config.h" |
| 449 | #include "modem_4g_task_config.h" |
| 450 | #include "modem_5g_task_config.h" |
| 451 | #include "middleWare_task_config.h" |
| 452 | #include "drv_task_config.h" |
| 453 | }; |
| 454 | #endif /*#if !defined(KTEST_RTOS_TEST) */ |
| 455 | /************************************************************************* |
| 456 | * Total HISR number boundary check |
| 457 | * Don't use this array in your code |
| 458 | *************************************************************************/ |
| 459 | /* if you change KAL_MAX_NUM_HISRS, please also modify INDX_NIL number in mod_task_g[]*/ |
| 460 | /* if you change KAL_MAX_NUM_HISRS, please also modify MOD_ID_HISR_CODE_TAIL in MODULE_ID_TYPE*/ |
| 461 | /* if you change KAL_MAX_NUM_HISRS, please also modify HISR_ID_CODE_MAX in HISR_ID_CODE_BEGIN*/ |
| 462 | #define HISR_MOD_NUMBER (MOD_ID_HISR_CODE_TAIL - MOD_ID_HISR_CODE_BEGIN - 1) |
| 463 | typedef unsigned int hisr_mod_max_num_check1[HISR_MOD_NUMBER - KAL_MAX_NUM_HISRS |
| 464 | #if !defined(__MTK_TARGET__) |
| 465 | + 1 |
| 466 | #endif |
| 467 | ]; |
| 468 | typedef unsigned int hisr_mod_max_num_check2[KAL_MAX_NUM_HISRS - HISR_MOD_NUMBER |
| 469 | #if !defined(__MTK_TARGET__) |
| 470 | + 1 |
| 471 | #endif |
| 472 | ]; |
| 473 | |
| 474 | #undef task_name |
| 475 | #undef task_queue_name |
| 476 | #undef task_priority |
| 477 | #undef task_stack_size |
| 478 | #undef task_create_function |
| 479 | #undef compatible_code |
| 480 | #undef null_task_create_entry |
| 481 | #undef task_stack_internalRAM |
| 482 | #undef task_external_queue_size |
| 483 | #undef task_internal_queue_size |
| 484 | #undef task_boot_mode |
| 485 | #undef task_affinity_group |
| 486 | #undef task_affinity_group_id |
| 487 | #undef MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM |
| 488 | #undef MODULE_ID_FOR_PRINT_TRACE |
| 489 | #undef task_index |
| 490 | #undef task_module_map |
| 491 | |
| 492 | |
| 493 | #define task_index(p1) |
| 494 | #define task_module_map(p1, p2) |
| 495 | #define compatible_code(p1) |
| 496 | #define MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM(p1) |
| 497 | #define MODULE_ID_FOR_PRINT_TRACE(p1) |
| 498 | |
| 499 | /* clang-format off */ |
| 500 | #define task_name(p1) {p1, |
| 501 | #define task_queue_name(p1) p1, |
| 502 | #define task_priority(p1, p2) ((p1<<16) | (p2 & 0x0000ffff)), |
| 503 | #define task_stack_size(p1) KAL_STACK_ALIGN(p1 + TASK_STACK_COMMON_PLUS), |
| 504 | #define null_task_create_entry(p1) (kal_create_func_ptr)TASK_NO_CREATE_PATTERN, |
| 505 | #define task_create_function(p1) p1, |
| 506 | #define task_stack_internalRAM(p1) p1, |
| 507 | #define task_external_queue_size(p1) p1, |
| 508 | #define task_internal_queue_size(p1) p1, |
| 509 | #define task_boot_mode(p1) p1, |
| 510 | #define task_affinity_group(p1) (p1)&(~AFFINITY_DYNAMIC), ((p1)&AFFINITY_DYNAMIC ? KAL_TRUE : KAL_FALSE), |
| 511 | #define task_affinity_group_id(p1) p1}, |
| 512 | |
| 513 | const comptask_info_struct sys_comp_config_tbl[] = { |
| 514 | #include "srv_task_config.h" |
| 515 | #include "modem_2g3g_task_config.h" |
| 516 | #include "modem_4g_task_config.h" |
| 517 | #include "modem_5g_task_config.h" |
| 518 | #include "middleWare_task_config.h" |
| 519 | #include "drv_task_config.h" |
| 520 | }; |
| 521 | |
| 522 | #define X_HISR_MOD(a,h) |
| 523 | #define X_HISR_CONST_WITH_AFFINITY(index, hisr_index, name, priority, stack, entry, option, affinity, queue_size) \ |
| 524 | {index, priority, option, queue_size, KAL_STACK_ALIGN(stack + HISR_STACK_COMMON_PLUS), entry, name, (affinity)&(~AFFINITY_DYNAMIC), ((affinity)&AFFINITY_DYNAMIC ? KAL_TRUE : KAL_FALSE)}, |
| 525 | |
| 526 | const hisr_parameter_s hisr_info[] = { |
| 527 | #include "hisr_config_internal.h" |
| 528 | }; |
| 529 | #undef X_HISR_CONST_WITH_AFFINITY |
| 530 | #undef X_HISR_MOD |
| 531 | |
| 532 | /*for mof config */ |
| 533 | #undef MOF_ID_MAP |
| 534 | #define MOF_ID_MAP(a,b) {a}, |
| 535 | const mof_info_struct mof_array[]= { |
| 536 | #include "modem_mof_config.h" |
| 537 | }; |
| 538 | #undef MOF_ID_MAP |
| 539 | |
| 540 | /*to move kal_init_hisr from config folder ,we difine totol_hisr to avoid */ |
| 541 | const kal_uint32 total_hisr_g = sizeof(hisr_info) / sizeof(hisr_parameter_s); |
| 542 | const kal_uint32 cfg_hisr_priority_max = |
| 543 | #if defined(KAL_ON_MERTOS) |
| 544 | 3; |
| 545 | #else |
| 546 | 0; |
| 547 | #endif |
| 548 | /* clang-format on */ |
| 549 | |
| 550 | #ifdef __MTK_TARGET__ |
| 551 | |
| 552 | #define X_TASK_CLEAN_CONST(index, handler, option) extern void handler(void); |
| 553 | #include "modem_task_clean_config.h" |
| 554 | |
| 555 | #undef X_TASK_CLEAN_CONST |
| 556 | |
| 557 | #define X_TASK_CLEAN_CONST(index, handler, option) \ |
| 558 | {index, handler, option, KAL_FALSE}, |
| 559 | |
| 560 | task_clean_s task_clean[] = { |
| 561 | #include "modem_task_clean_config.h" |
| 562 | }; |
| 563 | |
| 564 | #undef X_TASK_CLEAN_CONST |
| 565 | |
| 566 | const kal_uint32 total_task_clean_hdlrs = sizeof(task_clean) / sizeof(task_clean_s); |
| 567 | #else |
| 568 | |
| 569 | const kal_uint32 total_task_clean_hdlrs = 0; |
| 570 | |
| 571 | #endif |
| 572 | |
| 573 | /* |
| 574 | *The following code is for sys_mem_gen.pl and should never be linked |
| 575 | *into the final bin. The following code is actually usefull for |
| 576 | *sys_mem_gen.pl |
| 577 | */ |
| 578 | typedef struct { |
| 579 | kal_uint32 buf_size; |
| 580 | kal_uint16 buf_num; |
| 581 | } buffer_size_s; |
| 582 | #ifdef __MTK_TARGET__ |
| 583 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 584 | #endif /* __MTK_TARGET__ */ |
| 585 | const buffer_size_s cfg_ctrl_buff[] = { |
| 586 | {CTRL_BUFF_POOL_SIZE32, |
| 587 | (NUM_CTRL_BUFF_POOL_SIZE32 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE32)}, |
| 588 | {CTRL_BUFF_POOL_SIZE64, |
| 589 | (NUM_CTRL_BUFF_POOL_SIZE64 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE64)}, |
| 590 | {CTRL_BUFF_POOL_SIZE128, |
| 591 | (NUM_CTRL_BUFF_POOL_SIZE128 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE128)}, |
| 592 | {CTRL_BUFF_POOL_SIZE256, |
| 593 | (NUM_CTRL_BUFF_POOL_SIZE256 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE256)}, |
| 594 | {CTRL_BUFF_POOL_SIZE512, |
| 595 | (NUM_CTRL_BUFF_POOL_SIZE512 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE512)}, |
| 596 | {CTRL_BUFF_POOL_SIZE1024, |
| 597 | (NUM_CTRL_BUFF_POOL_SIZE1024 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE1024)}, |
| 598 | {CTRL_BUFF_POOL_SIZE2048, |
| 599 | (NUM_CTRL_BUFF_POOL_SIZE2048 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE2048)}, |
| 600 | {CTRL_BUFF_POOL_SIZE4096, |
| 601 | (NUM_CTRL_BUFF_POOL_SIZE4096 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE4096)}, |
| 602 | #if defined(__UMTS_RAT__) || defined(__LTE_RAT__) |
| 603 | {CTRL_BUFF_POOL_SIZE8192, |
| 604 | (NUM_CTRL_BUFF_POOL_SIZE8192 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE8192)}, |
| 605 | {CTRL_BUFF_POOL_SIZE16384, |
| 606 | (NUM_CTRL_BUFF_POOL_SIZE16384 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE16384)}, |
| 607 | {CTRL_BUFF_POOL_SIZE32768, |
| 608 | (NUM_CTRL_BUFF_POOL_SIZE32768 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE32768)}, |
| 609 | {CTRL_BUFF_POOL_SIZE65536, |
| 610 | (NUM_CTRL_BUFF_POOL_SIZE65536 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE65536)}, |
| 611 | {CTRL_BUFF_POOL_SIZE100000, |
| 612 | (NUM_CTRL_BUFF_POOL_SIZE100000 + NUM_CUSTOM_CTRL_BUFF_POOL_SIZE100000)}, |
| 613 | #endif |
| 614 | }; |
| 615 | |
| 616 | #ifdef __MTK_TARGET__ |
| 617 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 618 | #endif /* __MTK_TARGET__ */ |
| 619 | const kal_uint32 cfg_sys_vpe_num = SYS_MCU_NUM_VPE; |
| 620 | |
| 621 | #ifdef __MTK_TARGET__ |
| 622 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 623 | #endif /* __MTK_TARGET__ */ |
| 624 | #if defined(__CS_SERVICE__) && defined(__PS_SERVICE__) |
| 625 | const buffer_size_s cfg_data_buff[] = { |
| 626 | {0, 0}, |
| 627 | }; |
| 628 | #else |
| 629 | const buffer_size_s cfg_data_buff[] = { |
| 630 | {0, 0}, |
| 631 | }; |
| 632 | #endif |
| 633 | |
| 634 | #ifdef __MTK_TARGET__ |
| 635 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 636 | #endif /* __MTK_TARGET__ */ |
| 637 | const kal_uint32 cfg_itc_cb_size = sizeof(kal_itc_lock_s); |
| 638 | |
| 639 | #ifdef __MTK_TARGET__ |
| 640 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 641 | #endif /* __MTK_TARGET__ */ |
| 642 | const kal_uint32 cfg_itc_num_max = KAL_ITC_CORE012_SYNC + 1; |
| 643 | |
| 644 | #ifdef __MTK_TARGET__ |
| 645 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 646 | #endif /* __MTK_TARGET__ */ |
| 647 | const buffer_size_s cfg_event_buff[] = { |
| 648 | {sizeof(struct event), KAL_MIN_EVSHED_BUFF_NUM}, |
| 649 | }; |
| 650 | |
| 651 | #ifdef __MTK_TARGET__ |
| 652 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 653 | #endif /* __MTK_TARGET__ */ |
| 654 | const buffer_size_s cfg_module_number[] = { |
| 655 | {sizeof(struct ilm_struct), RPS_TOTAL_STACK_MODULES}, |
| 656 | }; |
| 657 | |
| 658 | #ifdef __MTK_TARGET__ |
| 659 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 660 | #endif /* __MTK_TARGET__ */ |
| 661 | #ifdef __SYS_INTERN_RAM__ |
| 662 | const kal_uint32 sys_internal_ram_defined = 1; |
| 663 | #else |
| 664 | const kal_uint32 sys_internal_ram_defined = 0; |
| 665 | #endif |
| 666 | |
| 667 | #ifdef __MTK_TARGET__ |
| 668 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 669 | #endif /* __MTK_TARGET__ */ |
| 670 | #ifdef DEBUG_BUF2 |
| 671 | const kal_uint32 debug_buf2 = 1; |
| 672 | #else |
| 673 | const kal_uint32 debug_buf2 = 0; |
| 674 | #endif |
| 675 | |
| 676 | #ifdef __MTK_TARGET__ |
| 677 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 678 | #endif /* __MTK_TARGET__ */ |
| 679 | #if defined(__LOW_COST_SUPPORT_ULC__) |
| 680 | const kal_uint32 cfg_low_cost_support = 2; |
| 681 | #else |
| 682 | const kal_uint32 cfg_low_cost_support = 0; |
| 683 | #endif |
| 684 | |
| 685 | #ifdef __MTK_TARGET__ |
| 686 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 687 | #endif /* __MTK_TARGET__ */ |
| 688 | #if (GEMINI_PLUS >= 4) |
| 689 | const kal_uint32 cfg_gemini = 4; |
| 690 | #elif (GEMINI_PLUS >= 3) |
| 691 | const kal_uint32 cfg_gemini = 3; |
| 692 | #elif (GEMINI_PLUS >= 2) |
| 693 | const kal_uint32 cfg_gemini = 2; |
| 694 | #else |
| 695 | const kal_uint32 cfg_gemini = 1; |
| 696 | #endif |
| 697 | |
| 698 | #ifdef __MTK_TARGET__ |
| 699 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 700 | #endif /* __MTK_TARGET__ */ |
| 701 | //XXX stack isolation |
| 702 | #if defined(__KAL_STACK_ISOLATION__) |
| 703 | const kal_uint32 stack_isolation = 1; |
| 704 | #else |
| 705 | const kal_uint32 stack_isolation = 0; |
| 706 | #endif |
| 707 | |
| 708 | #ifdef __MTK_TARGET__ |
| 709 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 710 | #endif /* __MTK_TARGET__ */ |
| 711 | #if defined(__ARM9_MMU__) |
| 712 | const kal_uint32 page_size = 1024; |
| 713 | #elif defined(__ARM11_MMU__) |
| 714 | const kal_uint32 page_size = 4096; |
| 715 | #else |
| 716 | const kal_uint32 page_size = 4096; |
| 717 | #endif |
| 718 | |
| 719 | #ifdef __MTK_TARGET__ |
| 720 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 721 | #endif /* __MTK_TARGET__ */ |
| 722 | const kal_uint32 task_stack_common_plus = TASK_STACK_COMMON_PLUS; |
| 723 | |
| 724 | #ifdef __MTK_TARGET__ |
| 725 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 726 | #endif /* __MTK_TARGET__ */ |
| 727 | #ifdef __UMTS_RAT__ |
| 728 | const kal_uint32 cfg_3G_FSM = 1; |
| 729 | #else |
| 730 | const kal_uint32 cfg_3G_FSM = 0; |
| 731 | #endif |
| 732 | |
| 733 | #ifdef __MTK_TARGET__ |
| 734 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 735 | #endif /* __MTK_TARGET__ */ |
| 736 | const kal_uint32 cfg_task_info_g_size = sizeof(task_info_struct); |
| 737 | |
| 738 | #ifdef __MTK_TARGET__ |
| 739 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 740 | #endif /* __MTK_TARGET__ */ |
| 741 | const kal_uint32 cfg_sys_comp_config_tbl_size = sizeof(comptask_info_struct); |
| 742 | |
| 743 | #ifdef __MTK_TARGET__ |
| 744 | __attribute__ ((section ("SHOULD_NOT_USED_RODATA"))) |
| 745 | #endif /* __MTK_TARGET__ */ |
| 746 | const kal_uint32 cfg_affinity_group_size = sizeof( kal_affinity_group ); |
| 747 | |
| 748 | #ifdef __MTK_TARGET__ |
| 749 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 750 | #endif /* __MTK_TARGET__ */ |
| 751 | const kal_uint32 cfg_hisr_info_size = sizeof(hisr_parameter_s); |
| 752 | |
| 753 | #ifdef __MTK_TARGET__ |
| 754 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 755 | #endif /* __MTK_TARGET__ */ |
| 756 | const kal_uint32 cfg_task_cb_size = sizeof(kal_task_type); |
| 757 | |
| 758 | #ifdef __MTK_TARGET__ |
| 759 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 760 | #endif /* __MTK_TARGET__ */ |
| 761 | const kal_uint32 cfg_hisr_cb_size = sizeof(kal_hisr_type); |
| 762 | |
| 763 | #ifdef __MTK_TARGET__ |
| 764 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 765 | #endif /* __MTK_TARGET__ */ |
| 766 | const kal_uint32 cfg_ext_queue_head = sizeof(kal_queue_type); |
| 767 | |
| 768 | #ifdef __MTK_TARGET__ |
| 769 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 770 | #endif /* __MTK_TARGET__ */ |
| 771 | const kal_uint32 cfg_ilm_struct = sizeof(ilm_struct); |
| 772 | |
| 773 | #ifdef __MTK_TARGET__ |
| 774 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 775 | #endif /* __MTK_TARGET__ */ |
| 776 | const kal_uint32 cfg_max_custom_tasks = MAX_CUSTOM_TASKS; |
| 777 | |
| 778 | #ifdef __MTK_TARGET__ |
| 779 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 780 | #endif /* __MTK_TARGET__ */ |
| 781 | #if defined(DEBUG_KAL) && defined(DEBUG_ITC) |
| 782 | const kal_uint32 cfg_kal_queue_stat_type = |
| 783 | sizeof(struct kal_int_queue_statistics_struct); |
| 784 | #else |
| 785 | const kal_uint32 cfg_kal_queue_stat_type = 0; |
| 786 | #endif |
| 787 | |
| 788 | #ifdef __MTK_TARGET__ |
| 789 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 790 | #endif /* __MTK_TARGET__ */ |
| 791 | const kal_uint32 cfg_no_create_task = TASK_NO_CREATE_PATTERN; |
| 792 | |
| 793 | #ifdef __MTK_TARGET__ |
| 794 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 795 | #endif /* __MTK_TARGET__ */ |
| 796 | const kal_uint32 cfg_ctrl_buff_overhead = KAL_TOTAL_BUFF_OVERHEAD; |
| 797 | |
| 798 | #ifdef __MTK_TARGET__ |
| 799 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 800 | #endif /* __MTK_TARGET__ */ |
| 801 | const kal_uint32 cfg_pool_cb_size = sizeof(struct kal_int_pool_struct); |
| 802 | |
| 803 | #ifdef __MTK_TARGET__ |
| 804 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 805 | #endif /* __MTK_TARGET__ */ |
| 806 | #if defined(DEBUG_KAL) && (defined(DEBUG_BUF2) || defined(DEBUG_BUF1)) |
| 807 | const kal_uint32 cfg_pool_stat_size = sizeof(struct kal_int_pool_statistics_struct); |
| 808 | #else |
| 809 | const kal_uint32 cfg_pool_stat_size = 0; |
| 810 | #endif |
| 811 | |
| 812 | #ifdef __MTK_TARGET__ |
| 813 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 814 | #endif /* __MTK_TARGET__ */ |
| 815 | #if defined(DEBUG_BUF3) && defined(__MTK_TARGET__) |
| 816 | const kal_uint32 cfg_int_buff_callstack = sizeof(struct kal_int_buff_callstack); |
| 817 | #else |
| 818 | const kal_uint32 cfg_int_buff_callstack = 0; |
| 819 | #endif |
| 820 | |
| 821 | |
| 822 | #ifdef __MTK_TARGET__ |
| 823 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 824 | #endif /* __MTK_TARGET__ */ |
| 825 | const kal_uint32 cfg_os_buff_overhead = KAL_OS_BUFF_OVERHEAD; |
| 826 | |
| 827 | #ifdef __MTK_TARGET__ |
| 828 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 829 | #endif /* __MTK_TARGET__ */ |
| 830 | const kal_uint32 cfg_normal_mode = NORMAL_M; |
| 831 | const kal_uint32 cfg_factory_mode = FACTORY_M; |
| 832 | |
| 833 | #if defined(DEBUG_KAL) && defined(DEBUG_BUF2) |
| 834 | #ifdef KAL_ON_OSCAR |
| 835 | /*Visual C++ have different alignment assumption from RVCT*/ |
| 836 | const kal_uint32 cfg_buff_stat = sizeof(struct kal_int_buff_stats) + 20; |
| 837 | #else |
| 838 | #ifdef __MTK_TARGET__ |
| 839 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 840 | #endif /* __MTK_TARGET__ */ |
| 841 | const kal_uint32 cfg_buff_stat = sizeof(struct kal_int_buff_stats); |
| 842 | #endif |
| 843 | #else |
| 844 | #ifdef __MTK_TARGET__ |
| 845 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 846 | #endif /* __MTK_TARGET__ */ |
| 847 | const kal_uint32 cfg_buff_stat = 4; |
| 848 | #endif |
| 849 | |
| 850 | |
| 851 | #if defined(KAL_HISR_STACK_SHARING) |
| 852 | const kal_uint32 cfg_hisr_stack_share = 1; |
| 853 | #else |
| 854 | const kal_uint32 cfg_hisr_stack_share = 0; |
| 855 | #endif |
| 856 | |
| 857 | #ifdef __MTK_TARGET__ |
| 858 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 859 | #endif /* __MTK_TARGET__ */ |
| 860 | const kal_uint8 cfg_irq_priority_list[] = { |
| 861 | #if defined(__MD95__) |
| 862 | 0, 0, 0 /*do not use*/ |
| 863 | #elif defined(__MD97__) |
| 864 | 0, 0, 0 /*do not use*/ |
| 865 | #else |
| 866 | INTERRUPT_PRIORITY_LIST |
| 867 | #endif |
| 868 | }; |
| 869 | |
| 870 | #ifdef __MTK_TARGET__ |
| 871 | __attribute__((section("SHOULD_NOT_USED_RODATA"))) |
| 872 | #endif /* __MTK_TARGET__ */ |
| 873 | const comp_range_s cfg_task_range_check_tbl[] = { |
| 874 | /* task max task tail */ |
| 875 | {(TASK_ID_MODEM_2G3G_CODE_BEGIN - 1), TASK_ID_SRV_CODE_TAIL}, |
| 876 | {(TASK_ID_MODEM_4G_CODE_BEGIN - 1), TASK_ID_MODEM_2G3G_CODE_TAIL}, |
| 877 | {(TASK_ID_MODEM_5G_CODE_BEGIN - 1), TASK_ID_MODEM_4G_CODE_TAIL}, |
| 878 | {(TASK_ID_MW_CODE_BEGIN - 1), TASK_ID_MODEM_5G_CODE_TAIL}, |
| 879 | {(TASK_ID_DRV_CODE_BEGIN - 1), TASK_ID_MW_CODE_TAIL}, |
| 880 | {(TASK_ID_CODE_MAX), TASK_ID_DRV_CODE_TAIL}}; |
| 881 | |
| 882 | |
| 883 | #if defined(__MTK_TARGET__) || defined (__ESL_MASE_GEN97__) |
| 884 | /* for IRQ and IRQ Handler general config */ |
| 885 | //void irq_isr_dummy(void){return;} |
| 886 | |
| 887 | #undef NULL |
| 888 | #define NULL MDCIRQ_IRQ_Default_LISR |
| 889 | #define SS_ASSIGN 0 |
| 890 | |
| 891 | #define X_ISR_MTWQ(a,b,c) |
| 892 | #define X_ISR_CONST(irq_id, affinity, irq_type, irq_handler, irq_init_func, sensitivity, option, queue_size, mod_id, description) \ |
| 893 | extern void irq_init_func(kal_uint32) DECLARE_WEAK; \ |
| 894 | extern void irq_handler(kal_uint32) DECLARE_WEAK; |
| 895 | #include "modem_isr_config.h" |
| 896 | |
| 897 | #undef X_ISR_CONST |
| 898 | #undef X_ISR_MTWQ |
| 899 | |
| 900 | #define X_ISR_MTWQ(a,b,c) |
| 901 | #define X_ISR_CONST(irq_id, affinity, irq_type, irq_handler, irq_init_func, sensitivity, option, queue_size, mod_id, description) \ |
| 902 | {irq_id, affinity, irq_type, irq_handler, irq_init_func, sensitivity, option, queue_size, mod_id, description}, |
| 903 | |
| 904 | const isr_config_s isr_config_tbl[] = { |
| 905 | #include "modem_isr_config.h" |
| 906 | }; |
| 907 | |
| 908 | #undef X_ISR_CONST |
| 909 | #undef X_ISR_MTWQ |
| 910 | |
| 911 | #undef NULL |
| 912 | #define NULL 0 |
| 913 | |
| 914 | const kal_uint32 total_isr_config = sizeof(isr_config_tbl) / sizeof(isr_config_s); |
| 915 | |
| 916 | #else |
| 917 | |
| 918 | const isr_config_s isr_config_tbl[] = {0}; |
| 919 | const kal_uint32 total_isr_config = 0; |
| 920 | |
| 921 | #endif |