⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysgen1.pl

📁 一些brew 代码
💻 PL
📖 第 1 页 / 共 5 页
字号:
*      Any one who attempts to create new task or enlarge control
*      buffer size should fine tune the value!
*
*   b. system total debug memory usage 
*      Valid for DEBUG_KAL + DEBUG_[some items, ITC, BUF etc] 
*
* PARAMETERS
*        system_mem_sz       -        system all memory usage
*        debug_mem_sz        -        system all debug memory usage
*
* RETURNS
*  None
*
* GLOBALS AFFECTED
*
*************************************************************************/

$global_mem_config_string

static kal_uint32 System_Mem_Pool[GLOBAL_MEM_SIZE/sizeof(kal_uint32)];

#if defined(DEBUG_KAL)
static kal_uint32 Debug_Mem_Pool[GLOBAL_DEBUG_MEM_SIZE/sizeof(kal_uint32)];
#endif /* DEBUG_KAL */

void
custom_configmem(kal_uint32 *system_mem_sz, kal_uint32** system_mem_addr, 
                 kal_uint32 *debug_mem_sz,  kal_uint32** debug_mem_addr)
{
   *system_mem_sz   = GLOBAL_MEM_SIZE;
   *system_mem_addr = System_Mem_Pool;
   
#if defined(DEBUG_KAL)   
   *debug_mem_addr  = Debug_Mem_Pool;
   *debug_mem_sz    = GLOBAL_DEBUG_MEM_SIZE;
#else
   *debug_mem_addr  = (kal_uint32 *)0;
   *debug_mem_sz    = 0;
#endif
}


/*************************************************************************
* FUNCTION
*  custom_config_ctrl_buff_info()
*
* DESCRIPTION
*   This routine configure control buffer pool information (run time 
*   memory allocation usage)
*
* PARAMETERS
*
* RETURNS
*  None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void
custom_config_ctrl_buff_info(void)
{
$ctrl_buff_pool_config_string        
} 

/*************************************************************************
* FUNCTION
*  custom_config_task_stack_size
*
* DESCRIPTION
*  This function dedicates to specify one task's stack size.
*  Note: Each task's stack size is originally defined in the task 
*        configuration table (in sys_comp_config_tbl[]). When allocating 
*        stack for each task, system will invoke this function. If the 
*        return value is zero, system will use the original stack-size
*        setting for the task. Otherwise, system will use the return value 
*        as the task's stack size IF AND ONLY IF the return value is larger 
*        than the original settting.
*
* PARAMETERS
*  task_indx   -   task index of task to configure
*
* RETURNS
*  Task's stack size (in bytes). Zero value implies that system uses
*  the original setting to allocate stack for the task.
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 custom_config_task_stack_size(task_indx_type task_indx)
{
   switch (task_indx) {

   /*
    * Return a non-zero value for the task you are interesting.
    * For example,
    *    case INDX_MMI:
    *       // configure MMI's stack size as 8KB
    *       return 8096;
    */

#if defined(OBIGO_Q05A)
   case INDX_MMI:
   // en-large the MMI stack size to 26KB
      return (26 * 1024);
#else
   case INDX_MMI:
      return (26 * 1024);
#endif /* OBIGO_Q05A */

   default:
      return 0;
   }

   return 0;
}

/*************************************************************************
* FUNCTION
*  custom_config_task_extq_size
*
* DESCRIPTION
*  This function dedicates to specify one task's external queue size.
*  Note: Each task's external queue size is originally defined in the task 
*        configuration table (in sys_comp_config_tbl[]). When allocating 
*        queue for each task, system will invoke this function. If the 
*        return value is zero, system will use the original queue-size 
*        setting for the task. Otherwise, system will use the return value 
*        as the task's external queue size IF AND ONLY IF the return value 
*        is larger than the original settting.
*
* PARAMETERS
*  task_indx   -   task index of task to configure
*
* RETURNS
*  Task's external queue size (number of entries). Zero value implies that
*  system uses the original setting to allocate queue for the task.
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 custom_config_task_extq_size(task_indx_type task_indx)
{
   switch (task_indx) {

   /*
    * Return a non-zero value for the task you are interesting.
    * For example,
    *    case INDX_MMI:
    *       // configure MMI's external queue size as 40
    *       return 30;
    */

   default:
      return 0;
   }

   return 0;
}

/*************************************************************************
* FUNCTION
*  custom_config_evshed_pool_size
*
* DESCRIPTION
*  This function dedicates to specify larger pool size on event scheduler.
*
* PARAMETERS
*  void   -   
*
* RETURNS
*  evshed pool size (number of entries). Smaller value than default 
*  implies that system uses the original setting to allocate pool for event.
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 custom_config_evshed_pool_size(void)
{
#ifdef __SIP__
   return 160;
#else
   return 0;
#endif
}

/*************************************************************************
* FUNCTION
*  custom_config_task_under_usb_boot
*
* DESCRIPTION
*  This function dedicates custom tasks present or not under usb boot mode
*
* PARAMETERS
*  task_indx   -   task index of task to configure
*
* RETURNS
*  KAL_TRUE  : present on usb boot mode
*  KAL_FALSE : otherwise
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool custom_config_task_under_usb_boot(task_indx_type task_indx)
{
   switch (task_indx) {

   /*
    * Return true value for the custom task you are interesting.
    * For example,
    *    case INDX_CUSTOM1:
    *       return KAL_TRUE;
    */

   default:
      return KAL_FALSE;
   }

   return KAL_FALSE;
}

