浏览代码

[POWERPC] Support nested cpu feature sections

This patch adds some macros that can be used with an explicit label in
order to nest cpu features. This should be used very careful but is
necessary for the upcoming cell TB fixup.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Benjamin Herrenschmidt 18 年之前
父节点
当前提交
7aeb732428
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      include/asm-powerpc/cputable.h

+ 9 - 5
include/asm-powerpc/cputable.h

@@ -434,30 +434,34 @@ static inline int cpu_has_feature(unsigned long feature)
 
 
 #ifdef __ASSEMBLY__
 #ifdef __ASSEMBLY__
 
 
-#define BEGIN_FTR_SECTION		98:
+#define BEGIN_FTR_SECTION_NESTED(label)	label:
+#define BEGIN_FTR_SECTION		BEGIN_FTR_SECTION_NESTED(98)
 
 
 #ifndef __powerpc64__
 #ifndef __powerpc64__
-#define END_FTR_SECTION(msk, val)		\
+#define END_FTR_SECTION_NESTED(msk, val, label) \
 99:						\
 99:						\
 	.section __ftr_fixup,"a";		\
 	.section __ftr_fixup,"a";		\
 	.align 2;				\
 	.align 2;				\
 	.long msk;				\
 	.long msk;				\
 	.long val;				\
 	.long val;				\
-	.long 98b;				\
+	.long label##b;				\
 	.long 99b;				\
 	.long 99b;				\
 	.previous
 	.previous
 #else /* __powerpc64__ */
 #else /* __powerpc64__ */
-#define END_FTR_SECTION(msk, val)		\
+#define END_FTR_SECTION_NESTED(msk, val, label) \
 99:						\
 99:						\
 	.section __ftr_fixup,"a";		\
 	.section __ftr_fixup,"a";		\
 	.align 3;				\
 	.align 3;				\
 	.llong msk;				\
 	.llong msk;				\
 	.llong val;				\
 	.llong val;				\
-	.llong 98b;				\
+	.llong label##b;				\
 	.llong 99b;	 			\
 	.llong 99b;	 			\
 	.previous
 	.previous
 #endif /* __powerpc64__ */
 #endif /* __powerpc64__ */
 
 
+#define END_FTR_SECTION(msk, val)		\
+	END_FTR_SECTION_NESTED(msk, val, 98)
+
 #define END_FTR_SECTION_IFSET(msk)	END_FTR_SECTION((msk), (msk))
 #define END_FTR_SECTION_IFSET(msk)	END_FTR_SECTION((msk), (msk))
 #define END_FTR_SECTION_IFCLR(msk)	END_FTR_SECTION((msk), 0)
 #define END_FTR_SECTION_IFCLR(msk)	END_FTR_SECTION((msk), 0)
 #endif /* __ASSEMBLY__ */
 #endif /* __ASSEMBLY__ */