Skip to content

Commit 15c1021

Browse files
chleroympe
authored andcommitted
powerpc/time: Rename mftbl() to mftb()
On PPC64, we have mftb(). On PPC32, we have mftbl() and an #define mftb() mftbl(). mftb() and mftbl() are equivalent, their purpose is to read the content of SPRN_TRBL, as returned by 'mftb' simplified instruction. binutils seems to define 'mftbl' instruction as an equivalent of 'mftb'. However in both 32 bits and 64 bits documentation, only 'mftb' is defined, and when performing a disassembly with objdump, the displayed instruction is 'mftb' No need to have two ways to do the same thing with different names, rename mftbl() to have only mftb(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/94dc68d3d9ef9eb549796d4b938b6ba0305a049b.1601556145.git.christophe.leroy@csgroup.eu
1 parent 8654187 commit 15c1021

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

arch/powerpc/include/asm/reg.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,19 +1439,18 @@ static inline void msr_check_and_clear(unsigned long bits)
14391439
#else /* __powerpc64__ */
14401440

14411441
#if defined(CONFIG_PPC_8xx)
1442-
#define mftbl() ({unsigned long rval; \
1442+
#define mftb() ({unsigned long rval; \
14431443
asm volatile("mftbl %0" : "=r" (rval)); rval;})
14441444
#define mftbu() ({unsigned long rval; \
14451445
asm volatile("mftbu %0" : "=r" (rval)); rval;})
14461446
#else
1447-
#define mftbl() ({unsigned long rval; \
1447+
#define mftb() ({unsigned long rval; \
14481448
asm volatile("mfspr %0, %1" : "=r" (rval) : \
14491449
"i" (SPRN_TBRL)); rval;})
14501450
#define mftbu() ({unsigned long rval; \
14511451
asm volatile("mfspr %0, %1" : "=r" (rval) : \
14521452
"i" (SPRN_TBRU)); rval;})
14531453
#endif
1454-
#define mftb() mftbl()
14551454
#endif /* !__powerpc64__ */
14561455

14571456
#define mttbl(v) asm volatile("mttbl %0":: "r"(v))

arch/powerpc/include/asm/time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct div_result {
4747

4848
static inline unsigned long get_tbl(void)
4949
{
50-
return mftbl();
50+
return mftb();
5151
}
5252

5353
static inline unsigned int get_tbu(void)

0 commit comments

Comments
 (0)