The register information is entered into a table that is located in the appropriate file in the lib directory. For example, if your processor uses the 4001 core, you should add the registers to the array c4001_reglist located in the file lib/c4001.c. A fragment of this table is shown below..
{mXc0,mips_cause_def,"C0_CAUSE","CAUSE",13,(F_CP0|F_MIPS)},
{mXmem,0,"M_TIC0","TIC0",M_TMR4001+O_TIC0},
{mXmem,Tmr4003Stat,"M_TSTAT","TSTAT",M_TMR4001+O_TSTAT},
Reading from left to right, the field definitions are as follows...
unsigned long mXmem(int mode, int reg, unsigned long value)where:
The first example shows the definition for a register that is accessed via coprocessor 0. The remaining examples are for memory-mapped registers.
char *excodes[] = {
"Int","MOD","TLBL","TLBS","AdEL","AdES","IBE","DBE",
"Sys","Bp","RI","CpU","Ovf","Resv","Resv","Resv",0};
RegSpec mips_cause_def[] = {
{1,31,"BD",2,0,1},
{2,28,"CE",10,0,1},
{6,10,"IP",2,0,1},
{2,8,"SW",2,0,0},
{4,2,"EXCODE",0,excodes,1},
{0}};
Where:
In the first example, the CAUSE and TSTAT registers use this feature to specify the bit fields in the register.
| F_RO | The register is read-only. |
| R_WO | The register is write-only. |