home *** CD-ROM | disk | FTP | other *** search
- /*
- * Register space size.
- */
- #define NREGS 32
-
- /*
- * Main processor general registers.
- */
- #define PGBASE 0
- #define PG(r) (PGBASE + r)
-
- /*
- * Main processor "control" registers.
- */
- #define PCBASE (PGBASE + NREGS)
- #define PC(r) (PCBASE + r)
-
- /*
- * Coprocessor 0 general registers.
- */
- #define CP0GBASE (PCBASE + NREGS)
- #define CP0G(r) (CP0GBASE + r)
-
- /*
- * Coprocessor 0 control registers.
- */
- #define CP0CBASE (CP0GBASE + NREGS)
- #define CP0C(r) (CP0CBASE + r)
-
- /*
- * Coprocessor 1 general registers.
- */
- #define CP1GBASE (CP0CBASE + NREGS)
- #define CP1G(r) (CP1GBASE + r)
-
- /*
- * Coprocessor 1 control registers.
- */
- #define CP1CBASE (CP1GBASE + NREGS)
- #define CP1C(r) (CP1CBASE + r)
- #define CP1CS (CP1C(31)) /* Control/Status Register */
- #define Condition_Shift 23
- #define Set_Cond(r,v) r = ((v) ? (r | (1 << Condition_Shift)) : (r & ~(1 << Condition_Shift)))
- #define Test_Cond(r) (((r) >> Condition_Shift) & 0x1)
-
- /*
- * Coprocessor 2 general registers.
- */
- #define CP2GBASE (CP1CBASE + NREGS)
- #define CP2G(r) (CP2GBASE + r)
-
- /*
- * Coprocessor 2 control registers.
- */
- #define CP2CBASE (CP2GBASE + NREGS)
- #define CP2C(r) (CP2CBASE + r)
-
- /*
- * Coprocessor 3 general registers.
- */
- #define CP3GBASE (CP2CBASE + NREGS)
- #define CP3G(r) (CP3GBASE + r)
-
- /*
- * Coprocessor 3 control registers.
- */
- #define CP3CBASE (CP3GBASE + NREGS)
- #define CP3C(r) (CP3CBASE + r)
-
- /*
- * Must be greater than
- * the largest of the above..
- */
- #define R_MAX (CP3CBASE + NREGS)
-
- /*
- * Some aliases.
- */
- #define R_0 PG(0)
- #define R_AT PG(1)
- #define R_V0 PG(2)
- #define R_V1 PG(3)
- #define R_A0 PG(4)
- #define R_A1 PG(5)
- #define R_A2 PG(6)
- #define R_A3 PG(7)
- #define R_T0 PG(8)
- #define R_T1 PG(9)
- #define R_T2 PG(10)
- #define R_T3 PG(11)
- #define R_T4 PG(12)
- #define R_T5 PG(13)
- #define R_T6 PG(14)
- #define R_T7 PG(15)
- #define R_S0 PG(16)
- #define R_S1 PG(17)
- #define R_S2 PG(18)
- #define R_S3 PG(19)
- #define R_S4 PG(20)
- #define R_S5 PG(21)
- #define R_S6 PG(22)
- #define R_S7 PG(23)
- #define R_T8 PG(24)
- #define R_T9 PG(25)
- #define R_K0 PG(26)
- #define R_K1 PG(27)
- #define R_GP PG(28)
- #define R_SP PG(29)
- #define R_S8 PG(30)
- #define R_RA PG(31)
-
- #define R_HI PC(0)
- #define R_LO PC(1)
-