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.

I<br />

Writing a SCSI-2 Device Driver<br />

;<br />

;control transfer instructions<br />

; jump <br />

; int when PHASE_NAME<br />

; ...........<br />

;<br />

;INTERRUPT SOURCES<br />

;The SCSI I/O Processor has three main kind of interrupt, scsi, dma interrupt<br />

;and script interrupt. The int instruction allows the controller driver to<br />

;be interrupted with an interrupt value which is stored in the DSPS register.<br />

;*/<br />

#define NCR_COMPILE<br />

#include "xxxScript.h"<br />

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

;*<br />

;* xxxWait - wait for re-selection by target, selection by initiator, or<br />

;* new command from host<br />

;*/<br />

PROC xxxWait:<br />

;setup instuctions here<br />

wait<br />

reselect REL(checkNewCmd)<br />

;<br />

; have been re-selected by a SCSI target<br />

;<br />

reselected:<br />

; handle reselects, insert the reselect logic<br />

int XXX_RESELECTED ; all seems OK so far<br />

;<br />

; May have a new host command to handle<br />

;<br />

checkNewCmd:<br />

I<br />

; insert logic for checking if the processor is connected to the bus<br />

int XXX_READY ; processor is ready for a new thread<br />

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

;*<br />

;* xxxInitStart - start new initiator thread, selecting target and<br />

;* continuing to transfer command, data, messages as requested.<br />

;*<br />

;* At this point the script requires some data in the scratch registers.<br />

;* This is the threads context information.<br />

;*<br />

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

;* information<br />

353

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

Saved successfully!

Ooh no, something went wrong!