Home | History | Annotate | Line # | Download | only in include
spr.h revision 1.45
      1  1.45     matt /*	$NetBSD: spr.h,v 1.45 2010/02/25 23:30:04 matt Exp $	*/
      2  1.21      chs 
      3   1.4     matt #ifndef _POWERPC_SPR_H_
      4   1.4     matt #define	_POWERPC_SPR_H_
      5   1.1   simonb 
      6   1.1   simonb #ifndef _LOCORE
      7   1.4     matt #define	mtspr(reg, val)							\
      8  1.38    perry 	__asm volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
      9  1.27     matt #ifdef __GNUC__
     10   1.4     matt #define	mfspr(reg)							\
     11  1.22     matt 	( { register_t val;						\
     12  1.38    perry 	  __asm volatile("mfspr %0,%1" : "=r"(val) : "K"(reg));	\
     13   1.1   simonb 	  val; } )
     14  1.27     matt #endif
     15   1.1   simonb #endif /* _LOCORE */
     16   1.1   simonb 
     17   1.1   simonb /*
     18   1.1   simonb  * Special Purpose Register declarations.
     19   1.1   simonb  *
     20  1.45     matt  * The first column in the comments indicates which PowerPC architectures the
     21  1.45     matt  * SPR is valid on - E for BookE series, 4 for 4xx series,
     22  1.45     matt  * 6 for 6xx/7xx series and 8 for 8xx and 8xxx (but not 85xx) series.
     23   1.1   simonb  */
     24   1.1   simonb 
     25  1.45     matt #define	SPR_XER			0x001	/* E468 Fixed Point Exception Register */
     26  1.45     matt #define	SPR_LR			0x008	/* E468 Link Register */
     27  1.45     matt #define	SPR_CTR			0x009	/* E468 Count Register */
     28  1.45     matt #define	SPR_DEC			0x016	/* E468 DECrementer register */
     29  1.45     matt #define	SPR_SRR0		0x01a	/* E468 Save/Restore Register 0 */
     30  1.45     matt #define	SPR_SRR1		0x01b	/* E468 Save/Restore Register 1 */
     31  1.45     matt #define	SPR_SPRG0		0x110	/* E468 SPR General 0 */
     32  1.45     matt #define	SPR_SPRG1		0x111	/* E468 SPR General 1 */
     33  1.45     matt #define	SPR_SPRG2		0x112	/* E468 SPR General 2 */
     34  1.45     matt #define	SPR_SPRG3		0x113	/* E468 SPR General 3 */
     35  1.45     matt #define	SPR_SPRG4		0x114	/* E4.. SPR General 4 */
     36  1.45     matt #define	SPR_SPRG5		0x115	/* E4.. SPR General 5 */
     37  1.45     matt #define	SPR_SPRG6		0x116	/* E4.. SPR General 6 */
     38  1.45     matt #define	SPR_SPRG7		0x117	/* E4.. SPR General 7 */
     39  1.45     matt #define	SPR_TBL			0x11c	/* E468 Time Base Lower */
     40  1.45     matt #define	SPR_TBU			0x11d	/* E468 Time Base Upper */
     41  1.45     matt #define	SPR_PVR			0x11f	/* E468 Processor Version Register */
     42   1.1   simonb 
     43   1.1   simonb /* Time Base Register declarations */
     44  1.45     matt #define	TBR_TBL			0x10c	/* E468 Time Base Lower */
     45  1.45     matt #define	TBR_TBU			0x10d	/* E468 Time Base Upper */
     46  1.40  sanjayl 
     47   1.4     matt #endif /* !_POWERPC_SPR_H_ */
     48