next up previous contents
Next: Bibliography Up: Context Initialization Previous: Trimedia   Contents

Arm

void CPU_Context_Initialize(struct reg_context *the_context,void *stack_base,
                            unsigned int stack_size,
                            void *(*entry_point)(void *(*)(void *),void *),
                            void *(*thread_fun)(void *),
                            void *thread_arg)
{
  unsigned int stack;
  stack=((unsigned int)stack_base)+stack_size;
  stack=stack&(~(MEM_ALLIGN-1)); /* Allign the stack */
  the_context->reg[0]=(unsigned int)thread_fun;
  the_context->reg[1]=(unsigned int)thread_arg;
  the_context->reg[13]=stack;
  the_context->reg[14]=(unsigned int)entry_point;
  the_context->cpsr=CPU_EFLAGS_INTERRUPTS_ON;
}



Soumyadeb Mitra 2002-08-07