18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_POWERPC_IMA_H
38c2ecf20Sopenharmony_ci#define _ASM_POWERPC_IMA_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_cistruct kimage;
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciint ima_get_kexec_buffer(void **addr, size_t *size);
88c2ecf20Sopenharmony_ciint ima_free_kexec_buffer(void);
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifdef CONFIG_IMA
118c2ecf20Sopenharmony_civoid remove_ima_buffer(void *fdt, int chosen_node);
128c2ecf20Sopenharmony_ci#else
138c2ecf20Sopenharmony_cistatic inline void remove_ima_buffer(void *fdt, int chosen_node) {}
148c2ecf20Sopenharmony_ci#endif
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#ifdef CONFIG_IMA_KEXEC
178c2ecf20Sopenharmony_ciint arch_ima_add_kexec_buffer(struct kimage *image, unsigned long load_addr,
188c2ecf20Sopenharmony_ci			      size_t size);
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciint setup_ima_buffer(const struct kimage *image, void *fdt, int chosen_node);
218c2ecf20Sopenharmony_ci#else
228c2ecf20Sopenharmony_cistatic inline int setup_ima_buffer(const struct kimage *image, void *fdt,
238c2ecf20Sopenharmony_ci				   int chosen_node)
248c2ecf20Sopenharmony_ci{
258c2ecf20Sopenharmony_ci	remove_ima_buffer(fdt, chosen_node);
268c2ecf20Sopenharmony_ci	return 0;
278c2ecf20Sopenharmony_ci}
288c2ecf20Sopenharmony_ci#endif /* CONFIG_IMA_KEXEC */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#endif /* _ASM_POWERPC_IMA_H */
31