Main Page | File List | Globals

opale_event.c File Reference

#include "opale_internal.h"

Include dependency graph for opale_event.c:

Include dependency graph

Go to the source code of this file.

Functions

void EventInit (register t_EVENT *event asm("%a0"), register unsigned long initValue asm("%d0"))
void op_SemaphoreInit (register t_SEMAPHORE *semaphore asm("%a0"), register unsigned long initValue asm("%d0"))
void op_MailBoxInit (register t_MAILBOX *mailbox asm("%a0"), register void *initMessage asm("%d0"))
void op_QueueInit (register t_QUEUE *queue asm("%a0"), register void *buffer asm("%d0"), register unsigned short size asm("%d1"))
void addTaskToTable (register t_TASK_BLOCK *table asm("%a0"), register unsigned char ident asm("%d0"))
void removeTaskFromTable (register t_TASK_BLOCK *table asm("%a0"), register unsigned char ident asm("%d0"))
void moveFromTable (register t_TASK_BLOCK *tableFrom asm("%a0"), register t_TASK_BLOCK *tableTo asm("%a1"), register unsigned char ident asm("d0"))
void MakeTaskReady (register t_EVENT *event asm("%a0"))
void WaitForEvent (register t_EVENT *event asm("%a0"))
void op_SemaphorePost (register t_SEMAPHORE *semaphore asm("%a0"))
void op_SemaphorePend (register t_SEMAPHORE *semaphore asm("%a0"))
unsigned short op_MailBoxPost (register t_MAILBOX *mailBox asm("%a0"), register void *message asm("%d0"))
void * op_MailBoxPend (register t_MAILBOX *mailBox asm("%a0"))
unsigned short op_QueuePost (register t_QUEUE *queue asm("%a0"), register void *message asm("%d0"))
unsigned short op_QueuePostFront (register t_QUEUE *queue asm("%a0"), register void *message asm("%d0"))
void * op_QueuePend (register t_QUEUE *queue asm("%a0"))


Function Documentation

void addTaskToTable register t_TASK_BLOCK *table   asm("%a0"),
register unsigned char ident   asm("%d0")
 

Definition at line 53 of file opale_event.c.

Referenced by moveFromTable(), op_TaskStart(), and PerformDelay().

void EventInit register t_EVENT *event   asm("%a0"),
register unsigned long initValue   asm("%d0")
[static]
 

Definition at line 6 of file opale_event.c.

Referenced by op_MailBoxInit(), op_QueueInit(), and op_SemaphoreInit().

void MakeTaskReady register t_EVENT *event   asm("%a0")  )  [static]
 

Definition at line 85 of file opale_event.c.

References indexToLowestSettedBit, moveFromTable(), and readyTasks.

Referenced by op_MailBoxPost(), op_QueuePost(), op_QueuePostFront(), and op_SemaphorePost().

Here is the call graph for this function:

void moveFromTable register t_TASK_BLOCK *tableFrom   asm("%a0"),
register t_TASK_BLOCK *tableTo   asm("%a1"),
register unsigned char ident   asm("d0")
[static]
 

Definition at line 72 of file opale_event.c.

References addTaskToTable(), and removeTaskFromTable().

Referenced by MakeTaskReady(), and WaitForEvent().

Here is the call graph for this function:

void op_MailBoxInit register t_MAILBOX *mailbox   asm("%a0"),
register void *initMessage   asm("%d0")
 

Inits a MailBox with an initial message. It is done so you just don't have to fill manually the fields of the t_MAILBOX object.

Parameters:
mailbox (a0.l) Pointer to the t_MAILBOX object to initialyze.
initMessage (d0.l) Pointer to initialyze the mailbox with.
Definition at line 33 of file opale_event.c.

References EventInit().

Here is the call graph for this function:

void* op_MailBoxPend register t_MAILBOX *mailBox   asm("%a0")  ) 
 

Wait for a message to be posted in the mailbox. If a message already is in the mailbox when the function is called, it will just return it. If there's no message, the task will be removed from the ready list and make ready again only when a message has been posted and the task is the highest priority one waiting for it.

Parameters:
mailBox (a0.l) MailBox to pend on.
Returns:
Message posted on the mailbox.
Definition at line 168 of file opale_event.c.

References WaitForEvent().

Here is the call graph for this function:

unsigned short op_MailBoxPost register t_MAILBOX *mailBox   asm("%a0"),
register void *message   asm("%d0")
 

Post to the mailbox. It will fill the message field if it isn't already not NULL. If so, the function will return an error. If tasks were waiting on the mailbox, the highest priority one is made ready to run and the scheduler is called.

