File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / mem / error.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:24:19 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v12b, v121, HEAD
Power 6/32 Unix version 1.2b

/* 
	Error processor for the memory test
	options:
	       loop_flg = if TRUE we will loop on error 
			else continue testing
*/
#include  "definitions"

#define	MEMUNIT	(64*1024)

extern long cycle,test_no,errcnt;
extern long loop_flg,hlt_flg,prt_flg;


error(address,expected)
register long *address;
int expected ;
{
	long dummy;

     if(prt_flg) {
	writes("\n      Test    Address   Expected    Actual    Count   Cycle ");
	writec('\n');
	writes("   ");
	pt_hex(test_no,8);writes("  ");
	pt_hex(address,8);writes("   ");
	pt_hex(expected,8);writes("  ");
	pt_hex(*address,8);writes("  ");
	pt_hex(errcnt++,8);writes(" ");
	pt_hex(cycle,8);
	locate(address,expected,*address);	/* Locate Board */
	}
	if (loop_flg) return(TRUE);
		else {
		 dummy = dummy;
		 asm("halt");
		 dummy = dummy;
		 }
}


pt_hex(i,num)
register long i;
register short num;	/* num = number of digits to print; max is 8 */

{
	register nib, ch, hchar;
	register n;

	for( n= (num - 1); n >= 0; n--) {
		nib = (int) (i >> ( n << 2));
		ch = nib & 0x0f;
		if(ch >= 0xA && ch <= 0xF)
			hchar = (ch - 0xA) + 'A';
		else
			hchar =  ch + '0';
		writec(hchar);
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.