void CheckTerminatingTask_Arch(void)
{
   if(TerminatingTask != INVALID_TASK)
   {
//      int i;
//      for(i=0; i<TasksConst[TerminatingTask].StackSize/4; i++)
//         ((uint32 *)TasksConst[TerminatingTask].StackPtr)[i] = 0;
      InitStack_Arch(TerminatingTask);
   }
   TerminatingTask = INVALID_TASK;
}
void StartOs_Arch(void)
{
   uint8f loopi;

   /* init every task */
   for( loopi = 0; loopi < TASKS_COUNT; loopi++)
   {
      InitStack_Arch(loopi);
   }

   /* CPU dependent initialisation */
   StartOs_Arch_Cpu();

}
void CheckTerminatingTask_Arch(void)
{
   /*
    * If there is task being terminated, destroy its context information and
    * reset its state so that the next time that the task is activated it
    * starts its execution on the first instruction of the task body.
    * */

   if(TerminatingTask != INVALID_TASK)
   {
      InitStack_Arch(TerminatingTask);
   }

   TerminatingTask = INVALID_TASK;
}