/* ** sysspec.c ** System-specific routines. ** ** BYTEmark (tm) ** BYTE's Native Mode Benchmarks ** Rick Grehan, BYTE Magazine ** ** Creation: ** Revision: 3/95;10/95 ** ** DISCLAIMER ** The source, executable, and documentation files that comprise ** the BYTEmark benchmarks are made available on an "as is" basis. ** This means that we at BYTE Magazine have made every reasonable ** effort to verify that the there are no errors in the source and ** executable code. We cannot, however, guarantee that the programs ** are error-free. Consequently, McGraw-HIll and BYTE Magazine make ** no claims in regard to the fitness of the source code, executable ** code, and documentation of the BYTEmark. ** Furthermore, BYTE Magazine, McGraw-Hill, and all employees ** of McGraw-Hill cannot be held responsible for any damages resulting ** from the use of this code or the results obtained from using ** this code. */ /*********************************** ** SYSTEM-SPECIFIC ROUTINES ** ************************************ ** ** These are the routines that provide functions that are ** system-specific. If the benchmarks are to be ported ** to new hardware/new O.S., this is the first place to ** start. */ #include "sysspec.h" /*********************************** ** MEMORY ARRAY HANDLING ROUTINES ** ***********************************/ /**************************** ** InitMemArray ** Initialize the memory array. This simply amounts to ** setting mem_array_ents to zero, indicating that there ** isn't anything in the memory array. */ void InitMemArray(void) { mem_array_ents=0; return; } /*************************** ** AddMemArray ** Add a pair of items to the memory array. ** true_addr is the true address (mem_array[0][n]) ** adj_addr is the adjusted address (mem_array[0][n]) ** Returns 0 if ok ** -1 if not enough room */ int AddMemArray(ulong true_addr, ulong adj_addr) { if(mem_array_ents>=MEM_ARRAY_SIZE) return(-1); mem_array[0][mem_array_ents]=true_addr; mem_array[1][mem_array_ents]=adj_addr; mem_array_ents++; return(0); } /************************* ** RemoveMemArray ** Given an adjusted address value (mem_array[1][n]), locate ** the entry and remove it from the mem_array. ** Also returns the associated true address. ** Returns 0 if ok ** -1 if not found. */ int RemoveMemArray(ulong adj_addr,ulong *true_addr) { int i,j; /* Locate the item in the array. */ for(i=0;i