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

📄 eribld.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 5 页
字号:
#ifndef lintstatic char sccsid[]  =  "@(#)eribld.c	4.12   (ULTRIX)   3/6/91";#endif  lint/**	.TITLE	ERIBLD - Builds the EIMS standard event record*	.IDENT	/1-001/** COPYRIGHT (C) 1986 DIGITAL EQUIPMENT CORP.,* CSSE SOFTWARE ENGINEERING* MARLBOROUGH, MASSACHUSETTS** THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A * SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLUSION* OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE,  OR ANY OTHER* COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE* TO ANY OTHER PERSON EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO* AGREES TO THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE* SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT* NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL* EQUIPMENT CORPORATION.** DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF* ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.**++** FACILITY:		FMA - Event Information Management System** ABSTRACT:**	This module sets up the segment buffers and calls the transformation*	engine to build each segment of the standard record.*	* ENVIRONMENT:	VAX/VMS C,  ULTRIX-32 C** AUTHOR:  Bob Winant,  CREATION DATE:  11-Dec-85** MODIFIED BY:**   5/2/89	Lisa Hartman	Add DEBNI and DEMNA support**   3/13/89	Lisa Hartman	Change msi and add scs support to correspond*				with errlog.h changes.**   2/2/88	Luis Arce	Change mscp pointers to use mscp_msg.h*				add device support**   8/9/88	Luis Arce	Changed to allow for MIPS machines.*				if compiled on mips - only mips stuff*				if compiled on vax  - both mips and vax.**--*/#include <stdio.h>#include <sys/types.h>#include <sys/time.h>#include <sys/errlog.h>#include <machine/cpu.h>#include "eims.h"#include "erms.h"#include "select.h"#include "generic_dsd.h"#include "std_dsd.h"#include "os_dsd.h"#include "eiliterals.h"#include "ueliterals.h"/**++*=*=*=MODULE FLOW - eribld.c*=*=  a - ei$bld(seg_ptrs...,os_rec_ptr)              Processes record items*=          ini_seg(seg_ptr)                                (eixfrm.c)*=          os_std(item_ptr,os_item_id, std_item_id)        (eixfrm.c)*=          mscp_bld(seg_ptrs...,os_rec_ptr)                (* b)*=          scsi_bld(seg_ptrs...,os_rec_ptr)                (* c)*=          make_addr_vector(rec_ptr,data_ptr)              (* f)*=*=  b - mscp_bld(seg_ptrs...,os_rec_ptr)            Processes mscp items*=          ini_seg(seg_ptr)                                (eixfrm.c)*=          os_std(item_ptr,os_item_id, std_item_id)        (eixfrm.c)*=          make_addr_vector(rec_ptr,data_ptr)              (* f)*=*=  c - scsi_bld(seg_ptrs...,os_rec_ptr)            Processes scsi items*=          ini_seg(seg_ptr)                                (eixfrm.c)*=          os_std(item_ptr,os_item_id, std_item_id)        (eixfrm.c)*=          make_addr_vector(rec_ptr,data_ptr)              (* f)*=*=  d - bld_corrupt_eis(eis_ptr)                    Sets eis_values to indicate*=                                                  corrupt record*=*=  e - ads_bld(ads_ptr,os_rec_ptr)                 Processes ads_segment*=          ini_seg(seg_ptr)                                (eixfrm.c)*=          os_std(item_ptr,os_item_id, std_item_id)        (eixfrm.c)*=          make_addr_vector(rec_ptr,data_ptr)              (* f)*=          mscp_ta90(ads_ptr,os_rec_ptr)                   (* g)*=*=  f - make_addr_vector(rec_ptr,data_ptr)          Makes addr vector item*=*=  g - mscp_ta90(ads_ptr,os_rec_ptr)               Processes ta90 items*=          ini_seg(seg_ptr)                                (eixfrm.c)*=          os_std(item_ptr,os_item_id, std_item_id)        (eixfrm.c)*=          make_addr_vector(rec_ptr,data_ptr)              (* f)*=*--*//**************   DEFINITIONS COMMON TO THIS MODULE  **************//******************  DEFINE CI MACROS ********************************/#define	Elcibiregs(p)	   ((struct bi_regs *)p)#define	Elciciregs(p)	   ((struct ci_regs *)p)#define	Elcicommon(p)	   (&p->el_body.elci.cicommon)#define	Elcicpurevlev(p)   ((struct ci_cpurevlev *)p)#define	Elcidattn(p)	   (&p->el_body.elci.citypes.cidattn)#define	Elcilcommon(p)	   (&p->el_body.elci.citypes.cilpkt.cilcommon)#define	Elcipacket(p)	   (&p->el_body.elci.citypes.cilpkt.cilpktopt.cipacket)#define	Elcirevlev(p)	   ((struct ci_revlev *)p)#define	Elciucode(p)	   ((struct ci_ucode *)p)#define	Elcixmiregs(p)	   ((struct cixmi_regs *)p)#define	Elcippdcommon(p)   (&p->el_body.elcippd.cippdcommon)#define	Elcippddbcoll(p)   (&p->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippddbcoll)#define	Elcippdnewpath(p)  (&p->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippdnewpath)#define	Elcippdpcommon(p)  (&p->el_body.elcippd.cippdtypes.cippdpath.cippdpcommon)#define	Elcippdppacket(p)  (&p->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippdppacket)#define	Elcippdprotocol(p) (&p->el_body.elcippd.cippdtypes.cippdsystem.cippdsystemopt.cippdprotocol)#define	Elcippdscommon(p)  (&p->el_body.elcippd.cippdtypes.cippdsystem.cippdscommon)#define	Elcippdspacket(p)  (&p->el_body.elcippd.cippdtypes.cippdsystem.cippdsystemopt.cippdspacket)#define	Elcippdsysapnam(p) (&p->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippd_sysap[0])#define U_MSCP      el_body.elbdev.eldevdata.elmslg.mscp_mslg#define U_SCSI 	    el_body.elbdev.eldevdata.elscsi#define Elscscommon(p)	   (&p->el_body.elscs.scscommon)#define Elscsopt(p)	   (&p->el_body.elscs.scsopt)#define Elmsicommon(p)	   (&p->el_body.elmsi.msicommon)#define Elmsiregs(p)	   (&p->el_body.elmsi.msitypes.msidattn.msiregs)#define Elmsilcommon(p)    (&p->el_body.elmsi.msitypes.msilpkt.msilcommon)#define Elmsicmdblk(p)	   ((struct msi_cmdblk *)p)#define Elmsipacket(p)	   ((struct msi_packet *)p)#ifndef ST_VAXSTAR#define ST_VAXSTAR 4#endif ST_VAXSTAR/****************************  STORAGE AREAS **************************/static  short  unk_rec;static  short  ads_next;static  short  ads_num;static  long   *ads_item_ptr;int scan_ads_num;int spu_crd_cnt;/**	.SBTTL	EI$BLD - Builds the standard record*++* FUNCTIONAL DESCRIPTION:		**	This routine sets up the buffers for building a standard event*	record, gets the definitions for each record from the*	corresponding tables, and passes each segment to the transformation*	engine to build a standard EIMS record*	* CALLING SEQUENCE:		CALL EI$BLD (..See Below..)*					Called from EI$GET with address*					of the elrp event buffer and pointer*					to a structure*					containing segment ptrs* FORMAL PARAMETERS:		**	ERMS CTX		Address of context block for erms*	buf_addr		Address of the elrp event buffer** IMPLICIT INPUTS:		NONE** IMPLICIT OUTPUTS:		NONE** ROUTINE VALUE:		NONE*** SIDE EFFECTS:			**--*//*...	ROUTINE EI$BLD (eis_ptr,dis_ptr,cds_ptr,sds_ptr,ads_ptr,sis_ptr, elrp)	*/int  ei$bld(eis_ptr,dis_ptr,cds_ptr,sds_ptr,ads_ptr,sis_ptr, elrp)EIS  *eis_ptr;DIS  *dis_ptr;CDS  *cds_ptr;SDS  *sds_ptr;ADS  *ads_ptr;SIS  *sis_ptr;struct el_rec *elrp;{u_char  *var_elrp;long    temp_long;long    temp_long1;long    temp_long2;long    tmp_long;long    tmp1_long;long    status;long	sysktype;short   ostype = es$ultrix32;long    *make_addr_vector();eis_ptr->type = ES$EIS;eis_ptr->subtype = 1;	/* Always 1 because there is no subtype */eis_ptr->version = 1;dis_ptr->type = ES$DIS;dis_ptr->subtype = 0;	/* 0 means this segment is not used */dis_ptr->version = 1;cds_ptr->type = ES$CDS;cds_ptr->subtype = 0;	/* 0 means this segment is not used */cds_ptr->version = 1;sds_ptr->type = ES$SDS;sds_ptr->subtype = 0;	/* 0 means this segment is not used */sds_ptr->version = 1;ads_ptr->type = ES$ADS;ads_ptr->subtype = 0;	/* 0 means this segment is not used */ads_ptr->version = 1;sis_ptr->type = ES$SIS;sis_ptr->subtype = 0;	/* 0 means this segment is not used */sis_ptr->version = 1;				/* Initialize segments - build    */				/* item list & setup string area  */status  = EI$SUCC;unk_rec = FALSE;if (ini_seg(eis_ptr) == EI$FAIL)    status = EI$FAIL;/******************* MOVE EIS  ****************************/os_std(&elrp->elsubid.subid_class,		OS$evclass,		DD$eventclass);os_std(&elrp->elsubid.subid_class,		OS$gen_short,		DD$eventtype);os_std(&elrp->elrhdr.rhdr_seqnum,		OS$gen_short,		DD$recordnumber);os_std(&ostype,	OS$gen_short,		DD$ostype);os_std(&elrp->elrhdr.rhdr_time,		OS$gen_long,		DD$datetime);os_std(elrp->elrhdr.rhdr_hname,		OS$rhdr_hname,		DD$hostname);if (elrp->elrhdr.rhdr_systype != 0)  os_std(&elrp->elrhdr.rhdr_systype,		OS$gen_long,		DD$systype);switch (elrp->elrhdr.rhdr_sid >> 24)	/* only cpu ident */  {  case 0x01:  case 0x02:  case 0x03:  case 0x06:  case 0x07:  case 0x11:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid);    sysktype = (elrp->elrhdr.rhdr_sid & 0xff000000);    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;  case 0x04:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid);    sysktype = (elrp->elrhdr.rhdr_sid & 0xffc00000);    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;      case 0x05:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid);    sysktype = (elrp->elrhdr.rhdr_sid & 0xff800000);    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;      case 0x12:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid);    sysktype  = (elrp->elrhdr.rhdr_sid & 0xff000000);    sysktype |= (elrp->elrhdr.rhdr_systype >> 8) & 0x00ff0000;    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;  case 0x08:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid);    sysktype  = (elrp->elrhdr.rhdr_sid & 0xff000000);    sysktype |= (elrp->elrhdr.rhdr_systype >> 8) & 0x00ff0000;    if ((elrp->elrhdr.rhdr_systype == 0)  &&	/* old entries */        (elrp->elsubid.subid_ctldevtyp == ST_VAXSTAR))            sysktype |= 0x00040000;    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;  case 0x0A:  case 0x0B:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid2);    sysktype  = (elrp->elrhdr.rhdr_sid & 0xff000000);    sysktype |= (elrp->elrhdr.rhdr_systype >> 8) & 0x00ff0000;    if (((elrp->elrhdr.rhdr_systype >> 24) == 0x01) ||        ((elrp->elrhdr.rhdr_systype >> 24) == 0x04))            sysktype |= (elrp->elrhdr.rhdr_systype & 0x0000ff00);    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;  case 0x0E:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long,	DD$sysid);    sysktype  = (elrp->elrhdr.rhdr_sid & 0xff000000);		/* SID<23:22>System Type Identifier is not yet defined */    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;  case 0x82:  case 0x83:    os_std(&elrp->elrhdr.rhdr_sid, OS$gen_long, DD$pmax_prid);    sysktype  = (elrp->elrhdr.rhdr_sid & 0xffff0000);    os_std(&sysktype, OS$sysktyp, DD$sysktype);  break;  }if (elrp->elrhdr.rhdr_mpnum > 1)  {  os_std(&elrp->elrhdr.rhdr_mpnum,		OS$gen_long,		DD$cpucnt);  os_std(&elrp->elrhdr.rhdr_mperr,		OS$gen_long,		DD$cpulog);  }dis_ptr->subtype = 1;			/* give dis subtype	*/if (ini_seg(dis_ptr) == EI$FAIL)	/* get dis items	*/    status = EI$FAIL;switch(elrp->elsubid.subid_class)  {/*************** 100 ELCT_MCK  (Machine Check Errors) ***********/  case ELCT_MCK :    os_std(&elrp->elsubid.subid_class,		OS$cpuerr,		DD$devclass);

⌨️ 快捷键说明

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