diff options
author | Kevin Hao <haokexin@gmail.com> | 2016-07-23 05:12:39 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-07-31 21:15:03 -0400 |
commit | 905259e33d0ca0ee8e0d55783c3eef3402df81b7 (patch) | |
tree | 9a9e072ab1e8b9fbdb37880d0c1be51bb585182c /arch/powerpc | |
parent | 309b315b6ec686ce050758cc4e29f6ad1125a83f (diff) |
powerpc: Remove mfvtb()
This function is only used by get_vtb(). They are almost the same except
the reading from the real register. Move the mfspr() to get_vtb() and
kill the function mfvtb(). With this, we can eliminate the use of
cpu_has_feature() in very core header file like reg.h. This is a
preparation for the use of jump label for cpu_has_feature().
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 9 | ||||
-rw-r--r-- | arch/powerpc/include/asm/time.h | 2 |
2 files changed, 1 insertions, 10 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 40f3615bf940..f69f40f1519a 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -1256,15 +1256,6 @@ static inline void msr_check_and_clear(unsigned long bits) | |||
1256 | __msr_check_and_clear(bits); | 1256 | __msr_check_and_clear(bits); |
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | static inline unsigned long mfvtb (void) | ||
1260 | { | ||
1261 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
1262 | if (cpu_has_feature(CPU_FTR_ARCH_207S)) | ||
1263 | return mfspr(SPRN_VTB); | ||
1264 | #endif | ||
1265 | return 0; | ||
1266 | } | ||
1267 | |||
1268 | #ifdef __powerpc64__ | 1259 | #ifdef __powerpc64__ |
1269 | #if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E) | 1260 | #if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E) |
1270 | #define mftb() ({unsigned long rval; \ | 1261 | #define mftb() ({unsigned long rval; \ |
diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h index 09211640a0e0..cbbeaf0a6597 100644 --- a/arch/powerpc/include/asm/time.h +++ b/arch/powerpc/include/asm/time.h | |||
@@ -103,7 +103,7 @@ static inline u64 get_vtb(void) | |||
103 | { | 103 | { |
104 | #ifdef CONFIG_PPC_BOOK3S_64 | 104 | #ifdef CONFIG_PPC_BOOK3S_64 |
105 | if (cpu_has_feature(CPU_FTR_ARCH_207S)) | 105 | if (cpu_has_feature(CPU_FTR_ARCH_207S)) |
106 | return mfvtb(); | 106 | return mfspr(SPRN_VTB); |
107 | #endif | 107 | #endif |
108 | return 0; | 108 | return 0; |
109 | } | 109 | } |