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

📄 sym_fw2.h

📁 h内核
💻 H
📖 第 1 页 / 共 4 页
字号:
	 *  The C code will deal with errors.	 *  Agressive optimization, is'nt it? :)	 */	SCR_MOVE_ABS (2) ^ SCR_MSG_IN,		HADDR_1 (msgin),	/*	 *  Load the pointer to the tagged task 	 *  table for this LUN.	 */	SCR_LOAD_REL (dsa, 4),		offsetof(struct sym_lcb, head.itlq_tbl_sa),	/*	 *  The SIDL still contains the TAG value.	 *  Agressive optimization, isn't it? :):)	 */	SCR_REG_SFBR (sidl, SCR_SHL, 0),		0,#if SYM_CONF_MAX_TASK*4 > 512	SCR_JUMPR ^ IFFALSE (CARRYSET),		8,	SCR_REG_REG (dsa1, SCR_OR, 2),		0,	SCR_REG_REG (sfbr, SCR_SHL, 0),		0,	SCR_JUMPR ^ IFFALSE (CARRYSET),		8,	SCR_REG_REG (dsa1, SCR_OR, 1),		0,#elif SYM_CONF_MAX_TASK*4 > 256	SCR_JUMPR ^ IFFALSE (CARRYSET),		8,	SCR_REG_REG (dsa1, SCR_OR, 1),		0,#endif	/*	 *  Retrieve the DSA of this task.	 *  JUMP indirectly to the restart point of the CCB.	 */	SCR_SFBR_REG (dsa, SCR_AND, 0xfc),		0,	SCR_LOAD_REL (dsa, 4),		0,	SCR_LOAD_REL (temp, 4),		offsetof(struct sym_ccb, phys.head.go.restart),	SCR_RETURN,		0,	/* In normal situations we branch to RESEL_DSA */}/*-------------------------< RESEL_DSA >------------------------*/,{	/*	 *  ACK the IDENTIFY or TAG previously received.	 */	SCR_CLR (SCR_ACK),		0,}/*-------------------------< RESEL_DSA1 >-----------------------*/,{	/*	 *      Initialize the status registers	 */	SCR_LOAD_REL (scr0, 4),		offsetof (struct sym_ccb, phys.head.status),	/*	 *  Jump to dispatcher.	 */	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< RESEL_NO_TAG >---------------------*/,{	/*	 *  Load the DSA with the unique ITL task.	 */	SCR_LOAD_REL (dsa, 4),		offsetof(struct sym_lcb, head.itl_task_sa),	/*	 *  JUMP indirectly to the restart point of the CCB.	 */	SCR_LOAD_REL (temp, 4),		offsetof(struct sym_ccb, phys.head.go.restart),	SCR_RETURN,		0,	/* In normal situations we branch to RESEL_DSA */}/*-------------------------< DATA_IN >--------------------------*/,{/* *  Because the size depends on the *  #define SYM_CONF_MAX_SG parameter, *  it is filled in at runtime. * *  ##===========< i=0; i<SYM_CONF_MAX_SG >========= *  ||	SCR_CHMOV_TBL ^ SCR_DATA_IN, *  ||		offsetof (struct sym_dsb, data[ i]), *  ##========================================== */0}/*-------------------------< DATA_IN2 >-------------------------*/,{	SCR_CALL,		PADDR_A (datai_done),	SCR_JUMP,		PADDR_B (data_ovrun),}/*-------------------------< DATA_OUT >-------------------------*/,{/* *  Because the size depends on the *  #define SYM_CONF_MAX_SG parameter, *  it is filled in at runtime. * *  ##===========< i=0; i<SYM_CONF_MAX_SG >========= *  ||	SCR_CHMOV_TBL ^ SCR_DATA_OUT, *  ||		offsetof (struct sym_dsb, data[ i]), *  ##========================================== */0}/*-------------------------< DATA_OUT2 >------------------------*/,{	SCR_CALL,		PADDR_A (datao_done),	SCR_JUMP,		PADDR_B (data_ovrun),}/*-------------------------< PM0_DATA >-------------------------*/,{	/*	 *  Read our host flags to SFBR, so we will be able 	 *  to check against the data direction we expect.	 */	SCR_FROM_REG (HF_REG),		0,	/*	 *  Check against actual DATA PHASE.	 */	SCR_JUMP ^ IFFALSE (WHEN (SCR_DATA_IN)),		PADDR_A (pm0_data_out),	/*	 *  Actual phase is DATA IN.	 *  Check against expected direction.	 */	SCR_JUMP ^ IFFALSE (MASK (HF_DATA_IN, HF_DATA_IN)),		PADDR_B (data_ovrun),	/*	 *  Keep track we are moving data from the 	 *  PM0 DATA mini-script.	 */	SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0),		0,	/*	 *  Move the data to memory.	 */	SCR_CHMOV_TBL ^ SCR_DATA_IN,		offsetof (struct sym_ccb, phys.pm0.sg),	SCR_JUMP,		PADDR_A (pm0_data_end),}/*-------------------------< PM0_DATA_OUT >---------------------*/,{	/*	 *  Actual phase is DATA OUT.	 *  Check against expected direction.	 */	SCR_JUMP ^ IFTRUE (MASK (HF_DATA_IN, HF_DATA_IN)),		PADDR_B (data_ovrun),	/*	 *  Keep track we are moving data from the 	 *  PM0 DATA mini-script.	 */	SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0),		0,	/*	 *  Move the data from memory.	 */	SCR_CHMOV_TBL ^ SCR_DATA_OUT,		offsetof (struct sym_ccb, phys.pm0.sg),}/*-------------------------< PM0_DATA_END >---------------------*/,{	/*	 *  Clear the flag that told we were moving  	 *  data from the PM0 DATA mini-script.	 */	SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM0)),		0,	/*	 *  Return to the previous DATA script which 	 *  is guaranteed by design (if no bug) to be 	 *  the main DATA script for this transfer.	 */	SCR_LOAD_REL (temp, 4),		offsetof (struct sym_ccb, phys.pm0.ret),	SCR_RETURN,		0,}/*-------------------------< PM1_DATA >-------------------------*/,{	/*	 *  Read our host flags to SFBR, so we will be able 	 *  to check against the data direction we expect.	 */	SCR_FROM_REG (HF_REG),		0,	/*	 *  Check against actual DATA PHASE.	 */	SCR_JUMP ^ IFFALSE (WHEN (SCR_DATA_IN)),		PADDR_A (pm1_data_out),	/*	 *  Actual phase is DATA IN.	 *  Check against expected direction.	 */	SCR_JUMP ^ IFFALSE (MASK (HF_DATA_IN, HF_DATA_IN)),		PADDR_B (data_ovrun),	/*	 *  Keep track we are moving data from the 	 *  PM1 DATA mini-script.	 */	SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1),		0,	/*	 *  Move the data to memory.	 */	SCR_CHMOV_TBL ^ SCR_DATA_IN,		offsetof (struct sym_ccb, phys.pm1.sg),	SCR_JUMP,		PADDR_A (pm1_data_end),}/*-------------------------< PM1_DATA_OUT >---------------------*/,{	/*	 *  Actual phase is DATA OUT.	 *  Check against expected direction.	 */	SCR_JUMP ^ IFTRUE (MASK (HF_DATA_IN, HF_DATA_IN)),		PADDR_B (data_ovrun),	/*	 *  Keep track we are moving data from the 	 *  PM1 DATA mini-script.	 */	SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1),		0,	/*	 *  Move the data from memory.	 */	SCR_CHMOV_TBL ^ SCR_DATA_OUT,		offsetof (struct sym_ccb, phys.pm1.sg),}/*-------------------------< PM1_DATA_END >---------------------*/,{	/*	 *  Clear the flag that told we were moving  	 *  data from the PM1 DATA mini-script.	 */	SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM1)),		0,	/*	 *  Return to the previous DATA script which 	 *  is guaranteed by design (if no bug) to be 	 *  the main DATA script for this transfer.	 */	SCR_LOAD_REL (temp, 4),		offsetof (struct sym_ccb, phys.pm1.ret),	SCR_RETURN,		0,}/*-------------------------<>-----------------------------------*/};static struct SYM_FWB_SCR SYM_FWB_SCR = {/*--------------------------< START64 >--------------------------*/ {	/*	 *  SCRIPT entry point for the 895A, 896 and 1010.	 *  For now, there is no specific stuff for those 	 *  chips at this point, but this may come.	 */	SCR_JUMP,		PADDR_A (init),}/*-------------------------< NO_DATA >--------------------------*/,{	SCR_JUMP,		PADDR_B (data_ovrun),}/*-------------------------< SEL_FOR_ABORT >--------------------*/,{	/*	 *  We are jumped here by the C code, if we have 	 *  some target to reset or some disconnected 	 *  job to abort. Since error recovery is a serious 	 *  busyness, we will really reset the SCSI BUS, if 	 *  case of a SCSI interrupt occurring in this path.	 */#ifdef SYM_CONF_TARGET_ROLE_SUPPORT	/*	 *  Set initiator mode.	 */	SCR_CLR (SCR_TRG),		0,#endif	/*	 *      And try to select this target.	 */	SCR_SEL_TBL_ATN ^ offsetof (struct sym_hcb, abrt_sel),		PADDR_A (reselect),	/*	 *  Wait for the selection to complete or 	 *  the selection to time out.	 */	SCR_JUMPR ^ IFFALSE (WHEN (SCR_MSG_OUT)),		-8,	/*	 *  Call the C code.	 */	SCR_INT,		SIR_TARGET_SELECTED,	/*	 *  The C code should let us continue here. 	 *  Send the 'kiss of death' message.	 *  We expect an immediate disconnect once 	 *  the target has eaten the message.	 */	SCR_REG_REG (scntl2, SCR_AND, 0x7f),		0,	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_LOAD_REL (scratcha, 4),	/* DUMMY READ */		0,	SCR_INT,		SIR_MSG_RECEIVED,}/*-------------------------< MSG_WEIRD_SEEN >-------------------*/,{	SCR_LOAD_REL (scratcha, 4),	/* DUMMY READ */		0,	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_STORE_REL (scratcha, 1),		offsetof (struct sym_dsb, smsg_ext.size),	SCR_CLR (SCR_ACK),		0,	SCR_MOVE_TBL ^ SCR_MSG_IN,		offsetof (struct sym_dsb, smsg_ext),	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)),

⌨️ 快捷键说明

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