[parisc-linux-cvs] enable soft-power switch on 715 (Gecko) machines

Grant Grundler grundler@puffin.external.hp.com
Thu, 29 Nov 2001 23:01:36 -0700


Helge Deller wrote:
> +/* this will go to processor.h or any other place... */
> +/* taken from PCXL ERS pg 82 */
> +#define MFCPU_X(rDiagReg, t_ch, t_th, code) \
> +	(0x14000000 + ((rDiagReg)<<21) + ((t_ch)<<16) + ((code)<<5) + ((t_th)<<
>   0) )

Hmm...while this might work fine...hpux has a much more paraniod
approach. I don't know why.
Look at gsyprf10.external.hp.com:~grundler/access_diag.s.

> +	
> +#define MFCPU_C(dr, gr)		MFCPU_X(dr, gr,  0, 0x30)	/* for 
>   dr0 and dr8 only ! */
> +#define MFCPU_T(dr, gr)		MFCPU_X(dr,  0, gr, 0xa0)	/* all 
>   dr except dr0 and dr8 */
> +	
> +#define __getDIAG(dr) ( { 			\
> +        register unsigned long __res asm("r28");\
> +	__asm__ __volatile__ (			\
> +		".word %0"			\
> +		: 				\
> +		: "i" (MFCPU_T(dr,28))		\
> +		: "memory"			\
> +	);					\
> +	__res;					\
> +} )

Well done. I like this alot better than just embedding .word
into the asm stream.

thanks,
grant