The register information is entered into a table that is located in the appropriate file in the bsps directory. For example, if your processor uses the 4001 core, you should add the registers to the array reglist located in the file bsps/d4001.c. A fragment of this table is shown below..
{mXc0,Caus,"C0_CAUSE","CAUSE",13,(F_MIPS|F_CP0)},
{mXmem,0,"M_TIC0","TIC0",O_TIC0,0},
{mXmem,Tmr4001Stat,"M_TSTAT","TSTAT",M_TMR4001+O_TSTAT,0},
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. |