AnsweredAssumed Answered

Time slicing scheduler.

Question asked by jammal on Sep 23, 2010
Latest reply on Oct 13, 2010 by jeyanthi.jegadeesan

Hello everybody!

I'm trying to realise time slicing round-robin scheduler.

Please correct and supplement my following conclusions:

1) The schedule function will be written in asm as interrupt hendler. The scheduler will operate with following task structure

typedef struct type_TCB
   unsigned int * task_stk;     //-- Pointer to the task's top of stack
   type_TCB task_queue;      //-- Queue to include task in the ready/wait lists

   int    * stk_start;                  //-- Base address of the task's stack space
   int      stk_size;                   //-- The task stack size (in sizeof (void*), not bytes)
   void * task_func_addr;    //-- filled on creation
   void * task_func_param;   //-- filled on creation
   int      task_state;           //-- Task state
   int      tick_count;           //-- Remaining time until timeout
   int      tslice_count;        //-- Time slice counter


2) The task function mustn't save its contex. That will realise in scheduler. How can I switch off context saving in SHARC compiler? In GCC it achieve by pragma noregsave.

3) Must I modify "Analog Devices\VisualDSP 5.0\213xx\lib\src\crt_src\36x_hdr.asm" for implementing shceduler as a hendler or I can implement it in separate file?

4) Where should I realise the task stack in common heap or allocate personal space by modifying .LDF?


I would be very thankful to you for any help