📄 ka6200.c
字号:
* Log the contents of the machine check frame * Note that we don't have to log the contents if we are * to panic. This info is used only if we don't crash. */ mchk_data->time = time_now; mchk_data->code = mcf->mc1_summary; mchk_data->maddr = mcf->mc1_vap; mchk_data->istate1 = mcf->mc1_internal_state1; mchk_data->istate2 = mcf->mc1_internal_state2; mchk_data->pc = mcf->mc1_pc; mchk_data->psl = mcf->mc1_psl; } /* clean out error and retry */ mtpr(MSER, mfpr(MSER)); xcp_node->xcp_csr2 = xcp_node->xcp_csr2; xcp_node->xcp_xbe = xcp_node->xcp_xbe; /* * when we get here, we are not crashing the system. * clear flag to indicate we're done handling the machine check. */ if ( mcode > 10) { mcode = mcode - 0x75; if (mcode >14) mcode = 0; } printf("MACHINE CHECK RECOVERY occured\ntype: %s\n", mccvax[mcode]); mchk_data->mchk_in_progress = 0; return(0); }/* initialization code that the slave processor must run before starting up */ka6200initslave() { struct xcp_reg *xcp_node; register struct xmidata *xmidata ; xmidata = get_xmi(0); xcp_node =(struct xcp_reg *)xmidata->xmivirt+(v6200csr->csr1 & 0xf); xcp_node->xcp_csr2 = xcp_node->xcp_csr2; xcp_node->xcp_xbe = xcp_node->xcp_xbe; ka6200_enable_cache() ;}ka6200conf(){ char *nxv; int nxp; extern struct xmi_reg xmi_start[]; register int i; register int xcp_node; register struct xmidata *xmidata; struct xcp_reg *xcp; char *start; struct pte *pte; struct xcp_reg *nxvirt; int cpu_subtype; union cpusid cpusid; cpusid.cpusid = mfpr(SID); /* allocate up 1 xmi structure */ KM_ALLOC(xmidata,struct xmidata *,sizeof(struct xmidata ),KM_DEVBUF,KM_NOW_CL_CO_CA); head_xmidata = xmidata; xmidata->next = 0; xmidata->xminum = 0; /* fill in table of IP interrupt addresses. Addresses are of the form: 2101nnnn where nnnn is the decoded XMI node number */ start = (char *) &ka6200_ip_addr; for (i=0 ; i< MAX_XMI_NODE ; i++ ) { nxp = 0x21010000 + (1<<i); if (i < 9) nxv = start + (1<<i); else { nxv = start + ((i-8)*NBPG); } ka6200_ip[i]=nxv; nxaccess(nxp,&Sysmap[btop((int)(nxv) & ~VA_SYS)],512); } nxaccess (CVQSSCADDR, CVQSSCmap, CVQSSCSIZE); xcp_node =v6200csr->csr1 & 0xf; xmidata->xmiintr_dst = 1<<xcp_node; ka6200_enable_cache() ; xmidata->xmiphys = (struct xmi_reg *) XMI_START_PHYS; xmidata->xmivec_page = &scb.scb_stray; cpu_avail = cca_setup() + 1; spl0(); /* Ready for interrupts */ /* Allocate memory to store machine check information */ KM_ALLOC((CURRENT_CPUDATA->cpu_machdep), char *, sizeof(struct xcp_machdep_data), KM_MBUF,KM_CLEAR | KM_CONTIG); /* test for type of XCP */ if ((cpu_systype & 0xff00) == 0x200) printf("VAX63%d0",cpu_avail); else printf("VAX62%d0",cpu_avail); /* test for time share verses server */ if ((cpu_systype & 0xff) == 1) printf(" time-share\n"); else printf(" compute-server\n"); /* * Map the node space of the XCP so that the processor * can get to its node space CSRs. */ xmidata = get_xmi(0); xmidata->xmivirt = xmi_start; nxp = ka6200nexaddr(0,xcp_node); nxvirt = (struct xcp_reg *)xmidata->xmivirt + xcp_node; nxaccess(nxp,&Sysmap[btop((int)(nxvirt) & ~VA_SYS)],1024); spl0(); /* Ready for interrupts */ xmiconf(0); /* Config all XMI, BI, ..etc devices*/ /* clear warm and cold boot flags */ ccabase.cca_hflag &= ~(CCA_V_BOOTIP|CCA_V_WARMIP); return(0);}ka6200_enable_cache() { int save_led_val; /* enable the cache */ mtpr(CADR, 0xec); /* first level */ save_led_val = v6200csr->csr1 & 0x1ffff; /* save led values */ /* now enable cache by method specified in XCP spec */ v6200csr->csr1 = 0x00040000|save_led_val; /* force miss */ v6200csr->csr1 = 0x00140000|save_led_val; /* invalidate */ v6200csr->csr1 = 0|save_led_val; /* enable cache */}ka6200mapcsr() { nxaccess(CSRV6200,V6200csr,512);}/* * ka6200memerr --- Hard errors are reported through SCB vector * 0x60, at IPL 0x1d. These errors include the following: * This routine runs on the interrupt stack. * * XBE:WDNAK -- write data noAck. * XBE:TE -- Transmit Error. * XBE:CNAK -- Command NoAck. * CSR1:WDPE -- DAL write Parity Error. * XBE:WEI -- XMI write Error IVINTR's. * XBE:XFAULT -- XMI fault assertion. * All forms of Ident errors (which bits?). */ka6200memerr(){ int cpunum; struct xcp_reg *xcp_node; int save_led_val; int xminode; struct xmi_reg *nxv; /* virtual pointer to XMI node */ register struct xmidata *xmidata; struct el_xcp60 *ptr; struct el_rec *elrp; xmidata = get_xmi(0); xcp_node =(struct xcp_reg *)xmidata->xmivirt+(v6200csr->csr1 & 0xf); elrp = ealloc(sizeof(struct el_xcp60),EL_PRILOW); if (elrp != NULL) { LSUBID(elrp,ELCT_6200_INT60,EL_UNDEF,EL_UNDEF,EL_UNDEF,EL_UNDEF,EL_UNDEF); /* load vector 60 registers */ ptr = &elrp->el_body.el_xcp60; ptr->xcp_csr1 = v6200csr->csr1; ptr->xcp_cadr = mfpr(CADR); ptr->xcp_mser = mfpr(MSER); ptr->xcp_dtype = xcp_node->xcp_dtype; ptr->xcp_xbe = xcp_node->xcp_xbe; ptr->xcp_fadr = xcp_node->xcp_fadr; ptr->xcp_gpr = xcp_node->xcp_gpr; ptr->xcp_csr2 = xcp_node->xcp_csr2; EVALID(elrp); } if ( (xcp_node->xcp_xbe & (XMI_RER|XMI_NRR)) && ((xcp_node->xcp_xbe & 0xf)==9)) { ka6200_clear_xbe(); return(0); } /* we are crashing so print out error */ cprintf("Fatal error detected by XCP at node %x\n",v6200csr->csr1&0xf); cprintf("cadr = %x\n",mfpr(CADR)); cprintf("mser = %x\n",mfpr(MSER)); cprintf("xcp_dtype = %x\n",xcp_node->xcp_dtype); cprintf("xcp_xbe = %x\n",xcp_node->xcp_xbe); cprintf("xcp_fadr = %x\n",xcp_node->xcp_fadr); cprintf("xcp_csr2 = %x\n",xcp_node->xcp_csr2); /* print out any pending XMA errors */ xma_check_errors(xcp_node,EL_PRIHIGH); /* kill system */ panic("memory error"); return(0);}log_ka6200memerrs()/* * function: to log xma errors from outside exception handlers, * for example, log_bierrors, to get a more complete * picture of the machine at error time. */{ struct xcp_reg *xcp_node; struct xmi_reg *nxv; /* virtual pointer to XMI node */ register struct xmidata *xmidata; xmidata = get_xmi(0); xcp_node =(struct xcp_reg *)xmidata->xmivirt+(v6200csr->csr1 & 0xf); /* log any pending XMA errors */ xma_check_errors(xcp_node,EL_PRILOW); return(0);}xma_check_errors(xcp,priority)struct xcp_reg *xcp;int priority;{ struct el_xma *xma_pkg; struct xmi_reg *nxv; struct xma_reg *xma; struct xmidata *xmidata; int xminode; struct el_rec *elrp; xmidata = (struct xmidata *)get_xmi(0); nxv = xmidata->xmivirt; for(xminode = 0; xminode < MAX_XMI_NODE; xminode++,nxv++) { if ((xmidata->xminodes_alive & (1<<xminode)) && ((short) (nxv->xmi_dtype) == XMI_XMA)) { /* The node is a memory */ xma = (struct xma_reg *) nxv; if (nxv->xmi_dtype == XMI_XMA) { if ((xma->xma_xbe & XMI_ES) || (xma->xma_mctl1 & (XMA_CTL1_LOCK_ERR| XMA_CTL1_UNLOCK_ERR|XMA_CTL1_RDS_WRITE)) || (xma->xma_mecer & (XMA_ECC_RDS_ERROR))) { log_mem_error(xcp,xma,priority); } } else /* Must be XMA2 */ if (xma->xma_xbe & XMI_ES) log_mem_error(xcp,xma,priority); } }}ka6200_clear_xbe(){ struct xmidata *xmidata; struct xcp_reg *xcp_node; /* get pointer to xcp node that machine checked */ xmidata = get_xmi(0); xcp_node =(struct xcp_reg *)xmidata->xmivirt+(v6200csr->csr1 & 0xf); xcp_node->xcp_xbe = xcp_node->xcp_xbe & ~XMI_XBAD; }/* log XMA memory error. If priority is not LOW then print to console.*/log_mem_error(xcp,xma,priority) int priority; struct xma_reg *xma; struct xcp_reg *xcp;{ struct el_xma *xma_pkg; struct xmidata *xmidata; struct el_rec *elrp; /* If xma2, go to its handler */ if((xma->xma_type & XMA2_MASK) == XMI_XMA2) log_xma2_mem_error(xma,priority); else { /* log the XMA error */ elrp = ealloc(sizeof(struct el_xma),priority); if (elrp) { LSUBID(elrp,ELCT_MEM,EL_UNDEF,ELMCNTR_6200,EL_UNDEF,EL_UNDEF,EL_UNDEF); xma_pkg = &elrp->el_body.el_xma; xma_pkg->xma_node = ((svtophy(xma))>>19)&0xf; xma_pkg->xma_dtype = xma->xma_type; xma_pkg->xma_xbe = xma->xma_xbe; xma_pkg->xma_seadr = xma->xma_seadr; xma_pkg->xma_mctl1 = xma->xma_mctl1; xma_pkg->xma_mecer = xma->xma_mecer; xma_pkg->xma_mecea = xma->xma_mecea; xma_pkg->xma_mctl2 = xma->xma_mctl2; EVALID(elrp); } /* print to console if HIGH priority */ if (priority < EL_PRILOW) { cprintf("Fatal memory error \n"); cprintf("xma_phys = %x\n",svtophy(xma)); cprintf("xma_type = %x\n",xma->xma_type); cprintf("xma_xbe = %x\n",xma->xma_xbe); cprintf("xma_seadr = %x\n",xma->xma_seadr); cprintf("xma_mctl1 = %x\n",xma->xma_mctl1); cprintf("xma_mecer = %x\n",xma->xma_mecer); cprintf("xma_mecea = %x\n",xma->xma_mecea); cprintf("xma_mctl2 = %x\n",xma->xma_mctl2); } } /* END IF-ELSE */}/* * log XMA2 memory error. If priority is not LOW then print to * console. */log_xma2_mem_error(xma2,priority)int priority;register struct xma_reg *xma2;{ register struct el_xma2 *xma_pkg; register struct el_rec *elrp; /* log the XMA2 error */ elrp = ealloc(sizeof(struct el_xma2),priority); if (elrp) { LSUBID(elrp,ELCT_MEM,EL_UNDEF,ELMCNTR_XMA2,EL_UNDEF,EL_UNDEF,EL_UNDEF); xma_pkg = &elrp->el_body.el_xma2; xma_pkg->xma_node = ((svtophy(xma2))>>19)&0xf; xma_pkg->xma_dtype = xma2->xma_type; xma_pkg->xma_xbe = xma2->xma_xbe; xma_pkg->xma_seadr = xma2->xma_seadr; xma_pkg->xma_mctl1 = xma2->xma_mctl1; xma_pkg->xma_mecer = xma2->xma_mecer; xma_pkg->xma_mecea = xma2->xma_mecea; xma_pkg->xma_mctl2 = xma2->xma_mctl2; xma_pkg->xma_becer = xma2->xma_becer; xma_pkg->xma_becea = xma2->xma_becea; xma_pkg->xma_stadr = xma2->xma_stadr; xma_pkg->xma_enadr = xma2->xma_enadr; xma_pkg->xma_intlv = xma2->xma_intlv; xma_pkg->xma_mctl3 = xma2->xma_mctl3; xma_pkg->xma_mctl4 = xma2->xma_mctl4; xma_pkg->xma_bsctl = xma2->xma_bsctl; xma_pkg->xma_bsadr = xma2->xma_bsadr; xma_pkg->xma_eectl = xma2->xma_eectl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -