Mr.EAI, Where is the defination of these functions ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mr.EAI, Where is the defination of these functions ?

Jump to solution
1,865 Views
fish_yu
Contributor III

Dear EAI,

I have already read all help files about MQX RTOS. I, all the while, Can not find the definations of these functions which writed in MQX.c and mqx_prv.h.

In mqx_prv.h, there is a setjmp(b) on line 211.

These codes are

/*--------------------------------------------------------------------------*/
/*
**                       MQX INITIALIZATION DEFINITIONS
*/

/*
** The maximum number of task templates for a MQX application.
*/
#define MQX_MAXIMUM_NUMBER_OF_TASK_TEMPLATES (0xFFFF)

/*
** The scaler to use to initialize the default time slice value. It is used
** in conjunction with MQX's tick rate (ticks per second). The default
** time slice frequency = ticks per second / MQX_DEFAULT_TIME_SLICE
*/
#define MQX_DEFAULT_TIME_SLICE  ((_mqx_uint)10)

#ifndef MQX_SETJMP
#define MQX_SETJMP(b)    setjmp(b)
#endif
#ifndef MQX_LONGJMP
#define MQX_LONGJMP(b,n) longjmp(b,n)
#endif
NOW,WHERE ARE THE DEFINATION OF setjmp(b) and longjmp(b,n)???

My second question to consult a parameter that is _mqx_exit_jump_buffer_internal.
It is located on line 106 in MQX.c
These codes are
_mqx_uint _mqx
   (
      /* [IN] the address of the MQX initialzation structure */
      register MQX_INITIALIZATION_STRUCT_PTR mqx_init
   )
{ /* Body */
   KERNEL_DATA_STRUCT_PTR   kernel_data;
   TASK_TEMPLATE_STRUCT_PTR template_ptr;
   TD_STRUCT_PTR            td_ptr;
   _mqx_uint                result;
   pointer                  stack_ptr;
   pointer                  sys_td_stack_ptr;
   uchar_ptr                sys_stack_base_ptr;

#if MQX_EXIT_ENABLED || MQX_CRIPPLED_EVALUATION
   /* Setup a longjmp buffer using setjmp, so that if an error occurs
   ** in mqx initialization, we can perform a longjmp to this location.
   **
   ** Also _mqx_exit will use this jumpbuffer to longjmp to here in order
   ** to cleanly exit MQX.
   */
   if ( MQX_SETJMP( _mqx_exit_jump_buffer_internal ) ) {
      _GET_KERNEL_DATA(kernel_data);
      _int_set_vector_table(kernel_data->USERS_VBR);
      return kernel_data->USERS_ERROR;
   } /* Endif */
#endif

Where is the _mqx_exit_jump_buffer_internal ?
 
Finally, I have a suggestion to tell you and your company.
The MQX RTOS for Freescale is a really powerful Software. The efficiency of MQX RTOS is really good. But Your company and freescale didn't  provide a file about architecture of MQX RTOS. There are only MQX RTOS UG and other API RM. But they didn't write all the defination of functions and micros in detail. Just like setjmp(b) and longjmp(b,n) that are in my problems.
Would your company or Freescale semiconductor provide a web seminar about introduction of MQX RTOS in detail? Or your company or Freescale semiconductor may provide a file to introduce the architecture of the MQX RTOS? I think that we don't need a samll introduction in five minutes. We really need a fully introduction about the software in detail. I consider that this is a only way to solve any weird problem, just like my problem.
And This is a only way to introduce the powerful MCU to all engineer.
 
Thank you for your Help.
Sincerely Yours
fish_yu

0 Kudos
1 Solution
743 Views
EAI
Contributor IV

fish_yu;

To answer your questions:

1. setjmp and longjmp are part of the c runtime library (MSL). Refer to codewarrior documentation for more help.

2. _mqx_exit_jumpbuffer_internal is declared just before _mqx:

 

/* Error return jump buffer for kernel errors */
#if MQX_EXIT_ENABLED || MQX_CRIPPLED_EVALUATION
jmp_buf _mqx_exit_jump_buffer_internal;
#endif

/*FUNCTION********************************************************************
*
* Function Name    : _mqx
* Returned Value   : _mqx_uint result
* Comments         :
*      This function initializes and starts up MQX.  It will return
* if an error is detected, or the application calls _mqx_exit.
*
*END************************************************************************/

_mqx_uint _mqx
   (
      /* [IN] the address of the MQX initialization structure */
      register MQX_INITIALIZATION_STRUCT_PTR mqx_init
   )

 

 Embedded Access provides premium support and training on MQX. Contact sales@embedded-access.com if you would like to obtain training or detailed technical support. We monitor the forums, and will occasionally provide responses to simple issues, however to receive responses to detailed technical issues or to have a guaranteed response time, you must purchase technical support.

 

View solution in original post

0 Kudos
1 Reply
744 Views
EAI
Contributor IV

fish_yu;

To answer your questions:

1. setjmp and longjmp are part of the c runtime library (MSL). Refer to codewarrior documentation for more help.

2. _mqx_exit_jumpbuffer_internal is declared just before _mqx:

 

/* Error return jump buffer for kernel errors */
#if MQX_EXIT_ENABLED || MQX_CRIPPLED_EVALUATION
jmp_buf _mqx_exit_jump_buffer_internal;
#endif

/*FUNCTION********************************************************************
*
* Function Name    : _mqx
* Returned Value   : _mqx_uint result
* Comments         :
*      This function initializes and starts up MQX.  It will return
* if an error is detected, or the application calls _mqx_exit.
*
*END************************************************************************/

_mqx_uint _mqx
   (
      /* [IN] the address of the MQX initialization structure */
      register MQX_INITIALIZATION_STRUCT_PTR mqx_init
   )

 

 Embedded Access provides premium support and training on MQX. Contact sales@embedded-access.com if you would like to obtain training or detailed technical support. We monitor the forums, and will occasionally provide responses to simple issues, however to receive responses to detailed technical issues or to have a guaranteed response time, you must purchase technical support.

 

0 Kudos