Main Page | Data Structures | File List | Data Fields | Globals
Big Lines of Credit Working Capitalbusiness loans Small Business Loans Merchant Cash Advances Short Term Loads Long Term Loans Equipment Financing SBA Loans best business loans

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 addTaskToTable (register t_TASK_BLOCK *table asm(" "), register unsigned char ident asm("Ð"))
void EventInit (register t_EVENT *event asm(" "), register unsigned long initValue asm("Ð"))
void MakeTaskReady (register t_EVENT *event asm(" "))
void moveFromTable (register t_TASK_BLOCK *tableFrom asm(" "), register t_TASK_BLOCK *tableTo asm("¡"), register unsigned char ident asm("d0"))
void op_MailBoxInit (register t_MAILBOX *mailbox asm(" "), register void *initMessage asm("Ð"))
void * op_MailBoxPend (register t_MAILBOX *mailBox asm(" "))
unsigned short op_MailBoxPost (register t_MAILBOX *mailBox asm(" "), register void *message asm("Ð"))
void op_QueueInit (register t_QUEUE *queue asm(" "), register void *buffer asm("Ð"), register unsigned short size asm("Ñ"))
void * op_QueuePend (register t_QUEUE *queue asm(" "))
unsigned short op_QueuePost (register t_QUEUE *queue asm(" "), register void *message asm("Ð"))
unsigned short op_QueuePostFront (register t_QUEUE *queue asm(" "), register void *message asm("Ð"))
void op_SemaphoreInit (register t_SEMAPHORE *semaphore asm(" "), register unsigned long initValue asm("Ð"))
void op_SemaphorePend (register t_SEMAPHORE *semaphore asm(" "))
void op_SemaphorePost (register t_SEMAPHORE *semaphore asm(" "))
void removeTaskFromTable (register t_TASK_BLOCK *table asm(" "), register unsigned char ident asm("Ð"))
void WaitForEvent (register t_EVENT *event asm(" "))


Function Documentation

void addTaskToTable register t_TASK_BLOCK *table   asm(" "),
register unsigned char ident   asm("Ð")
 

Adds a task to a t_TASK_BLOCK. This could be either a table of waiting tasks, or sleeping tasks, or so.

Parameters:
table (a0.l) Pointer to the table
ident (d0.l) Ident of the task to insert
Definition at line 63 of file opale_event.c.

References identToX, and identToY.

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

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

General initialization for events (semaphores, mailboxes, queues). Set values of common fields of the events control blocks. op_SemaphoreInit and op_MailBoxInit are just redefinitions of this function. op_QueueInit uses it too, but with complementary code.

Parameters:
event (a0.l) Pointer to the t_EVENT to be initialized.
initValue (d0.l) Value for the t_EVENT.value field. Could be the semaphore's counter, mailbox message or queue memory buffer.
Definition at line 13 of file opale_event.c.

References _Y_.

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

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

Makes the highest priority task from a waiting table ready to run (transfers the task to the readyTasks table)

Parameters:
event (a0.l) Table from which to get the task
Definition at line 102 of file opale_event.c.

References indexToLowestSettedBit, MASK_Y, 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(" "),
register t_TASK_BLOCK *tableTo   asm("¡"),
register unsigned char ident   asm("d0")
[static]
 

Tranfer a task from a waiting table to another. Used for making a task to sleep or to wake it.

Parameters:
tableFrom (a0.l) Table of the event on which the table is waiting
tableTO (a1.l) Table to transfer the task to
ident (d0.l) Ident of the task to move from a table to another
Definition at line 91 of file opale_event.c.

References addTaskToTable(), op_Scheduler, and removeTaskFromTable().

Referenced by MakeTaskReady(), and WaitForEvent().

Here is the call graph for this function:

void op_MailBoxInit register t_MAILBOX *mailbox   asm(" "),
register void *initMessage   asm("Ð")
 

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 40 of file opale_event.c.

References EventInit().

Here is the call graph for this function:

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

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 187 of file opale_event.c.

References op_EnterCriticalSection, op_ExitCriticalSection, and WaitForEvent().

Here is the call graph for this function:

unsigned short op_MailBoxPost register t_MAILBOX *mailBox   asm(" "),
register void *message   asm("Ð")
 

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 165 of file opale_event.c.

References MakeTaskReady(), op_EnterCriticalSection, and op_ExitCriticalSection.

Here is the call graph for this function:

void op_QueueInit register t_QUEUE *queue   asm(" "),
register void *buffer   asm("Ð"),
register unsigned short size   asm("Ñ")
 

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 49 of file opale_event.c.

References EventInit().

Here is the call graph for this function:

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

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 261 of file opale_event.c.

References op_EnterCriticalSection, op_ExitCriticalSection, and WaitForEvent().

Here is the call graph for this function:

unsigned short op_QueuePost register t_QUEUE *queue   asm(" "),
register void *message   asm("Ð")
 

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 213 of file opale_event.c.

References MakeTaskReady(), op_EnterCriticalSection, and op_ExitCriticalSection.

Here is the call graph for this function:

unsigned short op_QueuePostFront register t_QUEUE *queue   asm(" "),
register void *message   asm("Ð")
 

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 237 of file opale_event.c.

References MakeTaskReady(), op_EnterCriticalSection, and op_ExitCriticalSection.

Here is the call graph for this function:

void op_SemaphoreInit register t_SEMAPHORE *semaphore   asm(" "),
register unsigned long initValue   asm("Ð")
 

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 (a0.l) Pointer to the t_SEMAPHORE object to initialyze.
initValue (d0.l) Value to initialyze the semaphore with. Remember semaphore are counter and blocking when 0.
Definition at line 31 of file opale_event.c.

References EventInit().

Here is the call graph for this function:

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

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 146 of file opale_event.c.

References op_EnterCriticalSection, op_ExitCriticalSection, and WaitForEvent().

Here is the call graph for this function:

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

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 129 of file opale_event.c.

References MakeTaskReady(), op_EnterCriticalSection, and op_ExitCriticalSection.

Here is the call graph for this function:

void removeTaskFromTable register t_TASK_BLOCK *table   asm(" "),
register unsigned char ident   asm("Ð")
 

Remove a task from a t_TASK_BLOCK. This could be either a table of waiting tasks, or sleeping tasks, or so.

Parameters:
table (a0.l) Pointer to the table
ident (d0.l) Ident of the task to remove
Definition at line 76 of file opale_event.c.

References identToX, and identToY.

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

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

Transfers the current task to the waiting table of the wanted event

Parameters:
event (a0.l) Pointer to the t_EVENT in which table the task is to be put to wait
Definition at line 119 of file opale_event.c.

References currentTask, t_TASK::ident, 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 21:49:20 2005 for Opale by doxygen 1.3.8