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

📄 53c8xx_d.h

📁 基于组件方式开发操作系统的OSKIT源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
at 0x00000161 : */	0x60000040,0x00000000,/*    MOVE 1, msg_buf + 2, WHEN MSG_INat 0x00000163 : */	0x0f000001,0x00000002,/*    JUMP reject_message, IF NOT 0x01	; Must be SDTRat 0x00000165 : */	0x80040001,0x000005b4,/*    CLEAR ACKat 0x00000167 : */	0x60000040,0x00000000,/*    MOVE 2, msg_buf + 3, WHEN MSG_INat 0x00000169 : */	0x0f000002,0x00000003,/*    INT int_msg_sdtrat 0x0000016b : */	0x98080000,0x01010000,/*ENTRY reject_messagereject_message:    SET ATNat 0x0000016d : */	0x58000008,0x00000000,/*    CLEAR ACKat 0x0000016f : */	0x60000040,0x00000000,/*    MOVE 1, NCR53c7xx_msg_reject, WHEN MSG_OUTat 0x00000171 : */	0x0e000001,0x00000000,/*    RETURNat 0x00000173 : */	0x90080000,0x00000000,/*ENTRY accept_messageaccept_message:    CLEAR ATNat 0x00000175 : */	0x60000008,0x00000000,/*    CLEAR ACKat 0x00000177 : */	0x60000040,0x00000000,/*    RETURNat 0x00000179 : */	0x90080000,0x00000000,/*ENTRY respond_messagerespond_message:    SET ATNat 0x0000017b : */	0x58000008,0x00000000,/*    CLEAR ACKat 0x0000017d : */	0x60000040,0x00000000,/*    MOVE FROM dsa_msgout_other, WHEN MSG_OUTat 0x0000017f : */	0x1e000000,0x00000068,/*    RETURNat 0x00000181 : */	0x90080000,0x00000000,/*;; command_complete;; PURPOSE : handle command termination when STATUS IN is detected by reading;	a status byte followed by a command termination message. ;;	Normal termination results in an INTFLY instruction, and ;	the host system can pick out which command terminated by ;	examining the MESSAGE and STATUS buffers of all currently ;	executing commands;;;	Abnormal (CHECK_CONDITION) termination results in an;	int_err_check_condition interrupt so that a REQUEST SENSE;	command can be issued out-of-order so that no other command;	clears the contingent allegiance condition.;	;; INPUTS : DSA - command	;; CALLS : OK;; EXITS : On successful termination, control is passed to schedule.;	On abnormal termination, the user will usually modify the ;	DSA fields and corresponding buffers and return control;	to select.;ENTRY command_completecommand_complete:    MOVE FROM dsa_status, WHEN STATUSat 0x00000183 : */	0x1b000000,0x00000060,/*    MOVE SFBR TO SCRATCH0		; Save statusat 0x00000185 : */	0x6a340000,0x00000000,/*ENTRY command_complete_msgincommand_complete_msgin:    MOVE FROM dsa_msgin, WHEN MSG_INat 0x00000187 : */	0x1f000000,0x00000058,/*; Indicate that we should be expecting a disconnect    MOVE SCNTL2 & 0x7f TO SCNTL2at 0x00000189 : */	0x7c027f00,0x00000000,/*    CLEAR ACKat 0x0000018b : */	0x60000040,0x00000000,/*    WAIT DISCONNECTat 0x0000018d : */	0x48000000,0x00000000,/*;; The SCSI specification states that when a UNIT ATTENTION condition; is pending, as indicated by a CHECK CONDITION status message,; the target shall revert to asynchronous transfers.  Since; synchronous transfers parameters are maintained on a per INITIATOR/TARGET ; basis, and returning control to our scheduler could work on a command; running on another lun on that target using the old parameters, we must; interrupt the host processor to get them changed, or change them ourselves.;; Once SCSI-II tagged queueing is implemented, things will be even more; hairy, since contingent allegiance conditions exist on a per-target/lun; basis, and issuing a new command with a different tag would clear it.; In these cases, we must interrupt the host processor to get a request ; added to the HEAD of the queue with the request sense command, or we; must automatically issue the request sense command.    INTFLYat 0x0000018f : */	0x98180000,0x00000000,/*    JUMP scheduleat 0x00000191 : */	0x80080000,0x00000000,/*command_failed:    INT int_err_check_conditionat 0x00000193 : */	0x98080000,0x00030000,/*;; wait_reselect;; PURPOSE : This is essentially the idle routine, where control lands;	when there are no new processes to schedule.  wait_reselect;	waits for reselection, selection, and new commands.;;	When a successful reselection occurs, with the aid ;	of fixed up code in each DSA, wait_reselect walks the ;	reconnect_dsa_queue, asking each dsa if the target ID;	and LUN match its.;;	If a match is found, a call is made back to reselected_ok,;	which through the miracles of self modifying code, extracts;	the found DSA from the reconnect_dsa_queue and then ;	returns control to the DSAs thread of execution.;; INPUTS : NONE;; CALLS : OK;; MODIFIES : DSA,;; EXITS : On successful reselection, control is returned to the ;	DSA which called reselected_ok.  If the WAIT RESELECT;	was interrupted by a new commands arrival signaled by ;	SIG_P, control is passed to schedule.  If the NCR is ;	selected, the host system is interrupted with an ;	int_err_selected which is usually responded to by;	setting DSP to the target_abort address.ENTRY wait_reselectwait_reselect:    WAIT RESELECT wait_reselect_failedat 0x00000195 : */	0x50000000,0x0000076c,/*reselected:    CLEAR TARGETat 0x00000197 : */	0x60000200,0x00000000,/*    MOVE dmode_memory_to_memory TO DMODEat 0x00000199 : */	0x78380000,0x00000000,/*    ; Read all data needed to reestablish the nexus -     MOVE 1, reselected_identify, WHEN MSG_INat 0x0000019b : */	0x0f000001,0x00000000,/*    ; We used to CLEAR ACK here.    ; Point DSA at the current head of the disconnected queue.    MOVE dmode_memory_to_ncr  TO DMODEat 0x0000019d : */	0x78380000,0x00000000,/*    MOVE MEMORY 4, reconnect_dsa_head, addr_scratchat 0x0000019f : */	0xc0000004,0x00000000,0x00000000,/*    MOVE dmode_memory_to_memory TO DMODEat 0x000001a2 : */	0x78380000,0x00000000,/*    CALL scratch_to_dsaat 0x000001a4 : */	0x88080000,0x00000980,/*    ; Fix the update-next pointer so that the reconnect_dsa_head    ; pointer is the one that will be updated if this DSA is a hit     ; and we remove it from the queue.    MOVE MEMORY 4, addr_reconnect_dsa_head, reselected_ok + 8at 0x000001a6 : */	0xc0000004,0x00000000,0x00000758,/*ENTRY reselected_check_nextreselected_check_next:    ; Check for a NULL pointer.    MOVE DSA0 TO SFBRat 0x000001a9 : */	0x72100000,0x00000000,/*    JUMP reselected_not_end, IF NOT 0at 0x000001ab : */	0x80040000,0x000006ec,/*    MOVE DSA1 TO SFBRat 0x000001ad : */	0x72110000,0x00000000,/*    JUMP reselected_not_end, IF NOT 0at 0x000001af : */	0x80040000,0x000006ec,/*    MOVE DSA2 TO SFBRat 0x000001b1 : */	0x72120000,0x00000000,/*    JUMP reselected_not_end, IF NOT 0at 0x000001b3 : */	0x80040000,0x000006ec,/*    MOVE DSA3 TO SFBRat 0x000001b5 : */	0x72130000,0x00000000,/*    JUMP reselected_not_end, IF NOT 0at 0x000001b7 : */	0x80040000,0x000006ec,/*    INT int_err_unexpected_reselectat 0x000001b9 : */	0x98080000,0x00020000,/*reselected_not_end:    ;    ; XXX the ALU is only eight bits wide, and the assembler    ; wont do the dirt work for us.  As long as dsa_check_reselect    ; is negative, we need to sign extend with 1 bits to the full    ; 32 bit width of the address.    ;    ; A potential work around would be to have a known alignment     ; of the DSA structure such that the base address plus     ; dsa_check_reselect doesn't require carrying from bytes     ; higher than the LSB.    ;    MOVE DSA0 TO SFBRat 0x000001bb : */	0x72100000,0x00000000,/*    MOVE SFBR + dsa_check_reselect TO SCRATCH0at 0x000001bd : */	0x6e340000,0x00000000,/*    MOVE DSA1 TO SFBRat 0x000001bf : */	0x72110000,0x00000000,/*    MOVE SFBR + 0xff TO SCRATCH1 WITH CARRYat 0x000001c1 : */	0x6f35ff00,0x00000000,/*    MOVE DSA2 TO SFBRat 0x000001c3 : */	0x72120000,0x00000000,/*    MOVE SFBR + 0xff TO SCRATCH2 WITH CARRYat 0x000001c5 : */	0x6f36ff00,0x00000000,/*    MOVE DSA3 TO SFBRat 0x000001c7 : */	0x72130000,0x00000000,/*    MOVE SFBR + 0xff TO SCRATCH3 WITH CARRYat 0x000001c9 : */	0x6f37ff00,0x00000000,/*    MOVE dmode_ncr_to_memory TO DMODEat 0x000001cb : */	0x78380000,0x00000000,/*    MOVE MEMORY 4, addr_scratch, reselected_check + 4at 0x000001cd : */	0xc0000004,0x00000000,0x0000074c,/*    MOVE dmode_memory_to_memory TO DMODEat 0x000001d0 : */	0x78380000,0x00000000,/*reselected_check:    JUMP 0at 0x000001d2 : */	0x80080000,0x00000000,/*;;ENTRY reselected_okreselected_ok:    MOVE MEMORY 4, 0, 0				; Patched : first wordat 0x000001d4 : */	0xc0000004,0x00000000,0x00000000,/*						; 	is address of 						;       successful dsa_next						; Second word is last 						;	unsuccessful dsa_next,						;	starting with 						;       dsa_reconnect_head    ; We used to CLEAR ACK here.    RETURN					; Return control to whereat 0x000001d7 : */	0x90080000,0x00000000,/*selected:    INT int_err_selected;at 0x000001d9 : */	0x98080000,0x00010000,/*;; A select or reselect failure can be caused by one of two conditions : ; 1.  SIG_P was set.  This will be the case if the user has written;	a new value to a previously NULL head of the issue queue.;; 2.  The NCR53c810 was selected or reselected by another device.;; 3.  The bus was already busy since we were selected or reselected;	before starting the command.wait_reselect_failed:; Check selected bit.      MOVE SIST0 & 0x20 TO SFBRat 0x000001db : */	0x74422000,0x00000000,/*    JUMP selected, IF 0x20at 0x000001dd : */	0x800c0020,0x00000764,/*; Reading CTEST2 clears the SIG_P bit in the ISTAT register.    MOVE CTEST2 & 0x40 TO SFBR	at 0x000001df : */	0x741a4000,0x00000000,/*    JUMP schedule, IF 0x40at 0x000001e1 : */	0x800c0040,0x00000000,/*; Check connected bit.  ; FIXME: this needs to change if we support target mode    MOVE ISTAT & 0x08 TO SFBRat 0x000001e3 : */	0x74140800,0x00000000,/*    JUMP reselected, IF 0x08at 0x000001e5 : */	0x800c0008,0x0000065c,/*; FIXME : Something bogus happened, and we shouldn't fail silently.    INT int_debug_panicat 0x000001e7 : */	0x98080000,0x030b0000,/*select_failed:; Otherwise, mask the selected and reselected bits off SIST0    MOVE SIST0 & 0x30 TO SFBRat 0x000001e9 : */	0x74423000,0x00000000,/*    JUMP selected, IF 0x20at 0x000001eb : */	0x800c0020,0x00000764,/*    JUMP reselected, IF 0x10 at 0x000001ed : */	0x800c0010,0x0000065c,/*; If SIGP is set, the user just gave us another command, and; we should restart or return to the scheduler.; Reading CTEST2 clears the SIG_P bit in the ISTAT register.    MOVE CTEST2 & 0x40 TO SFBR	at 0x000001ef : */	0x741a4000,0x00000000,/*    JUMP select, IF 0x40at 0x000001f1 : */	0x800c0040,0x000001fc,/*; Check connected bit.  ; FIXME: this needs to change if we support target mode; FIXME: is this really necessary?     MOVE ISTAT & 0x08 TO SFBRat 0x000001f3 : */	0x74140800,0x00000000,/*    JUMP reselected, IF 0x08at 0x000001f5 : */	0x800c0008,0x0000065c,/*; FIXME : Something bogus happened, and we shouldn't fail silently.    INT int_debug_panicat 0x000001f7 : */	0x98080000,0x030b0000,/*;; test_1; test_2;; PURPOSE : run some verification tests on the NCR.  test_1;	copies test_src to test_dest and interrupts the host;	processor, testing for cache coherency and interrupt; 	problems in the processes.;;	test_2 runs a command with offsets relative to the ;	DSA on entry, and is useful for miscellaneous experimentation.;; Verify that interrupts are working correctly and that we don't ; have a cache invalidation problem.ABSOLUTE test_src = 0, test_dest = 0ENTRY test_1test_1:    MOVE MEMORY 4, test_src, test_destat 0x000001f9 : */	0xc0000004,0x00000000,0x00000000,/*    INT int_test_1at 0x000001fc : */	0x98080000,0x04000000,/*;; Run arbitrary commands, with test code establishing a DSA; ENTRY test_2test_2:    CLEAR TARGETat 0x000001fe : */	0x60000200,0x00000000,/*    SELECT ATN FROM 0, test_2_failat 0x00000200 : */	0x43000000,0x00000850,/*    JUMP test_2_msgout, WHEN MSG_OUTat 0x00000202 : */	0x860b0000,0x00000810,/*ENTRY test_2_msgouttest_2_msgout:    MOVE FROM 8, WHEN MSG_OUTat 0x00000204 : */	0x1e000000,0x00000008,/*    MOVE FROM 16, WHEN CMD at 0x00000206 : */	0x1a000000,0x00000010,/*    MOVE FROM 24, WHEN DATA_INat 0x00000208 : */	0x19000000,0x00000018,/*    MOVE FROM 32, WHEN STATUSat 0x0000020a : */	0x1b000000,0x00000020,/*    MOVE FROM 40, WHEN MSG_INat 0x0000020c : */	0x1f000000,0x00000028,/*    MOVE SCNTL2 & 0x7f TO SCNTL2at 0x0000020e : */	0x7c027f00,0x00000000,/*    CLEAR ACKat 0x00000210 : */	0x60000040,0x00000000,/*    WAIT DISCONNECTat 0x00000212 : */	0x48000000,0x00000000,/*test_2_fail:    INT int_test_2at 0x00000214 : */	0x98080000,0x04010000,/*ENTRY debug_breakdebug_break:    INT int_debug_breakat 0x00000216 : */	0x98080000,0x03000000,/*;; initiator_abort; target_abort;; PURPOSE : Abort the currently established nexus from with initiator;	or target mode.;;  ENTRY target_aborttarget_abort:    SET TARGETat 0x00000218 : */	0x58000200,0x00000000,/*    DISCONNECTat 0x0000021a : */	0x48000000,0x00000000,/*    CLEAR TARGETat 0x0000021c : */	0x60000200,0x00000000,/*    JUMP scheduleat 0x0000021e : */	0x80080000,0x00000000,/*    ENTRY initiator_abortinitiator_abort:    SET ATNat 0x00000220 : */	0x58000008,0x00000000,/*;; The SCSI-I specification says that targets may go into MSG out at ; their leisure upon receipt of the ATN single.  On all versions of the ; specification, we can't change phases until REQ transitions true->false, ; so we need to sink/source one byte of data to allow the transition.;; For the sake of safety, we'll only source one byte of data in all ; cases, but to accommodate the SCSI-I dain bramage, we'll sink an  ; arbitrary number of bytes.    JUMP spew_cmd, WHEN CMDat 0x00000222 : */	0x820b0000,0x000008b8,/*    JUMP eat_msgin, WHEN MSG_INat 0x00000224 : */	0x870b0000,0x000008c8,/*    JUMP eat_datain, WHEN DATA_INat 0x00000226 : */	0x810b0000,0x000008f8,/*    JUMP eat_status, WHEN STATUSat 0x00000228 : */	0x830b0000,0x000008e0,/*

⌨️ 快捷键说明

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