⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 53c8xx_d.h

📁 基于组件方式开发操作系统的OSKIT源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
at 0x00000087 : */	0x90080000,0x00000000,/*; ; select_done; ; PURPOSE: continue on to normal data transfer; called as the exit ;	point from dsa_begin.;; INPUTS: dsa;; CALLS: OK;;select_done:; After a successful selection, we should get either a CMD phase or ; some transfer request negotiation message.    JUMP cmdout, WHEN CMDat 0x00000089 : */	0x820b0000,0x00000244,/*    INT int_err_unexpected_phase, WHEN NOT MSG_IN at 0x0000008b : */	0x9f030000,0x00000000,/*select_msg_in:    CALL msg_in, WHEN MSG_INat 0x0000008d : */	0x8f0b0000,0x00000404,/*    JUMP select_msg_in, WHEN MSG_INat 0x0000008f : */	0x870b0000,0x00000234,/*cmdout:    INT int_err_unexpected_phase, WHEN NOT CMDat 0x00000091 : */	0x9a030000,0x00000000,/*ENTRY cmdout_cmdoutcmdout_cmdout:    MOVE FROM dsa_cmdout, WHEN CMDat 0x00000093 : */	0x1a000000,0x00000048,/*;; data_transfer  ; other_out; other_in; other_transfer;; PURPOSE : handle the main data transfer for a SCSI command in ;	several parts.  In the first part, data_transfer, DATA_IN;	and DATA_OUT phases are allowed, with the user provided;	code (usually dynamically generated based on the scatter/gather;	list associated with a SCSI command) called to handle these ;	phases.;;	After control has passed to one of the user provided ;	DATA_IN or DATA_OUT routines, back calls are made to ;	other_transfer_in or other_transfer_out to handle non-DATA IN;	and DATA OUT phases respectively, with the state of the active;	data pointer being preserved in TEMP.;;	On completion, the user code passes control to other_transfer;	which causes DATA_IN and DATA_OUT to result in unexpected_phase;	interrupts so that data overruns may be trapped.;; INPUTS : DSA - SCSI command;; CALLS : OK in data_transfer_start, not ok in other_out and other_in, ok in;	other_transfer;; MODIFIES : SCRATCH;; EXITS : if STATUS IN is detected, signifying command completion,;	the NCR jumps to command_complete.  If MSG IN occurs, a ;	CALL is made to msg_in.  Otherwise, other_transfer runs in ;	an infinite loop.;	ENTRY data_transferdata_transfer:    JUMP cmdout_cmdout, WHEN CMDat 0x00000095 : */	0x820b0000,0x0000024c,/*    CALL msg_in, WHEN MSG_INat 0x00000097 : */	0x8f0b0000,0x00000404,/*    INT int_err_unexpected_phase, WHEN MSG_OUTat 0x00000099 : */	0x9e0b0000,0x00000000,/*    JUMP do_dataout, WHEN DATA_OUTat 0x0000009b : */	0x800b0000,0x0000028c,/*    JUMP do_datain, WHEN DATA_INat 0x0000009d : */	0x810b0000,0x000002e4,/*    JUMP command_complete, WHEN STATUSat 0x0000009f : */	0x830b0000,0x0000060c,/*    JUMP data_transferat 0x000000a1 : */	0x80080000,0x00000254,/*ENTRY end_data_transferend_data_transfer:;; FIXME: On NCR53c700 and NCR53c700-66 chips, do_dataout/do_datain ; should be fixed up whenever the nexus changes so it can point to the ; correct routine for that command.;; Nasty jump to dsa->dataoutdo_dataout:    CALL dsa_to_scratchat 0x000000a3 : */	0x88080000,0x00000938,/*    MOVE SCRATCH0 + dsa_dataout TO SCRATCH0	at 0x000000a5 : */	0x7e345000,0x00000000,/*    MOVE SCRATCH1 + 0 TO SCRATCH1 WITH CARRY at 0x000000a7 : */	0x7f350000,0x00000000,/*    MOVE SCRATCH2 + 0 TO SCRATCH2 WITH CARRY at 0x000000a9 : */	0x7f360000,0x00000000,/*    MOVE SCRATCH3 + 0 TO SCRATCH3 WITH CARRY at 0x000000ab : */	0x7f370000,0x00000000,/*    MOVE dmode_ncr_to_memory TO DMODEat 0x000000ad : */	0x78380000,0x00000000,/*    MOVE MEMORY 4, addr_scratch, dataout_to_jump + 4at 0x000000af : */	0xc0000004,0x00000000,0x000002d4,/*    MOVE dmode_memory_to_memory TO DMODEat 0x000000b2 : */	0x78380000,0x00000000,/*dataout_to_jump:    MOVE MEMORY 4, 0, dataout_jump + 4 at 0x000000b4 : */	0xc0000004,0x00000000,0x000002e0,/*dataout_jump:    JUMP 0at 0x000000b7 : */	0x80080000,0x00000000,/*; Nasty jump to dsa->dsaindo_datain:    CALL dsa_to_scratchat 0x000000b9 : */	0x88080000,0x00000938,/*    MOVE SCRATCH0 + dsa_datain TO SCRATCH0	at 0x000000bb : */	0x7e345400,0x00000000,/*    MOVE SCRATCH1 + 0 TO SCRATCH1 WITH CARRY at 0x000000bd : */	0x7f350000,0x00000000,/*    MOVE SCRATCH2 + 0 TO SCRATCH2 WITH CARRY at 0x000000bf : */	0x7f360000,0x00000000,/*    MOVE SCRATCH3 + 0 TO SCRATCH3 WITH CARRY at 0x000000c1 : */	0x7f370000,0x00000000,/*    MOVE dmode_ncr_to_memory TO DMODEat 0x000000c3 : */	0x78380000,0x00000000,/*    MOVE MEMORY 4, addr_scratch, datain_to_jump + 4at 0x000000c5 : */	0xc0000004,0x00000000,0x0000032c,/*    MOVE dmode_memory_to_memory TO DMODE		at 0x000000c8 : */	0x78380000,0x00000000,/*ENTRY datain_to_jumpdatain_to_jump:    MOVE MEMORY 4, 0, datain_jump + 4at 0x000000ca : */	0xc0000004,0x00000000,0x00000338,/*datain_jump:    JUMP 0at 0x000000cd : */	0x80080000,0x00000000,/*; Note that other_out and other_in loop until a non-data phase; is discovered, so we only execute return statements when we; can go on to the next data phase block move statement.ENTRY other_outother_out:    INT int_err_unexpected_phase, WHEN CMDat 0x000000cf : */	0x9a0b0000,0x00000000,/*    JUMP msg_in_restart, WHEN MSG_IN at 0x000000d1 : */	0x870b0000,0x000003e4,/*    INT int_err_unexpected_phase, WHEN MSG_OUTat 0x000000d3 : */	0x9e0b0000,0x00000000,/*    INT int_err_unexpected_phase, WHEN DATA_INat 0x000000d5 : */	0x990b0000,0x00000000,/*    JUMP command_complete, WHEN STATUSat 0x000000d7 : */	0x830b0000,0x0000060c,/*    JUMP other_out, WHEN NOT DATA_OUTat 0x000000d9 : */	0x80030000,0x0000033c,/*    RETURNat 0x000000db : */	0x90080000,0x00000000,/*ENTRY other_inother_in:    INT int_err_unexpected_phase, WHEN CMDat 0x000000dd : */	0x9a0b0000,0x00000000,/*    JUMP msg_in_restart, WHEN MSG_IN at 0x000000df : */	0x870b0000,0x000003e4,/*    INT int_err_unexpected_phase, WHEN MSG_OUTat 0x000000e1 : */	0x9e0b0000,0x00000000,/*    INT int_err_unexpected_phase, WHEN DATA_OUTat 0x000000e3 : */	0x980b0000,0x00000000,/*    JUMP command_complete, WHEN STATUSat 0x000000e5 : */	0x830b0000,0x0000060c,/*    JUMP other_in, WHEN NOT DATA_INat 0x000000e7 : */	0x81030000,0x00000374,/*    RETURNat 0x000000e9 : */	0x90080000,0x00000000,/*ENTRY other_transferother_transfer:    INT int_err_unexpected_phase, WHEN CMDat 0x000000eb : */	0x9a0b0000,0x00000000,/*    CALL msg_in, WHEN MSG_INat 0x000000ed : */	0x8f0b0000,0x00000404,/*    INT int_err_unexpected_phase, WHEN MSG_OUTat 0x000000ef : */	0x9e0b0000,0x00000000,/*    INT int_err_unexpected_phase, WHEN DATA_OUTat 0x000000f1 : */	0x980b0000,0x00000000,/*    INT int_err_unexpected_phase, WHEN DATA_INat 0x000000f3 : */	0x990b0000,0x00000000,/*    JUMP command_complete, WHEN STATUSat 0x000000f5 : */	0x830b0000,0x0000060c,/*    JUMP other_transferat 0x000000f7 : */	0x80080000,0x000003ac,/*;; msg_in_restart; msg_in; munge_msg;; PURPOSE : process messages from a target.  msg_in is called when the ;	caller hasn't read the first byte of the message.  munge_message;	is called when the caller has read the first byte of the message,;	and left it in SFBR.  msg_in_restart is called when the caller ;	hasn't read the first byte of the message, and wishes RETURN;	to transfer control back to the address of the conditional;	CALL instruction rather than to the instruction after it.;;	Various int_* interrupts are generated when the host system;	needs to intervene, as is the case with SDTR, WDTR, and;	INITIATE RECOVERY messages.;;	When the host system handles one of these interrupts,;	it can respond by reentering at reject_message, ;	which rejects the message and returns control to;	the caller of msg_in or munge_msg, accept_message;	which clears ACK and returns control, or reply_message;	which sends the message pointed to by the DSA ;	msgout_other table indirect field.;;	DISCONNECT messages are handled by moving the command;	to the reconnect_dsa_queue.;; INPUTS : DSA - SCSI COMMAND, SFBR - first byte of message (munge_msg;	only);; CALLS : NO.  The TEMP register isn't backed up to allow nested calls.;; MODIFIES : SCRATCH, DSA on DISCONNECT;; EXITS : On receipt of SAVE DATA POINTER, RESTORE POINTERS,;	and normal return from message handlers running under;	Linux, control is returned to the caller.  Receipt;	of DISCONNECT messages pass control to dsa_schedule.;ENTRY msg_in_restartmsg_in_restart:; XXX - hackish;; Since it's easier to debug changes to the statically ; compiled code, rather than the dynamically generated ; stuff, such as;; 	MOVE x, y, WHEN data_phase; 	CALL other_z, WHEN NOT data_phase; 	MOVE x, y, WHEN data_phase;; I'd like to have certain routines (notably the message handler); restart on the conditional call rather than the next instruction.;; So, subtract 8 from the return address    MOVE TEMP0 + 0xf8 TO TEMP0at 0x000000f9 : */	0x7e1cf800,0x00000000,/*    MOVE TEMP1 + 0xff TO TEMP1 WITH CARRYat 0x000000fb : */	0x7f1dff00,0x00000000,/*    MOVE TEMP2 + 0xff TO TEMP2 WITH CARRYat 0x000000fd : */	0x7f1eff00,0x00000000,/*    MOVE TEMP3 + 0xff TO TEMP3 WITH CARRYat 0x000000ff : */	0x7f1fff00,0x00000000,/*ENTRY msg_inmsg_in:    MOVE 1, msg_buf, WHEN MSG_INat 0x00000101 : */	0x0f000001,0x00000000,/*munge_msg:    JUMP munge_extended, IF 0x01		; EXTENDED MESSAGEat 0x00000103 : */	0x800c0001,0x00000524,/*    JUMP munge_2, IF 0x20, AND MASK 0xdf	; two byte messageat 0x00000105 : */	0x800cdf20,0x0000044c,/*;; XXX - I've seen a handful of broken SCSI devices which fail to issue; 	a SAVE POINTERS message before disconnecting in the middle of ; 	a transfer, assuming that the DATA POINTER will be implicitly ; 	restored.  ;; Historically, I've often done an implicit save when the DISCONNECT; message is processed.  We may want to consider having the option of ; doing that here. ;    JUMP munge_save_data_pointer, IF 0x02	; SAVE DATA POINTERat 0x00000107 : */	0x800c0002,0x00000454,/*    JUMP munge_restore_pointers, IF 0x03	; RESTORE POINTERS at 0x00000109 : */	0x800c0003,0x000004b8,/*    JUMP munge_disconnect, IF 0x04		; DISCONNECTat 0x0000010b : */	0x800c0004,0x0000051c,/*    INT int_msg_1, IF 0x07			; MESSAGE REJECTat 0x0000010d : */	0x980c0007,0x01020000,/*    INT int_msg_1, IF 0x0f			; INITIATE RECOVERYat 0x0000010f : */	0x980c000f,0x01020000,/*    JUMP reject_messageat 0x00000111 : */	0x80080000,0x000005b4,/*munge_2:    JUMP reject_messageat 0x00000113 : */	0x80080000,0x000005b4,/*;; The SCSI standard allows targets to recover from transient ; error conditions by backing up the data pointer with a ; RESTORE POINTERS message.  ;	; So, we must save and restore the _residual_ code as well as ; the current instruction pointer.  Because of this messiness,; it is simpler to put dynamic code in the dsa for this and to; just do a simple jump down there. ;munge_save_data_pointer:    MOVE DSA0 + dsa_save_data_pointer TO SFBRat 0x00000115 : */	0x76100000,0x00000000,/*    MOVE SFBR TO SCRATCH0at 0x00000117 : */	0x6a340000,0x00000000,/*    MOVE DSA1 + 0xff TO SFBR WITH CARRYat 0x00000119 : */	0x7711ff00,0x00000000,/*    MOVE SFBR TO SCRATCH1at 0x0000011b : */	0x6a350000,0x00000000,/*    MOVE DSA2 + 0xff TO SFBR WITH CARRY at 0x0000011d : */	0x7712ff00,0x00000000,/*    MOVE SFBR TO SCRATCH2at 0x0000011f : */	0x6a360000,0x00000000,/*    MOVE DSA3 + 0xff TO SFBR WITH CARRYat 0x00000121 : */	0x7713ff00,0x00000000,/*    MOVE SFBR TO SCRATCH3at 0x00000123 : */	0x6a370000,0x00000000,/*    MOVE dmode_ncr_to_memory TO DMODEat 0x00000125 : */	0x78380000,0x00000000,/*    MOVE MEMORY 4, addr_scratch, jump_dsa_save + 4at 0x00000127 : */	0xc0000004,0x00000000,0x000004b4,/*    MOVE dmode_memory_to_memory TO DMODEat 0x0000012a : */	0x78380000,0x00000000,/*jump_dsa_save:    JUMP 0at 0x0000012c : */	0x80080000,0x00000000,/*munge_restore_pointers:    MOVE DSA0 + dsa_restore_pointers TO SFBRat 0x0000012e : */	0x76100000,0x00000000,/*    MOVE SFBR TO SCRATCH0at 0x00000130 : */	0x6a340000,0x00000000,/*    MOVE DSA1 + 0xff TO SFBR WITH CARRYat 0x00000132 : */	0x7711ff00,0x00000000,/*    MOVE SFBR TO SCRATCH1at 0x00000134 : */	0x6a350000,0x00000000,/*    MOVE DSA2 + 0xff TO SFBR WITH CARRYat 0x00000136 : */	0x7712ff00,0x00000000,/*    MOVE SFBR TO SCRATCH2at 0x00000138 : */	0x6a360000,0x00000000,/*    MOVE DSA3 + 0xff TO SFBR WITH CARRYat 0x0000013a : */	0x7713ff00,0x00000000,/*    MOVE SFBR TO SCRATCH3at 0x0000013c : */	0x6a370000,0x00000000,/*    MOVE dmode_ncr_to_memory TO DMODEat 0x0000013e : */	0x78380000,0x00000000,/*    MOVE MEMORY 4, addr_scratch, jump_dsa_restore + 4at 0x00000140 : */	0xc0000004,0x00000000,0x00000518,/*    MOVE dmode_memory_to_memory TO DMODEat 0x00000143 : */	0x78380000,0x00000000,/*jump_dsa_restore:    JUMP 0at 0x00000145 : */	0x80080000,0x00000000,/*munge_disconnect:     JUMP dsa_scheduleat 0x00000147 : */	0x80080000,0x00000168,/*munge_extended:    CLEAR ACKat 0x00000149 : */	0x60000040,0x00000000,/*    INT int_err_unexpected_phase, WHEN NOT MSG_INat 0x0000014b : */	0x9f030000,0x00000000,/*    MOVE 1, msg_buf + 1, WHEN MSG_INat 0x0000014d : */	0x0f000001,0x00000001,/*    JUMP munge_extended_2, IF 0x02at 0x0000014f : */	0x800c0002,0x00000554,/*    JUMP munge_extended_3, IF 0x03 at 0x00000151 : */	0x800c0003,0x00000584,/*    JUMP reject_messageat 0x00000153 : */	0x80080000,0x000005b4,/*munge_extended_2:    CLEAR ACKat 0x00000155 : */	0x60000040,0x00000000,/*    MOVE 1, msg_buf + 2, WHEN MSG_INat 0x00000157 : */	0x0f000001,0x00000002,/*    JUMP reject_message, IF NOT 0x02	; Must be WDTRat 0x00000159 : */	0x80040002,0x000005b4,/*    CLEAR ACKat 0x0000015b : */	0x60000040,0x00000000,/*    MOVE 1, msg_buf + 3, WHEN MSG_INat 0x0000015d : */	0x0f000001,0x00000003,/*    INT int_msg_wdtrat 0x0000015f : */	0x98080000,0x01000000,/*munge_extended_3:    CLEAR ACK

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -