aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/patching.h
diff options
context:
space:
mode:
authorGravatar Julien Thierry <jthierry@redhat.com> 2021-03-03 18:05:29 +0100
committerGravatar Will Deacon <will@kernel.org> 2021-05-27 17:37:25 +0100
commit5f154c4e20d7edd38bddec78f3e0a7628057ef76 (patch)
tree2e5fd4d618b2acd02946c265e07a6ee5fb3e4f4d /arch/arm64/include/asm/patching.h
parentLinux 5.13-rc3 (diff)
downloadlinux-5f154c4e20d7edd38bddec78f3e0a7628057ef76.tar.gz
linux-5f154c4e20d7edd38bddec78f3e0a7628057ef76.tar.bz2
linux-5f154c4e20d7edd38bddec78f3e0a7628057ef76.zip
arm64: Move patching utilities out of instruction encoding/decoding
Files insn.[c|h] containt some functions used for instruction patching. In order to reuse the instruction encoder/decoder, move the patching utilities to their own file. Signed-off-by: Julien Thierry <jthierry@redhat.com> Link: https://lore.kernel.org/r/20210303170536.1838032-2-jthierry@redhat.com [will: Include patching.h in insn.h to fix header mess; add __ASSEMBLY__ guards] Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/patching.h')
-rw-r--r--arch/arm64/include/asm/patching.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/patching.h b/arch/arm64/include/asm/patching.h
new file mode 100644
index 000000000000..5ebab129222f
--- /dev/null
+++ b/arch/arm64/include/asm/patching.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_PATCHING_H
+#define __ASM_PATCHING_H
+
+#include <linux/types.h>
+
+#ifndef __ASSEMBLY__
+int aarch64_insn_read(void *addr, u32 *insnp);
+int aarch64_insn_write(void *addr, u32 insn);
+
+int aarch64_insn_patch_text_nosync(void *addr, u32 insn);
+int aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt);
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_PATCHING_H */