This source file includes following definitions.
- klp_arch_set_pc
- klp_get_ftrace_location
- klp_init_thread_info
- klp_init_thread_info
1
2
3
4
5
6
7 #ifndef _ASM_POWERPC_LIVEPATCH_H
8 #define _ASM_POWERPC_LIVEPATCH_H
9
10 #include <linux/module.h>
11 #include <linux/ftrace.h>
12 #include <linux/sched/task_stack.h>
13
14 #ifdef CONFIG_LIVEPATCH
15 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
16 {
17 regs->nip = ip;
18 }
19
20 #define klp_get_ftrace_location klp_get_ftrace_location
21 static inline unsigned long klp_get_ftrace_location(unsigned long faddr)
22 {
23
24
25
26
27 return ftrace_location_range(faddr, faddr + 16);
28 }
29
30 static inline void klp_init_thread_info(struct task_struct *p)
31 {
32
33 task_thread_info(p)->livepatch_sp = end_of_stack(p) + 1;
34 }
35 #else
36 static inline void klp_init_thread_info(struct task_struct *p) { }
37 #endif
38
39 #endif