yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [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 | * task_config.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * Maui_Software |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * This header file contains the declarations of the task |
| 49 | * configuration module. |
| 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 | * |
| 71 | * removed! |
| 72 | * removed! |
| 73 | * removed! |
| 74 | * |
| 75 | * removed! |
| 76 | * removed! |
| 77 | * removed! |
| 78 | * |
| 79 | * removed! |
| 80 | * removed! |
| 81 | * removed! |
| 82 | * |
| 83 | * removed! |
| 84 | * removed! |
| 85 | * removed! |
| 86 | * |
| 87 | * removed! |
| 88 | * removed! |
| 89 | * removed! |
| 90 | * removed! |
| 91 | * |
| 92 | * removed! |
| 93 | * removed! |
| 94 | * removed! |
| 95 | * removed! |
| 96 | * |
| 97 | * removed! |
| 98 | * removed! |
| 99 | * removed! |
| 100 | * removed! |
| 101 | * |
| 102 | * removed! |
| 103 | * removed! |
| 104 | * removed! |
| 105 | * removed! |
| 106 | * |
| 107 | * removed! |
| 108 | * removed! |
| 109 | * removed! |
| 110 | * |
| 111 | * removed! |
| 112 | * removed! |
| 113 | * |
| 114 | * removed! |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * |
| 118 | * removed! |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * removed! |
| 122 | * removed! |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * removed! |
| 126 | * removed! |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * removed! |
| 130 | * removed! |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * |
| 134 | * removed! |
| 135 | * removed! |
| 136 | * removed! |
| 137 | * |
| 138 | * removed! |
| 139 | * removed! |
| 140 | * removed! |
| 141 | * |
| 142 | * removed! |
| 143 | * removed! |
| 144 | * removed! |
| 145 | * |
| 146 | * removed! |
| 147 | * removed! |
| 148 | * removed! |
| 149 | * |
| 150 | * removed! |
| 151 | * removed! |
| 152 | * removed! |
| 153 | * |
| 154 | * removed! |
| 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 | * removed! |
| 173 | * |
| 174 | * removed! |
| 175 | * removed! |
| 176 | * removed! |
| 177 | * removed! |
| 178 | * removed! |
| 179 | * removed! |
| 180 | * removed! |
| 181 | * removed! |
| 182 | * removed! |
| 183 | * removed! |
| 184 | * removed! |
| 185 | * removed! |
| 186 | * removed! |
| 187 | * removed! |
| 188 | * removed! |
| 189 | * removed! |
| 190 | * removed! |
| 191 | * removed! |
| 192 | * removed! |
| 193 | * removed! |
| 194 | * removed! |
| 195 | * removed! |
| 196 | * removed! |
| 197 | * removed! |
| 198 | * removed! |
| 199 | * removed! |
| 200 | * removed! |
| 201 | * removed! |
| 202 | * removed! |
| 203 | * removed! |
| 204 | * removed! |
| 205 | * removed! |
| 206 | * removed! |
| 207 | *------------------------------------------------------------------------------ |
| 208 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 209 | *============================================================================ |
| 210 | ****************************************************************************/ |
| 211 | |
| 212 | /********************************************************************* |
| 213 | (C) _____ (year of first publication) Sasken communication |
| 214 | Technologies Limited, All rights reserved. |
| 215 | * This file provides a template for .c files. This space |
| 216 | * should be used to describe the file contents |
| 217 | * Component-specific prefix : xxxx |
| 218 | *********************************************************************/ |
| 219 | |
| 220 | #ifndef _TASK_CONFIG_H |
| 221 | #define _TASK_CONFIG_H |
| 222 | |
| 223 | #include "kal_general_types.h" |
| 224 | #include "kal_public_defs.h" |
| 225 | |
| 226 | #include "stack_config.h" |
| 227 | #include "stack_types.h" |
| 228 | |
| 229 | #include "lcd_ip_cqueue.h" |
| 230 | #include "module_taskid_range.h" |
| 231 | /******************************************************************************* |
| 232 | * Constant and data type definition |
| 233 | *******************************************************************************/ |
| 234 | #define INT_Q_LEN 15 |
| 235 | /* task internal queue data type */ |
| 236 | |
| 237 | /************************************************************************* |
| 238 | * Macros Without Parameters |
| 239 | *************************************************************************/ |
| 240 | /* Modify from 8 to ((RPS_TOTAL_STACK_MODULES+31)/32), because there are more modules now */ |
| 241 | /* and maximum possible task number is 255 according to priority convention */ |
| 242 | #define RPS_MASK_ARRAY_SIZE ((RPS_TOTAL_STACK_MODULES + 31) / 32) |
| 243 | #define RPS_ALLOCATE_ILM_MASK 31 |
| 244 | #define RPS_ALLOCATE_ILM_SHIFT 5 |
| 245 | |
| 246 | typedef LCD_IP_CQUEUE(ilm_struct, 1) int_q_type; |
| 247 | typedef LCD_IP_CQUEUE_MT(ilm_struct, 1) isr_q_type; |
| 248 | |
| 249 | /************************************************************************* |
| 250 | * STRUCT |
| 251 | * task_info_struct |
| 252 | * |
| 253 | * DESCRIPTION |
| 254 | * The structure defines component task information at execution time |
| 255 | * |
| 256 | * FIELDS |
| 257 | * task_name_ptr - pointer to task name |
| 258 | * task_qname_ptr; - pointer to task external queue name |
| 259 | * task_priority - task priority |
| 260 | * task_stack_size - task stack size |
| 261 | * task_id - created task entity id |
| 262 | * task_ext_qid - created task external queue id |
| 263 | * task_int_qid_ptr - pointer to created task internal queue |
| 264 | * task_entry_func - task's entry function |
| 265 | * task_cfg_func - task's configuration handler |
| 266 | * task_init_func - task's initialization handler |
| 267 | * task_reset_func - task's reset handler |
| 268 | * task_end_func - task's termination handler |
| 269 | * task_ext_qsize - task's external queue size |
| 270 | * |
| 271 | * GLOBALS AFFECTED |
| 272 | * |
| 273 | *************************************************************************/ |
| 274 | typedef struct { |
| 275 | kal_char * task_name_ptr; |
| 276 | kal_char * task_qname_ptr; |
| 277 | kal_uint32 task_priority; |
| 278 | kal_uint32 task_stack_size; |
| 279 | kal_taskid task_id; |
| 280 | kal_msgqid task_ext_qid; |
| 281 | int_q_type * task_int_qid_ptr; |
| 282 | kal_task_func_ptr task_entry_func; |
| 283 | task_init_func_ptr task_init_func; |
| 284 | task_reset_func_ptr task_reset_func; |
| 285 | kal_uint8 task_ext_qsize; |
| 286 | kal_uint8 task_int_qsize; |
| 287 | #ifdef __SYS_INTERN_RAM__ |
| 288 | kal_bool task_internal_ram_stack; |
| 289 | #endif /* __SYS_INTERN_RAM__ */ |
| 290 | kal_affinity_group task_affinity_attribute; |
| 291 | kal_task_group_id task_affinity_group_id; |
| 292 | kal_bool task_affinity_dynamic; |
| 293 | } task_info_struct; |
| 294 | |
| 295 | |
| 296 | /******************************************************************************* |
| 297 | * function macro definition |
| 298 | *******************************************************************************/ |
| 299 | //#define stack_is_extq_created(module_id) ((task_info_g[mod_task_g[(module_id)]].task_ext_qid != KAL_NILQ_ID)? KAL_TRUE: KAL_FALSE) |
| 300 | |
| 301 | /******************************************************************************* |
| 302 | * Exported global datas |
| 303 | *******************************************************************************/ |
| 304 | extern task_info_struct *task_info_g; |
| 305 | extern isr_q_type *isr_qid_ptrs_g[]; |
| 306 | #define hisr_qid_ptrs(hisr_id) isr_qid_ptrs_g[hisr_id] |
| 307 | #define lisr_qid_ptrs(lisr_id) isr_qid_ptrs_g[lisr_id + KAL_MAX_NUM_HISRS] |
| 308 | |
| 309 | extern kal_bool stack_init_comp_info(void); |
| 310 | |
| 311 | #undef task_name |
| 312 | #undef task_queue_name |
| 313 | #undef task_priority |
| 314 | #undef task_stack_size |
| 315 | #undef null_task_create_entry |
| 316 | #undef compatible_code |
| 317 | #undef task_create_function |
| 318 | #undef task_stack_internalRAM |
| 319 | #undef task_external_queue_size |
| 320 | #undef task_internal_queue_size |
| 321 | #undef task_boot_mode |
| 322 | #undef task_affinity_group |
| 323 | #undef task_affinity_group_id |
| 324 | #undef MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM |
| 325 | #undef MODULE_ID_FOR_PRINT_TRACE |
| 326 | #undef task_index |
| 327 | #undef task_module_map |
| 328 | |
| 329 | |
| 330 | /*define all macros as empty*/ |
| 331 | #define task_name(p1) |
| 332 | #define task_queue_name(p1) |
| 333 | #define task_priority(p1, p2) |
| 334 | #define task_stack_size(p1) |
| 335 | #define null_task_create_entry(p1) |
| 336 | #define compatible_code(p1) |
| 337 | #define task_create_function(p1) |
| 338 | #define task_stack_internalRAM(p1) |
| 339 | #define task_external_queue_size(p1) |
| 340 | #define task_internal_queue_size(p1) |
| 341 | #define task_boot_mode(p1) |
| 342 | #define task_affinity_group(p1) |
| 343 | #define task_affinity_group_id(p1) |
| 344 | #define MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM(p1) |
| 345 | #define MODULE_ID_FOR_PRINT_TRACE(p1) |
| 346 | #define task_module_map(p1, p2) |
| 347 | #define task_index(p1) |
| 348 | |
| 349 | #undef task_index |
| 350 | #define task_index(p1) p1, |
| 351 | typedef enum { |
| 352 | #include "srv_task_config.h" |
| 353 | #include "modem_2g3g_task_config.h" |
| 354 | #include "modem_4g_task_config.h" |
| 355 | #include "modem_5g_task_config.h" |
| 356 | #include "middleWare_task_config.h" |
| 357 | #include "drv_task_config.h" |
| 358 | |
| 359 | /*Total number of build time tasks*/ |
| 360 | //RPS_TOTAL_STACK_TASKS, |
| 361 | |
| 362 | RPS_TOTAL_STACK_TASKS = |
| 363 | (TASK_ID_SRV_CODE_TAIL - TASK_ID_SRV_CODE_BEGIN + 1 + |
| 364 | TASK_ID_MODEM_2G3G_CODE_TAIL - TASK_ID_MODEM_2G3G_CODE_BEGIN + 1 + |
| 365 | TASK_ID_MODEM_4G_CODE_TAIL - TASK_ID_MODEM_4G_CODE_BEGIN + 1 + |
| 366 | TASK_ID_MODEM_5G_CODE_TAIL - TASK_ID_MODEM_5G_CODE_BEGIN + 1 + |
| 367 | TASK_ID_MW_CODE_TAIL - TASK_ID_MW_CODE_BEGIN + 1 + TASK_ID_DRV_CODE_TAIL - |
| 368 | TASK_ID_DRV_CODE_BEGIN + 1), |
| 369 | |
| 370 | |
| 371 | } task_indx_type; |
| 372 | |
| 373 | |
| 374 | #undef task_name |
| 375 | #undef task_queue_name |
| 376 | #undef task_priority |
| 377 | #undef task_stack_size |
| 378 | #undef null_task_create_entry |
| 379 | #undef compatible_code |
| 380 | #undef task_create_function |
| 381 | #undef task_stack_internalRAM |
| 382 | #undef task_external_queue_size |
| 383 | #undef task_internal_queue_size |
| 384 | #undef task_boot_mode |
| 385 | #undef task_affinity_group |
| 386 | #undef task_affinity_group_id |
| 387 | #undef MODULE_ID_MAP_TO_NULL_TASK_CAN_ALLOCATE_ILM |
| 388 | #undef MODULE_ID_FOR_PRINT_TRACE |
| 389 | #undef task_index |
| 390 | #undef task_module_map |
| 391 | |
| 392 | #endif /* End of file 'task_config.h' */ |