Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/time: Make mftb() common to PPC32 and PPC64

No need to have two versions that are identical.

CONFIG_PPC_CELL is only selected by PPC64 targets.
CONFIG_E500 is the only PPC64 target selecting CONFIG_FSL_BOOK3E.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/6bf23ec744aab4ba63506a011f6a145ea35d620d.1601556145.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
ff125fbc 15c10215

+4 -10
+4 -10
arch/powerpc/include/asm/reg.h
··· 1419 1419 __msr_check_and_clear(bits); 1420 1420 } 1421 1421 1422 - #ifdef __powerpc64__ 1423 - #if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E) 1422 + #if defined(CONFIG_PPC_CELL) || defined(CONFIG_E500) 1424 1423 #define mftb() ({unsigned long rval; \ 1425 1424 asm volatile( \ 1426 1425 "90: mfspr %0, %2;\n" \ ··· 1429 1430 : "=r" (rval) \ 1430 1431 : "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL) : "cr0"); \ 1431 1432 rval;}) 1433 + #elif defined(CONFIG_PPC_8xx) 1434 + #define mftb() ({unsigned long rval; \ 1435 + asm volatile("mftbl %0" : "=r" (rval)); rval;}) 1432 1436 #else 1433 1437 #define mftb() ({unsigned long rval; \ 1434 1438 asm volatile("mfspr %0, %1" : \ 1435 1439 "=r" (rval) : "i" (SPRN_TBRL)); rval;}) 1436 1440 #endif /* !CONFIG_PPC_CELL */ 1437 1441 1438 - #else /* __powerpc64__ */ 1439 - 1440 1442 #if defined(CONFIG_PPC_8xx) 1441 - #define mftb() ({unsigned long rval; \ 1442 - asm volatile("mftbl %0" : "=r" (rval)); rval;}) 1443 1443 #define mftbu() ({unsigned long rval; \ 1444 1444 asm volatile("mftbu %0" : "=r" (rval)); rval;}) 1445 1445 #else 1446 - #define mftb() ({unsigned long rval; \ 1447 - asm volatile("mfspr %0, %1" : "=r" (rval) : \ 1448 - "i" (SPRN_TBRL)); rval;}) 1449 1446 #define mftbu() ({unsigned long rval; \ 1450 1447 asm volatile("mfspr %0, %1" : "=r" (rval) : \ 1451 1448 "i" (SPRN_TBRU)); rval;}) 1452 1449 #endif 1453 - #endif /* !__powerpc64__ */ 1454 1450 1455 1451 #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) 1456 1452 #define mttbu(v) asm volatile("mttbu %0":: "r"(v))