/*************************************************************************
* FUNCTION
*  custom_config_task_under_factory_boot
*
* DESCRIPTION
*  This function dedicates custom tasks present or not under factory boot mode
*
* PARAMETERS
*  task_indx   -   task index of task to configure
*
* RETURNS
*  KAL_TRUE  : present on factory boot mode
*  KAL_FALSE : otherwise
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_bool custom_config_task_under_factory_boot(task_indx_type task_indx)
{
   switch (task_indx) {

   /*
    * Return true value for the custom task you are interesting.
    * For example,
    *    case INDX_CUSTOM1:
    *       return KAL_TRUE;
    */

   default:
      return KAL_FALSE;
   }

   return KAL_FALSE;
}

/*************************************************************************
* FUNCTION
*  custom_config_task_stack_location
*
* DESCRIPTION
*  This function will re-configure task stack location (INTSRAM/EXTSRAM)
*  Original configuration in config.lib will be overwritten.
*  XXX PLEASE DON'T EDIT THE FUNCTION.
*
* PARAMETERS
*  None
*
* RETURNS
*  None
*
* GLOBALS AFFECTED
*  task_info_g
*
*************************************************************************/
void custom_config_task_stack_location(void)
{
#ifdef __SYS_INTERN_RAM__
   /* DCM_ENABLE feature ON/OFF
    * IDLE task have to put in internal SRAM when DCM_ENABLE ON
    */
   #if defined(DCM_ENABLE)
      task_info_g[ INDX_IDLE ].task_internal_ram_stack = KAL_TRUE;
   #endif /* DCM_ENABLE */
#endif /* __SYS_INTERN_RAM__ */
   return;
}

/*************************************************************************
* FUNCTION
*  custom_get_task_module()
*
* DESCRIPTION
*  This routine returns the number of customer tasks and modules.
*
* PARAMETERS
*  Pointer of 8-bits unsigned integer used to return the value.
*
* RETURNS
*  None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void 
custom_get_task_module(kal_uint8 *custom_task, kal_uint8 *custom_module)
{
   *custom_task = RPS_CUSTOM_TASKS_END - RPS_CUSTOM_TASKS_BEGIN;
   *custom_module = MOD_CUSTOM_END - MOD_CUSTOM_BEGIN;
}

/*************************************************************************
* FUNCTION
*  remap_mod_task_g
*
* DESCRIPTION
*  This function will remap module to new task at initialization stage.
*  Original configuration in config.lib will be overwritten.
*  XXX PLEASE DON'T EDIT THE FUNCTION.
*
* PARAMETERS
*  None
*
* RETURNS
*  None
*
* GLOBALS AFFECTED
*  mod_task_g
*
*************************************************************************/
void remap_mod_task_g(void)
{
#if defined(JATAAYU_SUPPORT) || defined(OBIGO_Q05A)
   mod_task_g[MOD_WAP] = INDX_MMI;
#endif
   return;
}

/*************************************************************************
* FUNCTION
*  customization_check
*
* DESCRIPTION
*  Checking system customization, including number of tasks, modules,
*  message ID and SAP.
*
* PARAMETERS
*
* RETURNS
*
* GLOBALS AFFECTED
*
*************************************************************************/
void
customization_check(void)
{
   /* Check if customer tasks exceeding limitation */
   if ( (RPS_CUSTOM_TASKS_END - RPS_CUSTOM_TASKS_BEGIN) > MAX_CUSTOM_TASKS )
      kal_fatal_error_handler((kal_char*)"Customer creates too many tasks",
                              KAL_ERROR_CUSTOMER_TASK_ID_EXCEED_UPPER_BOUND,
                              (kal_uint32)(RPS_CUSTOM_TASKS_BEGIN-RPS_CUSTOM_TASKS_END)
                             );
                             
   /* Check if customer module ID exceeding limitation */
   if ( (MOD_CUSTOM_END - MOD_CUSTOM_BEGIN) > MAX_CUSTOM_TASKS )
      kal_fatal_error_handler((kal_char*)"Customer defines too many module IDs",
                              KAL_ERROR_CUSTOMER_MOD_ID_EXCEED_UPPER_BOUND,
                              (kal_uint32)(MOD_CUSTOM_END - MOD_CUSTOM_BEGIN)
                             );
                             
   /* Check if customer message ID exceeding limitation */
   if ( (MSG_ID_END - CUSTOM_MSG_CODE_BEGIN) > MAX_CUSTOM_MESSAGE_ID )
      kal_fatal_error_handler((kal_char*)"Customer define too many message IDs",
                              KAL_ERROR_CUSTOMER_MEESAGE_ID_EXCEED_UPPER_BOUND,
                              (kal_uint32)(MSG_ID_END - CUSTOM_MSG_CODE_BEGIN)
                             );
                          
   /* Check if customer tasks exceeding limitation */
   if ( (LAST_SAP_CODE - CUSTOM_SAP_BEGIN - 1) > MAX_CUSTOM_SAP_ID )
      kal_fatal_error_handler((kal

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -