mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ARM: 9279/1: support function error injection
This enables HAVE_FUNCTION_ERROR_INJECTION by adding necessary regs_set_return_value() and override_function_with_return(). Simply tested according to Documentation/fault-injection/fault-injection.rst. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
This commit is contained in:
parent
ba290d4f1f
commit
aaa4dd1b47
4 changed files with 17 additions and 0 deletions
10
arch/arm/lib/error-inject.c
Normal file
10
arch/arm/lib/error-inject.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <linux/error-injection.h>
|
||||
#include <linux/kprobes.h>
|
||||
|
||||
void override_function_with_return(struct pt_regs *regs)
|
||||
{
|
||||
instruction_pointer_set(regs, regs->ARM_lr);
|
||||
}
|
||||
NOKPROBE_SYMBOL(override_function_with_return);
|
Loading…
Add table
Add a link
Reference in a new issue