02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VxWorks 5.5<br />

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

;*<br />

;*/<br />

PROC xxxInitStart:<br />

;<br />

; If required to identify, select w. ATN and try to transfer IDENTIFY message<br />

; (if this fails, continue silently). Otherwise, select without ATN.<br />

;<br />

select atn from OFFSET_DEVICE, REL(checkNewCmd)<br />

; add code to test various processor states and conditions interrupt driver<br />

; if neccessary.<br />

jump<br />

REL(nextPhase)<br />

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

;*<br />

;* xxxInitContinue - resume an initiator thread<br />

;*<br />

;* At this point the script requires the threads context information in<br />

;* scratch registers<br />

;*<br />

;* When the script finishes, these scratch registers are updated with the<br />

;* the latest context information<br />

;*/<br />

PROC xxxInitContinue:<br />

; some setup code...<br />

nextPhase:<br />

;<br />

; Normal info transfer request processing<br />

;<br />

phaseSwitch:<br />

jump REL(doDataOut), when DATA_OUT<br />

jump REL(doDataIn) if DATA_IN<br />

jump REL(doCommand) if COMMAND<br />

jump REL(doStatus) if STATUS<br />

jump REL(doMsgOut) if MSG_OUT<br />

jump REL(doMsgIn) if MSG_IN<br />

int XXX_ILLEGAL_PHASE<br />

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

;*<br />

;* doDataOut - handle DATA OUT phase<br />

;*/<br />

doDataOut:<br />

;...<br />

jump<br />

REL(nextPhase)<br />

354

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

Saved successfully!

Ooh no, something went wrong!