📄 sym_fw1.h
字号:
SCR_MOVE_TBL ^ SCR_MSG_OUT, offsetof (struct sym_hcb, abrt_tbl), SCR_CLR (SCR_ACK|SCR_ATN), 0, SCR_WAIT_DISC, 0, /* * Tell the C code that we are done. */ SCR_INT, SIR_ABORT_SENT,}/*-------------------------< SEL_FOR_ABORT_1 >------------------*/,{ /* * Jump at scheduler. */ SCR_JUMP, PADDR_A (start),}/*-------------------------< MSG_IN_ETC >-----------------------*/,{ /* * If it is an EXTENDED (variable size message) * Handle it. */ SCR_JUMP ^ IFTRUE (DATA (M_EXTENDED)), PADDR_B (msg_extended), /* * Let the C code handle any other * 1 byte message. */ SCR_JUMP ^ IFTRUE (MASK (0x00, 0xf0)), PADDR_B (msg_received), SCR_JUMP ^ IFTRUE (MASK (0x10, 0xf0)), PADDR_B (msg_received), /* * We donnot handle 2 bytes messages from SCRIPTS. * So, let the C code deal with these ones too. */ SCR_JUMP ^ IFFALSE (MASK (0x20, 0xf0)), PADDR_B (msg_weird_seen), SCR_CLR (SCR_ACK), 0, SCR_MOVE_ABS (1) ^ SCR_MSG_IN, HADDR_1 (msgin[1]),}/*-------------------------< MSG_RECEIVED >---------------------*/,{ SCR_COPY (4), /* DUMMY READ */ HADDR_1 (scratch), RADDR_1 (scratcha), SCR_INT, SIR_MSG_RECEIVED,}/*-------------------------< MSG_WEIRD_SEEN >-------------------*/,{ SCR_COPY (4), /* DUMMY READ */ HADDR_1 (scratch), RADDR_1 (scratcha), SCR_INT, SIR_MSG_WEIRD,}/*-------------------------< MSG_EXTENDED >---------------------*/,{ /* * Clear ACK and get the next byte * assumed to be the message length. */ SCR_CLR (SCR_ACK), 0, SCR_MOVE_ABS (1) ^ SCR_MSG_IN, HADDR_1 (msgin[1]), /* * Try to catch some unlikely situations as 0 length * or too large the length. */ SCR_JUMP ^ IFTRUE (DATA (0)), PADDR_B (msg_weird_seen), SCR_TO_REG (scratcha), 0, SCR_REG_REG (sfbr, SCR_ADD, (256-8)), 0, SCR_JUMP ^ IFTRUE (CARRYSET), PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. * Read the amount of data correponding to the * message length and call the C code. */ SCR_COPY (1), RADDR_1 (scratcha), PADDR_B (_sms_b10), SCR_CLR (SCR_ACK), 0,}/*-------------------------< _SMS_B10 >-------------------------*/,{ SCR_MOVE_ABS (0) ^ SCR_MSG_IN, HADDR_1 (msgin[2]), SCR_JUMP, PADDR_B (msg_received),}/*-------------------------< MSG_BAD >--------------------------*/,{ /* * unimplemented message - reject it. */ SCR_INT, SIR_REJECT_TO_SEND, SCR_SET (SCR_ATN), 0, SCR_JUMP, PADDR_A (clrack),}/*-------------------------< MSG_WEIRD >------------------------*/,{ /* * weird message received * ignore all MSG IN phases and reject it. */ SCR_INT, SIR_REJECT_TO_SEND, SCR_SET (SCR_ATN), 0,}/*-------------------------< MSG_WEIRD1 >-----------------------*/,{ SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), PADDR_A (dispatch), SCR_MOVE_ABS (1) ^ SCR_MSG_IN, HADDR_1 (scratch), SCR_JUMP, PADDR_B (msg_weird1),}/*-------------------------< WDTR_RESP >------------------------*/,{ /* * let the target fetch our answer. */ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), PADDR_B (nego_bad_phase),}/*-------------------------< SEND_WDTR >------------------------*/,{ /* * Send the M_X_WIDE_REQ */ SCR_MOVE_ABS (4) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_JUMP, PADDR_B (msg_out_done),}/*-------------------------< SDTR_RESP >------------------------*/,{ /* * let the target fetch our answer. */ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), PADDR_B (nego_bad_phase),}/*-------------------------< SEND_SDTR >------------------------*/,{ /* * Send the M_X_SYNC_REQ */ SCR_MOVE_ABS (5) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_JUMP, PADDR_B (msg_out_done),}/*-------------------------< PPR_RESP >-------------------------*/,{ /* * let the target fetch our answer. */ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), PADDR_B (nego_bad_phase),}/*-------------------------< SEND_PPR >-------------------------*/,{ /* * Send the M_X_PPR_REQ */ SCR_MOVE_ABS (8) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_JUMP, PADDR_B (msg_out_done),}/*-------------------------< NEGO_BAD_PHASE >-------------------*/,{ SCR_INT, SIR_NEGO_PROTO, SCR_JUMP, PADDR_A (dispatch),}/*-------------------------< MSG_OUT >--------------------------*/,{ /* * The target requests a message. * We donnot send messages that may * require the device to go to bus free. */ SCR_MOVE_ABS (1) ^ SCR_MSG_OUT, HADDR_1 (msgout), /* * ... wait for the next phase * if it's a message out, send it again, ... */ SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_OUT)), PADDR_B (msg_out),}/*-------------------------< MSG_OUT_DONE >---------------------*/,{ /* * Let the C code be aware of the * sent message and clear the message. */ SCR_INT, SIR_MSG_OUT_DONE, /* * ... and process the next phase */ SCR_JUMP, PADDR_A (dispatch),}/*-------------------------< DATA_OVRUN >-----------------------*/,{ /* * Zero scratcha that will count the * extras bytes. */ SCR_COPY (4), PADDR_B (zero), RADDR_1 (scratcha),}/*-------------------------< DATA_OVRUN1 >----------------------*/,{ /* * The target may want to transfer too much data. * * If phase is DATA OUT write 1 byte and count it. */ SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_OUT)), 16, SCR_CHMOV_ABS (1) ^ SCR_DATA_OUT, HADDR_1 (scratch), SCR_JUMP, PADDR_B (data_ovrun2), /* * If WSR is set, clear this condition, and * count this byte. */ SCR_FROM_REG (scntl2), 0, SCR_JUMPR ^ IFFALSE (MASK (WSR, WSR)), 16, SCR_REG_REG (scntl2, SCR_OR, WSR), 0, SCR_JUMP, PADDR_B (data_ovrun2), /* * Finally check against DATA IN phase. * Signal data overrun to the C code * and jump to dispatcher if not so. * Read 1 byte otherwise and count it. */ SCR_JUMPR ^ IFTRUE (WHEN (SCR_DATA_IN)), 16, SCR_INT, SIR_DATA_OVERRUN, SCR_JUMP, PADDR_A (dispatch), SCR_CHMOV_ABS (1) ^ SCR_DATA_IN, HADDR_1 (scratch),}/*-------------------------< DATA_OVRUN2 >----------------------*/,{ /* * Count this byte. * This will allow to return a negative * residual to user. */ SCR_REG_REG (scratcha, SCR_ADD, 0x01), 0, SCR_REG_REG (scratcha1, SCR_ADDC, 0), 0, SCR_REG_REG (scratcha2, SCR_ADDC, 0), 0, /* * .. and repeat as required. */ SCR_JUMP, PADDR_B (data_ovrun1),}/*-------------------------< ABORT_RESEL >----------------------*/,{ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, /* * send the abort/abortag/reset message * we expect an immediate disconnect */ SCR_REG_REG (scntl2, SCR_AND, 0x7f), 0, SCR_MOVE_ABS (1) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_CLR (SCR_ACK|SCR_ATN), 0, SCR_WAIT_DISC, 0, SCR_INT, SIR_RESEL_ABORTED, SCR_JUMP, PADDR_A (start),}/*-------------------------< RESEND_IDENT >---------------------*/,{ /* * The target stays in MSG OUT phase after having acked * Identify [+ Tag [+ Extended message ]]. Targets shall * behave this way on parity error. * We must send it again all the messages. */ SCR_SET (SCR_ATN), /* Shall be asserted 2 deskew delays before the */ 0, /* 1rst ACK = 90 ns. Hope the chip isn't too fast */ SCR_JUMP, PADDR_A (send_ident),}/*-------------------------< IDENT_BREAK >----------------------*/,{ SCR_CLR (SCR_ATN), 0, SCR_JUMP, PADDR_A (select2),}/*-------------------------< IDENT_BREAK_ATN >------------------*/,{ SCR_SET (SCR_ATN), 0, SCR_JUMP, PADDR_A (select2),}/*-------------------------< SDATA_IN >-------------------------*/,{ SCR_CHMOV_TBL ^ SCR_DATA_IN, offsetof (struct sym_dsb, sense), SCR_CALL, PADDR_A (datai_done), SCR_JUMP, PADDR_B (data_ovrun),}/*-------------------------< RESEL_BAD_LUN >--------------------*/,{ /* * Message is an IDENTIFY, but lun is unknown. * Signal problem to C code for logging the event. * Send a M_ABORT to clear all pending tasks. */ SCR_INT, SIR_RESEL_BAD_LUN, SCR_JUMP, PADDR_B (abort_resel),}/*-------------------------< BAD_I_T_L >------------------------*/,{ /* * We donnot have a task for that I_T_L. * Signal problem to C code for logging the event. * Send a M_ABORT message. */ SCR_INT, SIR_RESEL_BAD_I_T_L, SCR_JUMP, PADDR_B (abort_resel),}/*-------------------------< BAD_I_T_L_Q >----------------------*/,{ /* * We donnot have a task that matches the tag. * Signal problem to C code for logging the event. * Send a M_ABORTTAG message. */ SCR_INT, SIR_RESEL_BAD_I_T_L_Q, SCR_JUMP, PADDR_B (abort_resel),}/*-------------------------< BAD_STATUS >-----------------------*/,{ /* * Anything different from INTERMEDIATE * CONDITION MET should be a bad SCSI status, * given that GOOD status has already been tested. * Call the C code. */ SCR_COPY (4), PADDR_B (startpos), RADDR_1 (scratcha), SCR_INT ^ IFFALSE (DATA (S_COND_MET)), SIR_BAD_SCSI_STATUS, SCR_RETURN, 0,}/*-------------------------< WSR_MA_HELPER >--------------------*/,{ /* * Helper for the C code when WSR bit is set. * Perform the move of the residual byte. */ SCR_CHMOV_TBL ^ SCR_DATA_IN, offsetof (struct sym_ccb, phys.wresid), SCR_JUMP, PADDR_A (dispatch),#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN}/*-------------------------< DATA_IO >--------------------------*/,{ /* * We jump here if the data direction was unknown at the * time we had to queue the command to the scripts processor. * Pointers had been set as follow in this situation: * savep --> DATA_IO * lastp --> start pointer when DATA_IN * wlastp --> start pointer when DATA_OUT * This script sets savep and lastp according to the * direction chosen by the target. */ SCR_JUMP ^ IFTRUE (WHEN (SCR_DATA_OUT)), PADDR_B (data_io_out),}/*-------------------------< DATA_IO_COM >----------------------*/,{ /* * Direction is DATA IN. */ SCR_COPY (4), HADDR_1 (ccb_head.lastp), HADDR_1 (ccb_head.savep), /* * Jump to the SCRIPTS according to actual direction. */ SCR_COPY (4), HADDR_1 (ccb_head.savep), RADDR_1 (temp), SCR_RETURN, 0,}/*-------------------------< DATA_IO_OUT >----------------------*/,{ /* * Direction is DATA OUT. */ SCR_REG_REG (HF_REG, SCR_AND, (~HF_DATA_IN)), 0, SCR_COPY (4), HADDR_1 (ccb_head.wlastp), HADDR_1 (ccb_head.lastp), SCR_JUMP, PADDR_B(data_io_com),#endif /* SYM_OPT_HANDLE_DIR_UNKNOWN */}/*-------------------------< ZERO >-----------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< SCRATCH >--------------------------*/,{ SCR_DATA_ZERO, /* MUST BE BEFORE SCRATCH1 */}/*-------------------------< SCRATCH1 >-------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< PREV_DONE >------------------------*/,{ SCR_DATA_ZERO, /* MUST BE BEFORE DONE_POS ! */}/*-------------------------< DONE_POS >-------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< NEXTJOB >--------------------------*/,{ SCR_DATA_ZERO, /* MUST BE BEFORE STARTPOS ! */}/*-------------------------< STARTPOS >-------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< TARGTBL >--------------------------*/,{ SCR_DATA_ZERO,}/*--------------------------<>----------------------------------*/};static struct SYM_FWZ_SCR SYM_FWZ_SCR = { /*-------------------------< SNOOPTEST >------------------------*/{ /* * Read the variable. */ SCR_COPY (4), HADDR_1 (scratch), RADDR_1 (scratcha), /* * Write the variable. */ SCR_COPY (4), RADDR_1 (temp), HADDR_1 (scratch), /* * Read back the variable. */ SCR_COPY (4), HADDR_1 (scratch), RADDR_1 (temp),}/*-------------------------< SNOOPEND >-------------------------*/,{ /* * And stop. */ SCR_INT, 99,}/*--------------------------<>----------------------------------*/};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -