xref: /openbmc/linux/arch/arm/include/asm/system_misc.h (revision f5fe12b1eaee220ce62ff9afb8b90929c396595f)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
29f97da78SDavid Howells #ifndef __ASM_ARM_SYSTEM_MISC_H
39f97da78SDavid Howells #define __ASM_ARM_SYSTEM_MISC_H
49f97da78SDavid Howells 
59f97da78SDavid Howells #ifndef __ASSEMBLY__
69f97da78SDavid Howells 
79f97da78SDavid Howells #include <linux/compiler.h>
89f97da78SDavid Howells #include <linux/linkage.h>
99f97da78SDavid Howells #include <linux/irqflags.h>
107b6d864bSRobin Holt #include <linux/reboot.h>
11*f5fe12b1SRussell King #include <linux/percpu.h>
129f97da78SDavid Howells 
139f97da78SDavid Howells extern void cpu_init(void);
149f97da78SDavid Howells 
159f97da78SDavid Howells void soft_restart(unsigned long);
167b6d864bSRobin Holt extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
170195c002SLinus Torvalds extern void (*arm_pm_idle)(void);
189f97da78SDavid Howells 
19*f5fe12b1SRussell King #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
20*f5fe12b1SRussell King typedef void (*harden_branch_predictor_fn_t)(void);
21*f5fe12b1SRussell King DECLARE_PER_CPU(harden_branch_predictor_fn_t, harden_branch_predictor_fn);
22*f5fe12b1SRussell King static inline void harden_branch_predictor(void)
23*f5fe12b1SRussell King {
24*f5fe12b1SRussell King 	harden_branch_predictor_fn_t fn = per_cpu(harden_branch_predictor_fn,
25*f5fe12b1SRussell King 						  smp_processor_id());
26*f5fe12b1SRussell King 	if (fn)
27*f5fe12b1SRussell King 		fn();
28*f5fe12b1SRussell King }
29*f5fe12b1SRussell King #else
30*f5fe12b1SRussell King #define harden_branch_predictor() do { } while (0)
31*f5fe12b1SRussell King #endif
32*f5fe12b1SRussell King 
339f97da78SDavid Howells #define UDBG_UNDEFINED	(1 << 0)
349f97da78SDavid Howells #define UDBG_SYSCALL	(1 << 1)
359f97da78SDavid Howells #define UDBG_BADABORT	(1 << 2)
369f97da78SDavid Howells #define UDBG_SEGV	(1 << 3)
379f97da78SDavid Howells #define UDBG_BUS	(1 << 4)
389f97da78SDavid Howells 
399f97da78SDavid Howells extern unsigned int user_debug;
409f97da78SDavid Howells 
41621f48e4STyler Baicar static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
42621f48e4STyler Baicar {
43621f48e4STyler Baicar 	return -1;
44621f48e4STyler Baicar }
45621f48e4STyler Baicar 
469f97da78SDavid Howells #endif /* !__ASSEMBLY__ */
479f97da78SDavid Howells 
489f97da78SDavid Howells #endif /* __ASM_ARM_SYSTEM_MISC_H */
49