18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __ASM_ARM_SYSTEM_MISC_H 38c2ecf20Sopenharmony_ci#define __ASM_ARM_SYSTEM_MISC_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <linux/compiler.h> 88c2ecf20Sopenharmony_ci#include <linux/linkage.h> 98c2ecf20Sopenharmony_ci#include <linux/irqflags.h> 108c2ecf20Sopenharmony_ci#include <linux/reboot.h> 118c2ecf20Sopenharmony_ci#include <linux/percpu.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciextern void cpu_init(void); 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_civoid soft_restart(unsigned long); 168c2ecf20Sopenharmony_ciextern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); 178c2ecf20Sopenharmony_ciextern void (*arm_pm_idle)(void); 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR 208c2ecf20Sopenharmony_citypedef void (*harden_branch_predictor_fn_t)(void); 218c2ecf20Sopenharmony_ciDECLARE_PER_CPU(harden_branch_predictor_fn_t, harden_branch_predictor_fn); 228c2ecf20Sopenharmony_cistatic inline void harden_branch_predictor(void) 238c2ecf20Sopenharmony_ci{ 248c2ecf20Sopenharmony_ci harden_branch_predictor_fn_t fn = per_cpu(harden_branch_predictor_fn, 258c2ecf20Sopenharmony_ci smp_processor_id()); 268c2ecf20Sopenharmony_ci if (fn) 278c2ecf20Sopenharmony_ci fn(); 288c2ecf20Sopenharmony_ci} 298c2ecf20Sopenharmony_ci#else 308c2ecf20Sopenharmony_ci#define harden_branch_predictor() do { } while (0) 318c2ecf20Sopenharmony_ci#endif 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define UDBG_UNDEFINED (1 << 0) 348c2ecf20Sopenharmony_ci#define UDBG_SYSCALL (1 << 1) 358c2ecf20Sopenharmony_ci#define UDBG_BADABORT (1 << 2) 368c2ecf20Sopenharmony_ci#define UDBG_SEGV (1 << 3) 378c2ecf20Sopenharmony_ci#define UDBG_BUS (1 << 4) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciextern unsigned int user_debug; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci#endif /* __ASM_ARM_SYSTEM_MISC_H */ 44