system_misc.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_ARM_SYSTEM_MISC_H
  3. #define __ASM_ARM_SYSTEM_MISC_H
  4. #ifndef __ASSEMBLY__
  5. #include <linux/compiler.h>
  6. #include <linux/linkage.h>
  7. #include <linux/irqflags.h>
  8. #include <linux/reboot.h>
  9. #include <linux/percpu.h>
  10. extern void cpu_init(void);
  11. void soft_restart(unsigned long);
  12. extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
  13. extern void (*arm_pm_idle)(void);
  14. #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
  15. typedef void (*harden_branch_predictor_fn_t)(void);
  16. DECLARE_PER_CPU(harden_branch_predictor_fn_t, harden_branch_predictor_fn);
  17. static inline void harden_branch_predictor(void)
  18. {
  19. harden_branch_predictor_fn_t fn = per_cpu(harden_branch_predictor_fn,
  20. smp_processor_id());
  21. if (fn)
  22. fn();
  23. }
  24. #else
  25. #define harden_branch_predictor() do { } while (0)
  26. #endif
  27. #define UDBG_UNDEFINED (1 << 0)
  28. #define UDBG_SYSCALL (1 << 1)
  29. #define UDBG_BADABORT (1 << 2)
  30. #define UDBG_SEGV (1 << 3)
  31. #define UDBG_BUS (1 << 4)
  32. extern unsigned int user_debug;
  33. static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
  34. {
  35. return -1;
  36. }
  37. #endif /* !__ASSEMBLY__ */
  38. #endif /* __ASM_ARM_SYSTEM_MISC_H */