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

/* 
	This is test  Unique address Test
*/
#include "definitions"

extern	long	maxmem,endprog;
extern struct OPTIONS OPTIONS;

stest2()
{	register long *mcr = (long *)0xffffb000;

if(OPTIONS.header)
	writes("\n** Subtest2 : Unique address.");
	writes("\nECC off");
	*mcr = 0;
	subtest2();
	writes("\nECC on");
	*mcr = 3;
	subtest2();
	*mcr = 0;
}

subtest2()
{

  register long *curadd, pattern;


	 for( curadd = (long *)endprog; curadd <= (long *)maxmem ; curadd++)
		{
		  pattern = (long)curadd;
		  *curadd = pattern;
		}
	 for( curadd = (long *)endprog; curadd <= (long *)maxmem ; curadd++)
		{
error1:		  pattern = (long)curadd;
		  if(*curadd != pattern)
			if(error(curadd,pattern)) goto error1;
		}

	/* Compl of address */
	 for( curadd = (long *)endprog; curadd <= (long *)maxmem ; curadd++)
		{
		  pattern = (long)curadd;
		  *curadd = ~pattern;
		}
	 for( curadd = (long *)endprog; curadd <= (long *)maxmem ; curadd++)
	   	{
error2:		  pattern = (long)curadd; 
		  if(*curadd != (~pattern) ) 
			if(error(curadd,~pattern)) goto error2;
	   	}
}

unix.superglobalmegacorp.com

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