[PATCH] PPC: use CURRENT_THREAD_INFO instead of open coded assembly
Alexander Graf
agraf at suse.de
Tue Jul 3 06:59:41 EST 2012
On 02.07.2012, at 22:56, Stuart Yoder wrote:
> From: Stuart Yoder <stuart.yoder at freescale.com>
>
> Signed-off-by: Stuart Yoder <stuart.yoder at freescale.com>
> ---
>
> -this patch is a pre-requisite for the idle hcall which I
> am trying to get into Alex's KVM tree, so ideally would like
> Ben's ack and get this applied to Alex's tree
>
> -built/tested with a 32-bit booke kernel, built a 64-bit
> booke kernel
>
> arch/powerpc/include/asm/exception-64s.h | 4 ++--
> arch/powerpc/include/asm/thread_info.h | 6 ++++++
> arch/powerpc/kernel/entry_32.S | 24 ++++++++++++------------
> arch/powerpc/kernel/entry_64.S | 14 +++++++-------
> arch/powerpc/kernel/exceptions-64e.S | 2 +-
> arch/powerpc/kernel/exceptions-64s.S | 2 +-
> arch/powerpc/kernel/head_fsl_booke.S | 2 +-
> arch/powerpc/kernel/idle_6xx.S | 4 ++--
> arch/powerpc/kernel/idle_book3e.S | 2 +-
> arch/powerpc/kernel/idle_e500.S | 4 ++--
> arch/powerpc/kernel/idle_power4.S | 2 +-
> arch/powerpc/kernel/misc_32.S | 4 ++--
> arch/powerpc/kvm/bookehv_interrupts.S | 6 +-----
> arch/powerpc/mm/hash_low_32.S | 8 ++++----
> arch/powerpc/sysdev/6xx-suspend.S | 2 +-
> 15 files changed, 44 insertions(+), 42 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
> index d58fc4e..5dbd00d 100644
> --- a/arch/powerpc/include/asm/exception-64s.h
> +++ b/arch/powerpc/include/asm/exception-64s.h
> @@ -293,7 +293,7 @@ label##_hv: \
>
> #define RUNLATCH_ON \
> BEGIN_FTR_SECTION \
> - clrrdi r3,r1,THREAD_SHIFT; \
> + CURRENT_THREAD_INFO(r3, r1) \
> ld r4,TI_LOCAL_FLAGS(r3); \
> andi. r0,r4,_TLF_RUNLATCH; \
> beql ppc64_runlatch_on_trampoline; \
> @@ -332,7 +332,7 @@ label##_common: \
> #ifdef CONFIG_PPC_970_NAP
> #define FINISH_NAP \
> BEGIN_FTR_SECTION \
> - clrrdi r11,r1,THREAD_SHIFT; \
> + CURRENT_THREAD_INFO(r11, r1) \
> ld r9,TI_LOCAL_FLAGS(r11); \
> andi. r10,r9,_TLF_NAPPING; \
> bnel power4_fixup_nap; \
> diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
> index 68831e9..2e7bc3c 100644
> --- a/arch/powerpc/include/asm/thread_info.h
> +++ b/arch/powerpc/include/asm/thread_info.h
> @@ -22,6 +22,12 @@
>
> #define THREAD_SIZE (1 << THREAD_SHIFT)
>
> +#ifndef CONFIG_PPC64
I usually way prefer positive to negative logic. So if you could swap the 2 cases, I'd be a lot happier ;)
> +#define CURRENT_THREAD_INFO(dest, sp) rlwinm dest, sp, 0, 0, 31-THREAD_SHIFT
> +#else
> +#define CURRENT_THREAD_INFO(dest, sp) clrrdi dest, sp, THREAD_SHIFT
> +#endif
This should go into an #ifdef __ASSEMBLY__ block, right? :)
The rest looks great :)
Alex
More information about the Linuxppc-dev
mailing list