summaryrefslogtreecommitdiffstats
path: root/arch/parisc/include
diff options
context:
space:
mode:
authorSven Schnelle2019-04-04 21:14:09 +0200
committerHelge Deller2019-05-03 23:47:38 +0200
commit620a53d522ba007a79fffc444bd75e8d3775f5b8 (patch)
treec2931055351578f8912c41f629d44c500bba7fde /arch/parisc/include
parentparisc: add set_fixmap()/clear_fixmap() (diff)
downloadkernel-qcow2-linux-620a53d522ba007a79fffc444bd75e8d3775f5b8.tar.gz
kernel-qcow2-linux-620a53d522ba007a79fffc444bd75e8d3775f5b8.tar.xz
kernel-qcow2-linux-620a53d522ba007a79fffc444bd75e8d3775f5b8.zip
parisc: add parisc code patching
Instead of re-mapping the whole kernel text with RWX rights add a patch_text() which can be used to replace instructions in the kernel .text section. Based on the ARM implementation. Signed-off-by: Sven Schnelle <svens@stackframe.org> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/include')
-rw-r--r--arch/parisc/include/asm/patch.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/parisc/include/asm/patch.h b/arch/parisc/include/asm/patch.h
new file mode 100644
index 000000000000..685b58a13968
--- /dev/null
+++ b/arch/parisc/include/asm/patch.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _PARISC_KERNEL_PATCH_H
+#define _PARISC_KERNEL_PATCH_H
+
+/* stop machine and patch kernel text */
+void patch_text(void *addr, unsigned int insn);
+
+/* patch kernel text with machine already stopped (e.g. in kgdb) */
+void __patch_text(void *addr, unsigned int insn);
+
+#endif