void pciread(int dmod, int offset, int count) { epicsUInt32 tval; volatile char* dptr; short dbytes; int i; if(!diagbase) { printf("Run pcidiagset first\n"); return; } if(check_args(dmod, offset, count)) return; dbytes=dmod/8; count/=dbytes; if(count==0) count=1; for(i=0, dptr=diagbase+offset; i<count; i++, dptr+=dbytes) { if ((i*dbytes)%16==0) printf("\n0x%08x ",i*dbytes); else if ((i*dbytes)%4==0) printf(" "); switch(dmod){ case 8: tval=ioread8(dptr); printf("%02x",tval);break; case 16: tval=nat_ioread16(dptr);printf("%04x",tval);break; case 32: tval=nat_ioread32(dptr);printf("%08x",tval);break; } } printf("\n"); }
static void printregisters(volatile epicsUInt8 *evg) { size_t reg; epicsPrintf("\n--- Register Dump @%p ---\n", evg); for(reg=0; reg<NELEMENTS(printreg); reg++){ switch(printreg[reg].rsize){ case 8: epicsPrintf("%16s: %02x\n", printreg[reg].label, ioread8(evg+printreg[reg].offset)); break; case 16: epicsPrintf("%16s: %04x\n", printreg[reg].label, nat_ioread16(evg+printreg[reg].offset)); break; case 32: epicsPrintf("%16s: %08x\n", printreg[reg].label, nat_ioread32(evg+printreg[reg].offset)); break; } } }