/**   common_mem_test_defs.h
 **
 **   This is the header file contains common definitions that support the 
 ** memory tests for all processors.
 **
 ** NOTE:  This definitions file can be included by both "C" and assembly
 **        language source code files.
 **
 ** Created by Ted Schmitz, May 11, 2009
 **
 **/

/**  The following symbols define the location of the elements in the
 ** test results array used to pass test results to/from assembly routines.
 **   This array is made up of 64-bit entries that represent the results of an
 ** assembly verification including an error flag, expected ad received data, 
 ** and the address under tests at the time of failure.
 **
 **   The following description depicts the format of that array:
 **  Index   Description
 ** -------- --------------------------------------------------------
 **   00     Results of test (0=passed, non-zero = failed)
 **   01     Address of failure
 **   02     Expected data
 **   03     Bad data read
 **/
#define ASM_TEST_RESULTS       0x00        /* results of test */
#define ASM_TEST_ADRS_AT_FAULT (ASM_TEST_RESULTS+1)/* address that failed */
#define ASM_TEST_EXP_DATA (ASM_TEST_ADRS_AT_FAULT+1)/* data expected at this adrs */
#define ASM_TEST_BAD_DATA (ASM_TEST_EXP_DATA+1) /* bad data read from adrs */
#define ASM_TEST_DATA_LEN (ASM_TEST_BAD_DATA+1) /* length of results array */

#define ASM_TEST_PASSED 0x0000000000000000 /* flag indicating asm test passed */
#define ASM_TEST_FAILED 0x0000000000000001 /* flag indicating asm test failed */
/* end results array definitions */

/* the following synbols define the various 64-bit elements in the TLB array */
#define TLB_INDEX          0              /* index of tlb to read */
#define TLB_MASK_REG (TLB_INDEX+1)        /* page mask reg */
#define TLB_ENTRY_HI_REG (TLB_MASK_REG+1) /* EntryHi reg */
#define TLB_ENTRY_LO_0 (TLB_ENTRY_HI_REG+1)/* EntryLo 0 reg */
#define TLB_ENTRY_LO_1 (TLB_ENTRY_LO_0+1)  /* EntryLo 1 reg */
#define TLB_ARRAY_LEN (TLB_ENTRY_LO_1+1)   /* length of tlb array */
#define MAX_TLBS 64                        /* max of 64 TLBs to be read */

/* the following symbols were copied from "cpu/mips/start.S" module */
#define COP0_INDEX_REG $0,0
#define COP0_PAGEGRAIN_REG $5,1
#define COP0_ENTRYLO0_REG $2,0
#define COP0_ENTRYLO1_REG $3,0
#define COP0_PAGEMASK_REG $5,0
#define COP0_ENTRYHI_REG $10,0
#define COP0_STATUS_REG $12,0
/* end symbols copied from "start.S" module */

