02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

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.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

}<br />

entryPt = XXX_SCRIPT_TGT_DISCONNECT;<br />

break;<br />

/* Resume thread if it is still connected */<br />

xxxResume (pSiop, pThread, entryPt);<br />

}<br />

/***************************************************************************<br />

*<br />

* xxxResume - resume a script corresponding to a suspended thread<br />

*<br />

* NOTE: the script can only be resumed if the controller is currently idle.<br />

* To avoid races, interrupts must be locked while this is checked and the<br />

* script re-started.<br />

*<br />

* Reasons why the controller might not be idle include SCSI bus reset and<br />

* unexpected disconnection, both of which might occur in practice. Hence<br />

* this is not considered to be a major software error.<br />

*<br />

* RETURNS: OK, or ERROR if the controller is in an invalid state (this<br />

* should not be treated as a major software failure).<br />

*/<br />

LOCAL STATUS xxxResume<br />

(<br />

SIOP * pSiop, /* ptr to controller info */<br />

XXX_THREAD * pThread, /* ptr to thread info */<br />

XXX_SCRIPT_ENTRY entryId /* entry point of script to resume */<br />

)<br />

{<br />

STATUS status;<br />

int key;<br />

/*<br />

* Check validity of connection and start script if OK<br />

*/<br />

key = intLock ();<br />

xxxScriptStart (pSiop, pThread, entryId);<br />

pSiop->state = NCR810_STATE_ACTIVE;<br />

status = OK;<br />

intUnlock (key);<br />

return (status);<br />

}<br />

/***************************************************************************<br />

*<br />

* xxxInitEvent - XXX SCSI controller initiator thread event processing rout<br />

*<br />

* Parse the event type and handle it accordingly. This may result in state<br />

* changes for the thread, state variables being updated, etc.<br />

346

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

Saved successfully!

Ooh no, something went wrong!