Main Page | Data Structures | File List | Data Fields | Globals

opale_task.c File Reference

#include "opale_internal.h"

Include dependency graph for opale_task.c:

Include dependency graph

Go to the source code of this file.

Functions

short op_TaskStart (register t_TASK *task asm("%a3"), register void(*taskEntryFunction)(register void *asm("%a0")) asm("%a2"), register char *stackPointer asm("%a1"), register unsigned char ident asm("%d0"), register void *taskFunctionArgs asm("%a0"))
void op_TaskStop (void)
void op_TaskWaitForTicks (register unsigned short ticks asm("%d0"))


Function Documentation

short op_TaskStart register t_TASK *task   asm("%a3"),
register   void(*)(register void *asm("%a0")) asm taskEntryFunction("%a2"),
register char *stackPointer   asm("%a1"),
register unsigned char ident   asm("%d0"),
register void *taskFunctionArgs   asm("%a0")
 

Loads a task in the kernel. After the call to op_TaskStart, if the scheduler is activated, the highest priority task will be made ready to run.

Parameters:
task (a3.l) Pointer to a unique t_TASK structure.
taskEntryFunction (a2.l) Pointer to the function of the task. That function should never return, and gets a pointer to its parameters via the a0 register. Prototype of the functin : void taskEntryFunction( register void* args asm("%a0")
stackPointer (a1.l) Pointer to a buffer allocated to be the stack of the task's function. Be careful to give a buffer of a suffivier size.
ident (d0.b) Identity of the function. It is also its priority. Remember 0 is the highest priority, and LOWEST_PRIORITY is reserved to the idle task. If a task of the same ident/priority has already been created, the current call to op_TaskStart will fail.
taskFunctionArgs (a0.l) Pointer to a structure that will be given as a parameter to the function of the task.
Returns:
FALSE if the requested identity already exists, TRUE in any other case.
Definition at line 17 of file opale_task.c.

References addTaskToTable(), InitStack(), op_EnterCriticalSection, op_ExitCriticalSection, op_Scheduler, readyTasks, and runningTasks.

Referenced by op_KernelInit().

Here is the call graph for this function:

void op_TaskStop void   ) 
 

Stops the current task. Use it at the end of a task function when you want to end it. Remember task functions shall not return, so if you want to quit one of those, use op_TaskStopDefinition at line 46 of file opale_task.c.

References currentTask, t_TASK::ident, op_EnterCriticalSection, op_ExitCriticalSection, op_Scheduler, readyTasks, removeTaskFromTable(), and runningTasks.

Here is the call graph for this function:

void op_TaskWaitForTicks register unsigned short ticks   asm("%d0")  ) 
 

Make a task wait for a number of ticks. A tick occurs each time the int 5 is called. The task will be made ready to run when the given time has expired and it is the highest priority task ready to run.

Parameters:
ticks (d0.w) Number of ticks to wait for.
Definition at line 64 of file opale_task.c.

References currentTask, t_TASK::ident, idleTask, t_TASK::nextSleeping, op_EnterCriticalSection, op_ExitCriticalSection, op_Scheduler, t_TASK::prevSleeping, readyTasks, removeTaskFromTable(), and t_TASK::tickDelay.

Here is the call graph for this function:


Generated on Sun May 14 22:31:06 2006 for Opale by doxygen 1.3.8