void
snia_ioerror_dump(char *name, int error_code, int error_mode, ioerror_t *ioerror)
{
#ifdef	LATER
	/* This needs to be tested */

	static char *error_mode_string[] =
		{ "probe", "kernel", "user", "reenable" };

	printk("%s%s%s%s%s error in %s mode\n",
               name,
               (error_code & IOECODE_PIO) ? " PIO" : "",
               (error_code & IOECODE_DMA) ? " DMA" : "",
               (error_code & IOECODE_READ) ? " Read" : "",
               (error_code & IOECODE_WRITE) ? " Write" : "",
               error_mode_string[error_mode]);

#define PRFIELD(f)                                  \
        if (IOERROR_FIELDVALID(ioerror,f)) {        \
		int tmp;                            \
		IOERROR_GETVALUE(tmp, ioerror, f);  \
                printk("\t%20s: 0x%x\n", #f, tmp);  \
	}

        PRFIELD(errortype);             /* error type: extra info about error */
        PRFIELD(widgetnum);             /* Widget number that's in error */
        PRFIELD(widgetdev);             /* Device within widget in error */
        PRFIELD(srccpu);                /* CPU on srcnode generating error */
        PRFIELD(srcnode);               /* Node which caused the error   */
        PRFIELD(errnode);               /* Node where error was noticed  */
        PRFIELD(sysioaddr);             /* Sys specific IO address       */
        PRFIELD(xtalkaddr);             /* Xtalk (48bit) addr of Error   */
        PRFIELD(busspace);              /* Bus specific address space    */
        PRFIELD(busaddr);               /* Bus specific address          */
        PRFIELD(vaddr);                 /* Virtual address of error      */
        PRFIELD(memaddr);               /* Physical memory address       */
        PRFIELD(epc);                   /* pc when error reported        */
        PRFIELD(ef);                    /* eframe when error reported    */

#undef  PRFIELD

        {
                /* Print a more descriptive CPU string */
                cpuid_t srccpu;
		IOERROR_GETVALUE(srccpu, ioerror, srccpu);
		// smp_processor_id()
                printk("(NOTE: CPU %d)\n", srccpu);
                printk("\n");
        }
#endif	/* LATER */
}
Exemple #2
0
static void printstate(Mips * emu,uint64_t n) {
    int i;
    fprintf(stderr,"State: %lu\n",n);
    for(i = 0; i < 32; i++){
        fprintf(stderr,"%s%d: %08x\n","gr",i,emu->regs[i]);
    }
    
    #define PRFIELD(X) fprintf(stderr, #X ": %08x\n",emu->X); 
    PRFIELD(hi);
    PRFIELD(lo);
    PRFIELD(pc);
    PRFIELD(delaypc);
    PRFIELD(CP0_Index);
    PRFIELD(CP0_EntryHi);
    PRFIELD(CP0_EntryLo0);
    PRFIELD(CP0_EntryLo1);
    PRFIELD(CP0_Context);
    PRFIELD(CP0_Wired);
    PRFIELD(CP0_Status);
    PRFIELD(CP0_Epc);
    PRFIELD(CP0_BadVAddr);
    PRFIELD(CP0_ErrorEpc);
    PRFIELD(CP0_Cause);
    PRFIELD(CP0_PageMask);
    PRFIELD(CP0_Count);
    PRFIELD(CP0_Compare);
    #undef PRFIELD
    
}