[PATCH] [3/4] PPC64: PAGE_SIZE constants in copyuser.S and copypage.S

Milton Miller miltonm at bga.com
Wed Aug 10 13:43:25 EST 2005


> -       cmpdi   cr6,r5,4096
> +#if PAGE_SIZE > 0x8000
> +       li      r6,PAGE_SIZE at l
> +       oris    r6,r6,PAGE_SIZE at h
> +       cmpd    cr6,r5,r6
> +#else
> +       cmpdi   cr6,r5,PAGE_SIZE
> +#endif

That is actually broken for 32K as li is signed.  Hence the normal
idiom lis @h / li @l.   Yes, lis is also signed, which matters for
64 bits.   Alternatively use the @ha modifier which takes this into
account and use addis:
		addis	r6,r6,PAGE_SIZE at ha



> -       li      r5,4096
> +       li      r5,PAGE_SIZE at l
> +#if PAGE_SIZE > 0x8000
> +       oris    r5,r5,PAGE_SIZE at h
> +#endif

Change this to:
	addis	r5,r5, at PAGE_SIZE@ha



milton




More information about the Linuxppc64-dev mailing list