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

📄 msi_error.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
	Elmsiregs( celp )->msi_dssr = *pccb->Msidssr;	Elmsiregs( celp )->msi_dstat = *pccb->Msidstat;	Elmsiregs( celp )->msi_dcr = *pccb->Msidcr;	Elmsiregs( celp )->msi_save_dssr = pccb->Save_dssr;	Elmsiregs( celp )->msi_save_dstat = pccb->Save_dstat;    }    EVALID( elp )}/*   Name:	msi_log_initerr	- Log MSI Port Initialization Fatal Errors * *   Abstract:	This routine logs a special type of MSI device attention event: *		software errors detected during probing of local MSI ports. *		These fatal error events are logged as device attentions *		because they pertain to a specific local MSI port.  However, *		they are considered special because they pre-date allocation of *		a PCCB for the local port, and therefore, may not make use of *		it for event logging purposes.  The following special events *		are currently defined: * *		1. FE_INIT_ZEROID  - Uninitialized system identification num *		2. FE_INIT_NOMEM   - Insufficient dynamic memory *		3. FE_INIT_NOPTES  - Insufficient ptes for double mapping * *		All such events represent fatal errors.  None ever have the *		local port crash severity modified( ESM_LPC ) applied. * *		The occurrence of an port initialization fatal event is also *		automatically logged to the console, but without variable *		information. * *		Explicit formatting information must be provided for each *		event.  This requires updating of the following tables each *		time a new MSI fatal error event is defined: * *		1. The MSI fatal error event table( msi_clfe[]) must be updated *		   with the exact text to be displayed and the console logging *		   format code CF_NONE( Console logged MSI fatal error events *		   currently never display variable information ). * *		2. The fatal error event entry within the MSI console logging *		   table( msi_cltab[][] ) must be updated to reflect the new *		   maximum fatal error event code. * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   hpt			- Hardware port type *   msi_cltab			- MSI console logging table *   msinum			- MSI adapter number *   event			- Fatal error event code *   scs_node_name		- SCS node name *   scs_system_id		- SCS system identification number * *   Outputs: * *   IPL_SCS			- Interrupt processor level * *   SMP:	No locks are required. */voidmsi_log_initerr( msinum, hpt, event )    u_long			msinum;    u_long			hpt;    register u_long		event;{    register struct el_rec	*elp;    /* Logging of fatal errors detected during MSI port probings proceeds as     * follows:     *     * 1. The fatal error is validated.     * 2. The fatal error event and a local port permanently offline message     *	  are both printed on the console.     * 3. An event log record is allocated and the record's sub id packet     *	  fields are initialized.     * 4. The portion of record common to all MSI events is initialized.     * 5. The event log record is validated.     *     * This routine panics if validation of the fatal error event( Step 1 )     * fails indicating inability of the MSI port driver to log the reported     * event.     *     * Event logging is bypassed on failures to allocate an event log record(     * Step 3 ).     *     * Note that no other MSI specific information common to device attention     * events is logged and that no variable information is displayed within     * logged console messages.     */    switch( event ) {	case FE_INIT_ZEROID:	case FE_INIT_NOMEM:	case FE_INIT_NOPTES:	    break;	default:	    ( void )panic( PANIC_UNKCODE );    }    ( void )cprintf( "msi%u\t- fatal error( local port ? )\n\t- %s\n",		     msinum, Clog_tabmsg( msi_cltab, event ));    ( void )cprintf( "msi%u\t- permanently offline( local port ? )\n", msinum);    if(( elp = ealloc( sizeof( struct msi_common ), EL_PRIHIGH )) == EL_FULL ){	LSUBID( elp, ELCT_DCNTL, ELMSI_ATTN, hpt, msinum, EL_UNDEF, event )	Elmsicommon( elp )->msi_optfmask1 = 0;	Elmsicommon( elp )->msi_optfmask2 = 0;	Elmsicommon( elp )->msi_evpktver = MSI_EVPKTVER;	U_long( *Elmsicommon( elp )->msi_lpname )			= Ctrl_from_num( "msi  ", msinum );	Move_node( scs_node_name, Elmsicommon( elp )->msi_lname )	Move_scaaddr( scs_system_id, *Elmsicommon( elp )->msi_lsysid )	U_short( Elmsicommon( elp )->msi_lsaddr[ 0 ]) = EL_UNDEF;	U_short( Elmsicommon( elp )->msi_lsaddr[ 2 ]) = EL_UNDEF;	U_short( Elmsicommon( elp )->msi_lsaddr[ 4 ]) = EL_UNDEF;	Elmsicommon( elp )->msi_nerrs = 1;	Elmsicommon( elp )->msi_nreinits = 0;	EVALID( elp )    }}/*   Name:	msi_log_packet	- Log MSI Packet Related Events * *   Abstract:	This routine logs MSI packet related events.  Such events are *		ascertained indirectly from a MSI port packet as opposed to *		those events detected directly from a specific local MSI port. *		The event is also optionally logged to the console. * *		Five classes of events are currently logged by this routine: * *		1. Software detected errors during packet reception. *		2. Software detected invalid remote port states. *		3. Software detected errors during packet transmission.  *		4. Software detected invalid MSI remote port station addresses. *		5. Reception of packets over software non-existent paths. * *		Many of these events represent serious errors and are logged to *		save relevant information before drastic steps are attempted to *		resolve them.  Others are less serious and are logged only to *		give a warning or for informational purposes only. * *		NOTE: While all events logged therein arise indirectly from MSI *		      port packets, the logging of each event does not *		      necessarily involve logging of the packet itself. * *		NOTE: This routine does NOT log events arising external to the *		      MSI port driver with the exception of those CI PPD events *		      which are candidates for application of the local port *		      crash severity modifier( ESM_LPC ). * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   event			- Event code *   event_type			- PATH_EVENT, LPORT_EVENT, RPORT_EVENT *   lscs			- Local system permanent information *   msicmdblkp			- Address of MSI command block( OPTIONAL ) *   msipp			- Address of MSI packet( OPTIONAL ) *   pb				- Path Block pointer( OPTIONAL ) *   pccb			- Port Command and Control Block pointer *	pd.msi			-  MSI specific PCCB fields *	    errlogopt.portnum	-   Remote port station address *				     ( required ONLY when PB not provided ) *   pktsize			- Size of MSI packet( OPTIONAL ) * *   Outputs: * *   IPL_SCS			- Interrupt processor level *   pccb			- Port Command and Control Block pointer *	lpinfo.nerrs		-  Number of errors on port * *   SMP:	The PCCB is locked( EXTERNALLY ) to synchronize access, to *		prevent premature PB deletion when a PB is provided, and as *		required by msi_console_log(), the routine responsible for *		logging events to the console terminal. * *		PBs do NOT require locking when provided because only static *		fields are accessed.  SBs NEVER require locking. */voidmsi_log_packet( pccb, pb, msicmdblkp, msipp, pktsize, event, event_type )    register PCCB		*pccb;    register PB			*pb;    MSICMDBLK  			*msicmdblkp;    MSIPACKET			*msipp;    u_long			pktsize;    u_long			event;    u_long			event_type;{    register u_char		*celp;    register struct el_rec	*elp;    register u_long		opt_size;    /* The steps involved in logging MSI packet related events include:     *     * 1. Logging the event to the console.     * 2. Incrementing the counter of local port errors.     * 3. Computing the size of the application portion of the event log     *	  record.     * 4. Allocating an event log record and initializing the record's sub id     *	  packet fields.     * 5. Initializing the portion of the record common to all MSI events.     * 6. Initializing the portion of the record common to all MSI packet     *	  related events.     * 7. Moving any optional logged packet information into the record.       * 8. Validating the event log record.     *     * The ability of this routine to log the event is validated during console     * logging( Step 1 ).  A panic occurs whenever the MSI port driver is not     * prepared to log the reported event.     *     * Not all events increment the counter of errors which have occurred on     * the specified local port( Step 2 ).  Only those events with severity     * level equal to or greater than error( ES_E ) increment the counter.     *     * This routine immediately terminates on failure to allocate an event log     * record( Step 4 ).     *     * The size of the application portion of each event log record( Step 3 )     * is dependent upon the presence or absence of optional information to be     * included within the record( Step 7 ).  The following types of orthogonal     * optional information may be logged:     *     * 1. The MSI port packet responsible for the logged packet related event.     * 2. The MSI command block associated with the responsible port packet.     *     * Sufficient space is reserved within the event record for such optional     * information only for those events which request their logging.  The     * optional MSI port packets are associated with many different events and     * vary widely in size.  Such packets require truncation whenever logging     * their full size would exceed the maximum size of an event log record.     *     * NOTE: An event may request logging of both a MSI port packet and an     *	     associated command block, just a MSI port packet, or neither.  No     *	     event currently ever requests logging of a MSI command block     *	     without also requesting logging of a MSI port packet.     */    ( void )msi_console_log( pccb, pb, msicmdblkp, msipp, event, event_type );    if( Eseverity( event ) >= ES_E ) {	Event_counter( pccb->lpinfo.nerrs )    }    {    register u_long		size = sizeof( struct msi_common ) +				       sizeof( struct msi_lcommon );    if( msicmdblkp ) {	size += sizeof( struct msi_cmdblk );    }    if( msipp ) {	opt_size = pktsize;	if(( size += opt_size ) > EL_MAXAPPSIZE ) {	    opt_size += ( EL_MAXAPPSIZE - size );	    size = EL_MAXAPPSIZE;	}    }    if(( elp = ealloc( size, EL_PRIHIGH )) == EL_FULL ) {	return;    }    LSUBID( elp,	    ELCT_DCNTL,	    ELMSI_LPKT,	    pccb->lpinfo.type.hwtype,	    Ctrl_from_name( pccb->lpinfo.name ),	    EL_UNDEF,	    event )    }    Elmsicommon( elp )->msi_optfmask1 = MSI_LCOMMON;    Elmsicommon( elp )->msi_optfmask2 = 0;    Elmsicommon( elp )->msi_evpktver = MSI_EVPKTVER;    U_long( *Elmsicommon( elp )->msi_lpname ) = pccb->lpinfo.name;    Move_node( lscs.system.node_name, Elmsicommon( elp )->msi_lname )    Move_scaaddr( lscs.system.sysid, *Elmsicommon( elp )->msi_lsysid )    Move_scaaddr( pccb->lpinfo.addr, *Elmsicommon( elp )->msi_lsaddr )    Elmsicommon( elp )->msi_nerrs = pccb->lpinfo.nerrs;    Elmsicommon( elp )->msi_nreinits = pccb->lpinfo.nreinits;    {    register SB		*sb;    if( pb ) {	sb = pb->sb;	Move_scaaddr( pb->pinfo.rport_addr, *Elmsilcommon( elp )->msi_rsaddr )    } else {	sb = NULL;	if(( U_short( Elmsilcommon( elp )->msi_rsaddr[ 0 ])		= pccb->Errlogopt.portnum ) != EL_UNDEF ) {	    U_short( Elmsilcommon( elp )->msi_rsaddr[ 2 ]) = 0;	    U_short( Elmsilcommon( elp )->msi_rsaddr[ 4 ]) = 0;	} else {	    U_short( Elmsilcommon( elp )->msi_rsaddr[ 2 ]) = EL_UNDEF;	    U_short( Elmsilcommon( elp )->msi_rsaddr[ 4 ]) = EL_UNDEF;	}    }    if( sb ) {	Move_scaaddr( sb->sinfo.sysid, *Elmsilcommon( elp )->msi_rsysid )	Move_node( sb->sinfo.node_name, Elmsilcommon( elp )->msi_rname )    } else {	U_short( Elmsilcommon( elp )->msi_rsysid[ 0 ])  = EL_UNDEF;	U_short( Elmsilcommon( elp )->msi_rsysid[ 2 ])  = EL_UNDEF;	U_short( Elmsilcommon( elp )->msi_rsysid[ 4 ])  = EL_UNDEF;	U_long( Elmsilcommon( elp )->msi_rname[ 0 ]) = EL_UNDEF;	U_long( Elmsilcommon( elp )->msi_rname[ 4 ]) = EL_UNDEF;    }    }    celp = ( u_char * )Elmsilcommon( elp ) + sizeof( struct msi_lcommon );    if( msicmdblkp ) {	Elmsicommon( elp )->msi_optfmask1 |= MSI_CMDBLK;	( void )bcopy(( u_char * )msicmdblkp,		      celp,		      sizeof( struct msi_cmdblk ));	celp += sizeof( struct msi_cmdblk );    }    if( msipp ) {	Elmsicommon( elp )->msi_optfmask1 |= MSI_PACKET;	( void )bcopy(( u_char * )msipp, celp, opt_size );    }    EVALID( elp )}

⌨️ 快捷键说明

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