Parameters:
mailBox (a0.l) MailBox to post to.
message (d0.l) Message to post.
Returns:
FALSE if a message is already in the mailbox (can't post), or TRUE on success.
Definition at line 146 of file opale_event.c.

References MakeTaskReady().

Here is the call graph for this function:

void op_QueueInit register t_QUEUE *queue   asm("%a0"),
register void *buffer   asm("%d0"),
register unsigned short size   asm("%d1")
 

Inits a message queue with an initial message. It is done so you just don't have to fill manually the fields of the t_MAILBOX object.

Parameters:
mailbox (a0.l) Pointer to the t_MAILBOX object to initialyze.
initMessage (d0.l) Pointer to initialyze the mailbox with.
Definition at line 42 of file opale_event.c.

References EventInit().

Here is the call graph for this function:

void* op_QueuePend register t_QUEUE *queue   asm("%a0")  ) 
 

Wait for a message to be posted in the message queue. If one or more message already is in the queue when the function is called, it will just return the one on the front of the queue. If there's no message, the task will be removed from the ready list and make ready again only when a message has been posted and the task is the highest priority one waiting for it.

Parameters:
queue (a0.l) Queue to pend on.
Returns:
Message posted on the message queue.
Definition at line 242 of file opale_event.c.

References WaitForEvent().

Here is the call graph for this function:

unsigned short op_QueuePost register t_QUEUE *queue   asm("%a0"),
register void *message   asm("%d0")
 

Post a message on the back of the message queue. It will add the message to the back of the queue if the queue isn't already full. If so, the function will return an error. If tasks were waiting on the message queue, the highest priority one is made ready to run and the scheduler is called.

Parameters:
queue (a0.l) Queue to post to.
message (d0.l) Message to post.
Returns:
FALSE if the queue is full (can't post), or TRUE on success.
Definition at line 194 of file opale_event.c.

References MakeTaskReady().

Here is the call graph for this function:

unsigned short op_QueuePostFront register t_QUEUE *queue   asm("%a0"),
register void *message   asm("%d0")
 

Post a message on the front of the message queue. It will add the message to the front of the queue if the queue isn't already full. If so, the function will return an error. This is different from QueuePost since the messages are taken from the front of the queue on a QueuePend. So a message posted with QueuePostFronT will be read before one posted with QueuePost. If tasks were waiting on the message queue, the highest priority one is made ready to run and the scheduler is called.

Parameters:
queue (a0.l) Queue to post to.
message (d0.l) Message to post.
Returns:
FALSE if the queue is full (can't post), or TRUE on success.
Definition at line 218 of file opale_event.c.

References MakeTaskReady().

Here is the call graph for this function:

void op_SemaphoreInit register t_SEMAPHORE *semaphore   asm("%a0"),
register unsigned long initValue   asm("%d0")
 

Inits a Semaphore with an initial count. It is done so you just don't have to fill manually the fields of the t_SEMAPHORE object.

Parameters:
semaphore Pointer to the t_SEMAPHORE object to initialyze.
initValue Value to initialyze the semaphore with. Remember semaphore are counter and blocking when 0.
Definition at line 24 of file opale_event.c.

References EventInit().

Here is the call graph for this function:

void op_SemaphorePend register t_SEMAPHORE *semaphore   asm("%a0")  ) 
 

Pend on a semaphore. If the count is not 0, the function will just return. If the semaphore has already been taken (its count isn't 0), the task will be removed from the ready list and wait until some other task post to the semaphore, and no other task of higher priority is pending on it.

Parameters:
semaphore (a0.l) Semaphore to pend on.
Definition at line 127 of file opale_event.c.

References WaitForEvent().

Here is the call graph for this function:

void op_SemaphorePost register t_SEMAPHORE *semaphore   asm("%a0")  ) 
 

Post to the semaphore. It will increment the semaphore's count, and made ready to run the highest priority task pending on it. The scheduler is then called.

Parameters:
semaphore (a0.l) Semaphore to post to.
Definition at line 110 of file opale_event.c.

References MakeTaskReady().

Here is the call graph for this function:

void removeTaskFromTable register t_TASK_BLOCK *table   asm("%a0"),
register unsigned char ident   asm("%d0")
 

Definition at line 62 of file opale_event.c.

Referenced by moveFromTable(), op_TaskStop(), and op_TaskWaitForTicks().

void WaitForEvent register t_EVENT *event   asm("%a0")  )  [static]
 

Definition at line 100 of file opale_event.c.

References moveFromTable(), and readyTasks.

Referenced by op_MailBoxPend(), op_QueuePend(), and op_SemaphorePend().

Here is the call graph for this function:


Generated on Sat Jul 30 16:25:55 2005 for Opale by doxygen 1.3.8