Could somebody help me to insert an instruction in the rtl_switch_to (tsk) function (rtlinux V1.2 for x86), so that the task "tsk" could restart at its beginning (on its next period for example), even if it has been preempted before the end of its current job ?
 
I think, we should do something with the "eip" register of the processor (offset,...) but i don't know how to do that.
 
I'd like to build a second rtl_switch_to_aux (tsk) that uses this feature.
 
Thanks very much.
 
PS:
 
#define rtl_switch_to(tsk) \
__asm__ __volatile__( \
"pushl %%eax\n\t" \
"pushl %%ebp\n\t" \
"pushl %%edi\n\t" \
"pushl %%esi\n\t" \
"pushl %%edx\n\t" \
"pushl %%ecx\n\t" \
"pushl %%ebx\n\t" \
"movl "SYMBOL_NAME_STR(rtl_current)", %%edx\n\t" \
"pushl $1f\n\t" \
"movl %%esp, (%%edx)\n\t" \
"movl (%%ecx), %%esp\n\t" \
"movl %%ecx, "SYMBOL_NAME_STR(rtl_current)"\n\t" \
"ret\n\t" \
"1: popl %%ebx\n\t" \
"popl %%ecx\n\t" \
"popl %%edx\n\t" \
"popl %%esi\n\t" \
"popl %%edi\n\t" \
"popl %%ebp\n\t" \
"popl %%eax\n\t" \
: /* no output */ \
: "c" (tsk) \
:"cx");

Reply via email to