arm64: alternative: Merge alternative-asm.h into alternative.h
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Jun 2015 09:47:41 +0000 (10:47 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 5 Jun 2015 09:38:53 +0000 (10:38 +0100)
asm/alternative-asm.h and asm/alternative.h are extremely similar,
and really deserve to live in the same file (as this makes further
modufications a bit easier).

Fold the content of alternative-asm.h into alternative.h, and
update the few users.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/alternative-asm.h [deleted file]
arch/arm64/include/asm/alternative.h
arch/arm64/kernel/entry.S
arch/arm64/mm/cache.S

diff --git a/arch/arm64/include/asm/alternative-asm.h b/arch/arm64/include/asm/alternative-asm.h
deleted file mode 100644 (file)
index 919a678..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __ASM_ALTERNATIVE_ASM_H
-#define __ASM_ALTERNATIVE_ASM_H
-
-#ifdef __ASSEMBLY__
-
-.macro altinstruction_entry orig_offset alt_offset feature orig_len alt_len
-       .word \orig_offset - .
-       .word \alt_offset - .
-       .hword \feature
-       .byte \orig_len
-       .byte \alt_len
-.endm
-
-.macro alternative_insn insn1 insn2 cap
-661:   \insn1
-662:   .pushsection .altinstructions, "a"
-       altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f
-       .popsection
-       .pushsection .altinstr_replacement, "ax"
-663:   \insn2
-664:   .popsection
-       .if ((664b-663b) != (662b-661b))
-               .error "Alternatives instruction length mismatch"
-       .endif
-.endm
-
-#endif  /*  __ASSEMBLY__  */
-
-#endif /* __ASM_ALTERNATIVE_ASM_H */
index d261f01e2baeee70c53f3ac7a6f44b7b6e21a98f..265b13ea02eed8eb8b917b30dfb893fd460e3e08 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __ASM_ALTERNATIVE_H
 #define __ASM_ALTERNATIVE_H
 
+#ifndef __ASSEMBLY__
+
 #include <linux/types.h>
 #include <linux/stddef.h>
 #include <linux/stringify.h>
@@ -41,4 +43,29 @@ void free_alternatives_memory(void);
        "       .error \"Alternatives instruction length mismatch\"\n\t"\
        ".endif\n"
 
+#else
+
+.macro altinstruction_entry orig_offset alt_offset feature orig_len alt_len
+       .word \orig_offset - .
+       .word \alt_offset - .
+       .hword \feature
+       .byte \orig_len
+       .byte \alt_len
+.endm
+
+.macro alternative_insn insn1 insn2 cap
+661:   \insn1
+662:   .pushsection .altinstructions, "a"
+       altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f
+       .popsection
+       .pushsection .altinstr_replacement, "ax"
+663:   \insn2
+664:   .popsection
+       .if ((664b-663b) != (662b-661b))
+               .error "Alternatives instruction length mismatch"
+       .endif
+.endm
+
+#endif  /*  __ASSEMBLY__  */
+
 #endif /* __ASM_ALTERNATIVE_H */
index 9fe1a85c2027ee739c9e9e5b2a4c84bacdd7131a..d369ccff67e2f4acd1afd1fd70c8788aa98c51ab 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/linkage.h>
 
-#include <asm/alternative-asm.h>
+#include <asm/alternative.h>
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
 #include <asm/cpufeature.h>
index f563e9af0d01c82a1084bcffe427368f5d23ec99..bdeb5d38c2dd72c8510c7547b5cb2170f2fc5b33 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/cpufeature.h>
-#include <asm/alternative-asm.h>
+#include <asm/alternative.h>
 
 #include "proc-macros.S"