diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-06-01 05:47:41 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2015-06-05 05:38:53 -0400 |
commit | 8d883b23aed73cad844ba48051c7e96eddf0f51c (patch) | |
tree | 7cda75ebfd5d669e73fe699d81ca6f4d037d6299 | |
parent | 7616fc8bcd7ef4975a294337d6cd3007b8c18746 (diff) |
arm64: alternative: Merge alternative-asm.h into alternative.h
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>
-rw-r--r-- | arch/arm64/include/asm/alternative-asm.h | 29 | ||||
-rw-r--r-- | arch/arm64/include/asm/alternative.h | 27 | ||||
-rw-r--r-- | arch/arm64/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/arm64/mm/cache.S | 2 |
4 files changed, 29 insertions, 31 deletions
diff --git a/arch/arm64/include/asm/alternative-asm.h b/arch/arm64/include/asm/alternative-asm.h deleted file mode 100644 index 919a67855b63..000000000000 --- a/arch/arm64/include/asm/alternative-asm.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #ifndef __ASM_ALTERNATIVE_ASM_H | ||
2 | #define __ASM_ALTERNATIVE_ASM_H | ||
3 | |||
4 | #ifdef __ASSEMBLY__ | ||
5 | |||
6 | .macro altinstruction_entry orig_offset alt_offset feature orig_len alt_len | ||
7 | .word \orig_offset - . | ||
8 | .word \alt_offset - . | ||
9 | .hword \feature | ||
10 | .byte \orig_len | ||
11 | .byte \alt_len | ||
12 | .endm | ||
13 | |||
14 | .macro alternative_insn insn1 insn2 cap | ||
15 | 661: \insn1 | ||
16 | 662: .pushsection .altinstructions, "a" | ||
17 | altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f | ||
18 | .popsection | ||
19 | .pushsection .altinstr_replacement, "ax" | ||
20 | 663: \insn2 | ||
21 | 664: .popsection | ||
22 | .if ((664b-663b) != (662b-661b)) | ||
23 | .error "Alternatives instruction length mismatch" | ||
24 | .endif | ||
25 | .endm | ||
26 | |||
27 | #endif /* __ASSEMBLY__ */ | ||
28 | |||
29 | #endif /* __ASM_ALTERNATIVE_ASM_H */ | ||
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h index d261f01e2bae..265b13ea02ee 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_ALTERNATIVE_H | 1 | #ifndef __ASM_ALTERNATIVE_H |
2 | #define __ASM_ALTERNATIVE_H | 2 | #define __ASM_ALTERNATIVE_H |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | ||
5 | |||
4 | #include <linux/types.h> | 6 | #include <linux/types.h> |
5 | #include <linux/stddef.h> | 7 | #include <linux/stddef.h> |
6 | #include <linux/stringify.h> | 8 | #include <linux/stringify.h> |
@@ -41,4 +43,29 @@ void free_alternatives_memory(void); | |||
41 | " .error \"Alternatives instruction length mismatch\"\n\t"\ | 43 | " .error \"Alternatives instruction length mismatch\"\n\t"\ |
42 | ".endif\n" | 44 | ".endif\n" |
43 | 45 | ||
46 | #else | ||
47 | |||
48 | .macro altinstruction_entry orig_offset alt_offset feature orig_len alt_len | ||
49 | .word \orig_offset - . | ||
50 | .word \alt_offset - . | ||
51 | .hword \feature | ||
52 | .byte \orig_len | ||
53 | .byte \alt_len | ||
54 | .endm | ||
55 | |||
56 | .macro alternative_insn insn1 insn2 cap | ||
57 | 661: \insn1 | ||
58 | 662: .pushsection .altinstructions, "a" | ||
59 | altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f | ||
60 | .popsection | ||
61 | .pushsection .altinstr_replacement, "ax" | ||
62 | 663: \insn2 | ||
63 | 664: .popsection | ||
64 | .if ((664b-663b) != (662b-661b)) | ||
65 | .error "Alternatives instruction length mismatch" | ||
66 | .endif | ||
67 | .endm | ||
68 | |||
69 | #endif /* __ASSEMBLY__ */ | ||
70 | |||
44 | #endif /* __ASM_ALTERNATIVE_H */ | 71 | #endif /* __ASM_ALTERNATIVE_H */ |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 9fe1a85c2027..d369ccff67e2 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/linkage.h> | 22 | #include <linux/linkage.h> |
23 | 23 | ||
24 | #include <asm/alternative-asm.h> | 24 | #include <asm/alternative.h> |
25 | #include <asm/assembler.h> | 25 | #include <asm/assembler.h> |
26 | #include <asm/asm-offsets.h> | 26 | #include <asm/asm-offsets.h> |
27 | #include <asm/cpufeature.h> | 27 | #include <asm/cpufeature.h> |
diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index f563e9af0d01..bdeb5d38c2dd 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <asm/assembler.h> | 23 | #include <asm/assembler.h> |
24 | #include <asm/cpufeature.h> | 24 | #include <asm/cpufeature.h> |
25 | #include <asm/alternative-asm.h> | 25 | #include <asm/alternative.h> |
26 | 26 | ||
27 | #include "proc-macros.S" | 27 | #include "proc-macros.S" |
28 | 28 | ||