|  | @@ -301,3 +301,143 @@
 | 
	
		
			
				|  |  |  #  define KSU_KERNEL		0x00000000
 | 
	
		
			
				|  |  |  #define ST0_UX			0x00000020
 | 
	
		
			
				|  |  |  #define ST0_SX			0x00000040
 | 
	
		
			
				|  |  | +#define ST0_KX 			0x00000080
 | 
	
		
			
				|  |  | +#define ST0_DE			0x00010000
 | 
	
		
			
				|  |  | +#define ST0_CE			0x00020000
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Setting c0_status.co enables Hit_Writeback and Hit_Writeback_Invalidate
 | 
	
		
			
				|  |  | + * cacheops in userspace.  This bit exists only on RM7000 and RM9000
 | 
	
		
			
				|  |  | + * processors.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define ST0_CO			0x08000000
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Bitfields in the R[23]000 cp0 status register.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define ST0_IEC                 0x00000001
 | 
	
		
			
				|  |  | +#define ST0_KUC			0x00000002
 | 
	
		
			
				|  |  | +#define ST0_IEP			0x00000004
 | 
	
		
			
				|  |  | +#define ST0_KUP			0x00000008
 | 
	
		
			
				|  |  | +#define ST0_IEO			0x00000010
 | 
	
		
			
				|  |  | +#define ST0_KUO			0x00000020
 | 
	
		
			
				|  |  | +/* bits 6 & 7 are reserved on R[23]000 */
 | 
	
		
			
				|  |  | +#define ST0_ISC			0x00010000
 | 
	
		
			
				|  |  | +#define ST0_SWC			0x00020000
 | 
	
		
			
				|  |  | +#define ST0_CM			0x00080000
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Bits specific to the R4640/R4650
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define ST0_UM			(_ULCAST_(1) <<  4)
 | 
	
		
			
				|  |  | +#define ST0_IL			(_ULCAST_(1) << 23)
 | 
	
		
			
				|  |  | +#define ST0_DL			(_ULCAST_(1) << 24)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Enable the MIPS MDMX and DSP ASEs
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define ST0_MX			0x01000000
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Bitfields in the TX39 family CP0 Configuration Register 3
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_SHIFT	19
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_MASK	0x00380000
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_1KB 	0x00000000
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_2KB 	0x00080000
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_4KB 	0x00100000
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_8KB 	0x00180000
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICS_16KB 	0x00200000
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_SHIFT	16
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_MASK	0x00070000
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_1KB 	0x00000000
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_2KB 	0x00010000
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_4KB 	0x00020000
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_8KB 	0x00030000
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCS_16KB 	0x00040000
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TX39_CONF_CWFON 	0x00004000
 | 
	
		
			
				|  |  | +#define TX39_CONF_WBON  	0x00002000
 | 
	
		
			
				|  |  | +#define TX39_CONF_RF_SHIFT	10
 | 
	
		
			
				|  |  | +#define TX39_CONF_RF_MASK	0x00000c00
 | 
	
		
			
				|  |  | +#define TX39_CONF_DOZE		0x00000200
 | 
	
		
			
				|  |  | +#define TX39_CONF_HALT		0x00000100
 | 
	
		
			
				|  |  | +#define TX39_CONF_LOCK		0x00000080
 | 
	
		
			
				|  |  | +#define TX39_CONF_ICE		0x00000020
 | 
	
		
			
				|  |  | +#define TX39_CONF_DCE		0x00000010
 | 
	
		
			
				|  |  | +#define TX39_CONF_IRSIZE_SHIFT	2
 | 
	
		
			
				|  |  | +#define TX39_CONF_IRSIZE_MASK	0x0000000c
 | 
	
		
			
				|  |  | +#define TX39_CONF_DRSIZE_SHIFT	0
 | 
	
		
			
				|  |  | +#define TX39_CONF_DRSIZE_MASK	0x00000003
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Status register bits available in all MIPS CPUs.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define ST0_IM			0x0000ff00
 | 
	
		
			
				|  |  | +#define  STATUSB_IP0		8
 | 
	
		
			
				|  |  | +#define  STATUSF_IP0		(_ULCAST_(1) <<  8)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP1		9
 | 
	
		
			
				|  |  | +#define  STATUSF_IP1		(_ULCAST_(1) <<  9)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP2		10
 | 
	
		
			
				|  |  | +#define  STATUSF_IP2		(_ULCAST_(1) << 10)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP3		11
 | 
	
		
			
				|  |  | +#define  STATUSF_IP3		(_ULCAST_(1) << 11)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP4		12
 | 
	
		
			
				|  |  | +#define  STATUSF_IP4		(_ULCAST_(1) << 12)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP5		13
 | 
	
		
			
				|  |  | +#define  STATUSF_IP5		(_ULCAST_(1) << 13)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP6		14
 | 
	
		
			
				|  |  | +#define  STATUSF_IP6		(_ULCAST_(1) << 14)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP7		15
 | 
	
		
			
				|  |  | +#define  STATUSF_IP7		(_ULCAST_(1) << 15)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP8		0
 | 
	
		
			
				|  |  | +#define  STATUSF_IP8		(_ULCAST_(1) <<  0)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP9		1
 | 
	
		
			
				|  |  | +#define  STATUSF_IP9		(_ULCAST_(1) <<  1)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP10		2
 | 
	
		
			
				|  |  | +#define  STATUSF_IP10		(_ULCAST_(1) <<  2)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP11		3
 | 
	
		
			
				|  |  | +#define  STATUSF_IP11		(_ULCAST_(1) <<  3)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP12		4
 | 
	
		
			
				|  |  | +#define  STATUSF_IP12		(_ULCAST_(1) <<  4)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP13		5
 | 
	
		
			
				|  |  | +#define  STATUSF_IP13		(_ULCAST_(1) <<  5)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP14		6
 | 
	
		
			
				|  |  | +#define  STATUSF_IP14		(_ULCAST_(1) <<  6)
 | 
	
		
			
				|  |  | +#define  STATUSB_IP15		7
 | 
	
		
			
				|  |  | +#define  STATUSF_IP15		(_ULCAST_(1) <<  7)
 | 
	
		
			
				|  |  | +#define ST0_CH			0x00040000
 | 
	
		
			
				|  |  | +#define ST0_NMI			0x00080000
 | 
	
		
			
				|  |  | +#define ST0_SR			0x00100000
 | 
	
		
			
				|  |  | +#define ST0_TS			0x00200000
 | 
	
		
			
				|  |  | +#define ST0_BEV			0x00400000
 | 
	
		
			
				|  |  | +#define ST0_RE			0x02000000
 | 
	
		
			
				|  |  | +#define ST0_FR			0x04000000
 | 
	
		
			
				|  |  | +#define ST0_CU			0xf0000000
 | 
	
		
			
				|  |  | +#define ST0_CU0			0x10000000
 | 
	
		
			
				|  |  | +#define ST0_CU1			0x20000000
 | 
	
		
			
				|  |  | +#define ST0_CU2			0x40000000
 | 
	
		
			
				|  |  | +#define ST0_CU3			0x80000000
 | 
	
		
			
				|  |  | +#define ST0_XX			0x80000000	/* MIPS IV naming */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Bitfields and bit numbers in the coprocessor 0 IntCtl register. (MIPSR2)
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define INTCTLB_IPPCI		26
 | 
	
		
			
				|  |  | +#define INTCTLF_IPPCI		(_ULCAST_(7) << INTCTLB_IPPCI)
 | 
	
		
			
				|  |  | +#define INTCTLB_IPTI		29
 | 
	
		
			
				|  |  | +#define INTCTLF_IPTI		(_ULCAST_(7) << INTCTLB_IPTI)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Bitfields and bit numbers in the coprocessor 0 cause register.
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#define  CAUSEB_EXCCODE		2
 | 
	
		
			
				|  |  | +#define  CAUSEF_EXCCODE		(_ULCAST_(31)  <<  2)
 | 
	
		
			
				|  |  | +#define  CAUSEB_IP		8
 | 
	
		
			
				|  |  | +#define  CAUSEF_IP		(_ULCAST_(255) <<  8)
 | 
	
		
			
				|  |  | +#define  CAUSEB_IP0		8
 |