01.06.2013 Views

,QWHJUDWLRQ ZLWK 2SHUDWLQJ 6\VWHPV

,QWHJUDWLRQ ZLWK 2SHUDWLQJ 6\VWHPV

,QWHJUDWLRQ ZLWK 2SHUDWLQJ 6\VWHPV

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7LJKW ,<strong>QWHJUDWLRQ</strong><br />

6LJQDOV<br />

The signal header consists of a struct with information needed to handle<br />

the signal inside an SDL system. The signal header struct is defined in<br />

the RTOS-specific file sct.h.<br />

typedef struct xSignalHeaderStruct *xSignalHeader;<br />

typedef struct xSignalHeaderStruct {<br />

int SignalCode;<br />

xSignalHeader Pre, Suc;<br />

SDL_PId Sender;<br />

void *SigP;<br />

#ifdef X_ONE_TASK_PER_INSTANCE_SET<br />

SDL_PId Receiver;<br />

#endif<br />

#ifdef XMSC_TRACE<br />

int SignalId;<br />

int IsTimer;<br />

#endif<br />

} xSignalHeaderRec;<br />

The signal header stores SignalCode, in this case an integer, two pointers<br />

Pre and Suc used when saving the signal in the save queue, and<br />

Sender, holding the SDL_PId of the sending SDL process. In the Instance<br />

Set Model there is an extra parameter Receiver, necessary to<br />

make a distinction between the SDL processes in an instance set task.<br />

If the signal contains parameters they are allocated in the same function<br />

call. Example:<br />

OutputSignalPtr = xAlloc (sizeof (xSignalHeaderRec)<br />

+ sizeof(yPDef_z05_s2));<br />

The second parameter to the xAlloc function is a struct representing the<br />

signal parameters of the signal. In this case, with one integer, it is defined<br />

in the following way:<br />

typedef struct {<br />

SIGNAL_VARS<br />

SDL_Integer Param1;<br />

} yPDef_z05_s2;<br />

The macro SIGNAL_VARS is in most RTOS empty.<br />

There is an extra element in the SignalHeader defined as a void pointer.<br />

This pointer SigP is set to point to the parameter area.<br />

OutputSignalPtr->SigP = OutputSignalPtr+1;<br />

July 2003 Telelogic Tau 4.5 User’s Manual ,um-st1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!