diff options
author | Sven Schnelle <svens@stackframe.org> | 2019-04-04 21:14:09 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2019-05-03 23:47:38 +0200 |
commit | 620a53d522ba007a79fffc444bd75e8d3775f5b8 (patch) | |
tree | c2931055351578f8912c41f629d44c500bba7fde /arch/parisc/include/asm/patch.h | |
parent | ccfbc68d41c2db8f5e88128427fb5bfe3855ff9b (diff) | |
download | lwn-620a53d522ba007a79fffc444bd75e8d3775f5b8.tar.gz lwn-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/asm/patch.h')
-rw-r--r-- | arch/parisc/include/asm/patch.h | 11 |
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 |