diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2017-08-08 14:58:50 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-08-10 16:32:09 +0300 |
commit | 72e4b2cdf07b4c43115f058ed74d694eab5d6454 (patch) | |
tree | bce21f1e76f78f8843732cdc1c2988f5931891ec /arch/powerpc/boot/ppc_asm.h | |
parent | de41ef6e4d70f2d30f96ca959fdde3200403d167 (diff) | |
download | linux-72e4b2cdf07b4c43115f058ed74d694eab5d6454.tar.xz |
powerpc/time: refactor MFTB() to limit number of ifdefs
The 8xx cannot access the TBL and TBU registers using mfspr/mtspr
It must be accessed using mftb/mftbu
Due to this, there is a number of places with #ifdef CONFIG_8xx
This patch defines new macros MFTBL(x) and MFTBU(x) on the same model
as MFTB(x) and tries to make use of them as much as possible.
In arch/powerpc/include/asm/timex.h, we also remove the ifdef
for the asm() operands as the compiler doesn't mind unused operands
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/boot/ppc_asm.h')
-rw-r--r-- | arch/powerpc/boot/ppc_asm.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot/ppc_asm.h index 68e388ee94fe..c63299f9fdd9 100644 --- a/arch/powerpc/boot/ppc_asm.h +++ b/arch/powerpc/boot/ppc_asm.h @@ -80,4 +80,12 @@ .long 0xa6037b7d; /* mtsrr1 r11 */ \ .long 0x2400004c /* rfid */ +#ifdef CONFIG_PPC_8xx +#define MFTBL(dest) mftb dest +#define MFTBU(dest) mftbu dest +#else +#define MFTBL(dest) mfspr dest, SPRN_TBRL +#define MFTBU(dest) mfspr dest, SPRN_TBRU +#endif + #endif /* _PPC64_PPC_ASM_H */ |