On Mon, 2019-02-11 at 07:26 +0100, Christophe Leroy wrote:
>
> Le 11/02/2019 à 01:21, Benjamin Herrenschmidt a écrit :
> > On Fri, 2019-02-08 at 12:52 +, Christophe Leroy wrote:
> > > /*
> > > + * MSR_KERNEL is > 0x8000 on 4xx/Book-E since it include MSR_CE.
> > > + */
> > > +.macro
Le 11/02/2019 à 01:21, Benjamin Herrenschmidt a écrit :
On Fri, 2019-02-08 at 12:52 +, Christophe Leroy wrote:
/*
+ * MSR_KERNEL is > 0x8000 on 4xx/Book-E since it include MSR_CE.
+ */
+.macro __LOAD_MSR_KERNEL r, x
+.if \x >= 0x8000
+ lis \r, (\x)@h
+ ori \r, \r, (\x)@l
On Fri, 2019-02-08 at 12:52 +, Christophe Leroy wrote:
> /*
> + * MSR_KERNEL is > 0x8000 on 4xx/Book-E since it include MSR_CE.
> + */
> +.macro __LOAD_MSR_KERNEL r, x
> +.if \x >= 0x8000
> + lis \r, (\x)@h
> + ori \r, \r, (\x)@l
> +.else
> + li \r, (\x)
> +.endif
> +.endm
>
As preparation for using head_32.h for head_40x.S, move
LOAD_MSR_KERNEL() there and use it to load r10 with MSR_KERNEL value.
In the mean time, this patch modifies it so that it takes into account
the size of the passed value to determine if 'li' can be used or if
'lis/ori' is needed instead of