next up previous contents
Next: CPU_Context_Switch Up: Hardware Dependent Code Previous: Hardware Dependent Code   Contents

CPU_Context_Initialize



void CPU_Context_Initialize(struct reg_context *the_context,void *stack_base,
                            unsigned int stack_size, 
                            void *(*entry_point)(void *,void *),
                            void *(*thread_fun)(void *),
                            void *thread_arg);


When a thread is switched out from the processor8.1, it's context is saved onto it's context space and the context of the new thread is loaded.

CPU_Context_Initialize is called to initialize the conext space of a new thread so that it can be properly loaded onto the processor, the first time. A typical implementation initializes the stack pointer, program counter and the flag register to proper values. The implementation of this function for the three architectures (x86, arm and trimedia) is given in Appendix A. The description of the arguements to CPU_Context_Initialize are as follows.



Please refer to Appendix A for a description of the CPU_Context_Initialize of the three processors on which we have ported our rtker.


next up previous contents
Next: CPU_Context_Switch Up: Hardware Dependent Code Previous: Hardware Dependent Code   Contents
Soumyadeb Mitra 2002-08-07