This page is "http://www.cs.tut.fi/~albert/BOAR/exec.html".
is_Code( ULONG is_Data (D0), UWORD *StackFrame (A1) );
Cause() is used by the message passing system to implement message ports that create soft-interrupts whenever a message arrives.
The allocation method used is 'first fit'. The first block in the free memory list that is big enough is returned.
If the block being freed is adjacent to other free memory blocks, they are merged.
Do NOT use FreeRemember() on a memory block that is not allocated with AllocRemember()!
A node can only exist in one list at a time. A node MUST be removed from the current list before adding it into another. Also, a node MUST NOT be removed if it isn't currently in a list.
Remember that node names may not be unique. Because of the way FindName() operates, you can pass it a node structure also. You can use the following construct to find all entries in a list with a name.
struct List *mylist; struct Node *node; node = (struct Node *)mylist; while((node = FindName((struct List *)node, name))) { /* Do something with the node. */ }
Remember that task names are not unique and many tasks with the same name may be present in the task lists.
OBSERVE:
Currently the new priority will take effect the next time
the task gets the CPU. This can be considered
a misfeature, but because priority changes are not very
often done to other tasks, this predictable delay was
considered acceptable.
SetSignal(0, 0) can be used to read the current signal state without affecting the signals.
Signal() may be called from an interrupt.
Programs added with AddProgram() can be loaded and relocated by the dos.library call ROMLoadSeg() .
OBSERVE:
It is not safe to remove a public port, because there is no
record of the tasks holding a reference to the port.
A semi-safe solution is to 1) remove the port from
the public port list 2) wait some time for any messages to
the port and only if no messages arrive, 3) delete the port.
This assumes that if a task gets a reference to a public port,
it supposedly will use that reference in the near future to
send a message into that port.
If you need public ports that may be safely removed, use public semaphores, because they have reference counts.
Remember that removing a public port is not totally safe. See the description under RemPort().
Remember that port names are not unique.
One-way communication is also possible. In this case the receiver does not reply to the message and must free or reuse the message received. This is only possible between tasks that are written like this.
Remember that several messages may have been arrived at the message port and you only get one signal. Use while() to process all the messages before waiting again. If you use WaitPort(), it takes care of this for you (checks the port before waiting). Also, special care must be taken to ensure that the message port is empty before exiting.
DO NOT try to patch Disable()/Enable() nor Forbid()/Permit() .
Forbid();
while(1)
{
if(sem->ss_Public == 0)
{
RemSemaphore(sem);
break;
}
/* Delay() breaks Forbid() state */
Delay(100);
}
Permit();
Remember that public semaphore names are not guaranteed to be unique by the system.