xref: /linux/arch/powerpc/include/asm/livepatch.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
11ccea77eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2f63e6d89SMichael Ellerman /*
3f63e6d89SMichael Ellerman  * livepatch.h - powerpc-specific Kernel Live Patching Core
4f63e6d89SMichael Ellerman  *
5f63e6d89SMichael Ellerman  * Copyright (C) 2015-2016, SUSE, IBM Corp.
6f63e6d89SMichael Ellerman  */
7f63e6d89SMichael Ellerman #ifndef _ASM_POWERPC_LIVEPATCH_H
8f63e6d89SMichael Ellerman #define _ASM_POWERPC_LIVEPATCH_H
9f63e6d89SMichael Ellerman 
10*5d7c8545SChristophe Leroy #include <linux/sched.h>
11ed1cd6deSChristophe Leroy #include <linux/sched/task_stack.h>
12f63e6d89SMichael Ellerman 
13a4520b25SChristophe Leroy #ifdef CONFIG_LIVEPATCH_64
klp_init_thread_info(struct task_struct * p)14ed1cd6deSChristophe Leroy static inline void klp_init_thread_info(struct task_struct *p)
155d31a96eSMichael Ellerman {
165d31a96eSMichael Ellerman 	/* + 1 to account for STACK_END_MAGIC */
17ed1cd6deSChristophe Leroy 	task_thread_info(p)->livepatch_sp = end_of_stack(p) + 1;
185d31a96eSMichael Ellerman }
195d31a96eSMichael Ellerman #else
klp_init_thread_info(struct task_struct * p)20ed1cd6deSChristophe Leroy static inline void klp_init_thread_info(struct task_struct *p) { }
21a4520b25SChristophe Leroy #endif
22f63e6d89SMichael Ellerman 
23f63e6d89SMichael Ellerman #endif /* _ASM_POWERPC_LIVEPATCH_H */
24