sdei.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. // Copyright (C) 2017 Arm Ltd.
  3. #ifndef __ASM_SDEI_H
  4. #define __ASM_SDEI_H
  5. /* Values for sdei_exit_mode */
  6. #define SDEI_EXIT_HVC 0
  7. #define SDEI_EXIT_SMC 1
  8. #define SDEI_STACK_SIZE IRQ_STACK_SIZE
  9. #ifndef __ASSEMBLY__
  10. #include <linux/linkage.h>
  11. #include <linux/preempt.h>
  12. #include <linux/types.h>
  13. #include <asm/virt.h>
  14. DECLARE_PER_CPU(struct sdei_registered_event *, sdei_active_normal_event);
  15. DECLARE_PER_CPU(struct sdei_registered_event *, sdei_active_critical_event);
  16. extern unsigned long sdei_exit_mode;
  17. /* Software Delegated Exception entry point from firmware*/
  18. asmlinkage void __sdei_asm_handler(unsigned long event_num, unsigned long arg,
  19. unsigned long pc, unsigned long pstate);
  20. /* and its CONFIG_UNMAP_KERNEL_AT_EL0 trampoline */
  21. asmlinkage void __sdei_asm_entry_trampoline(unsigned long event_num,
  22. unsigned long arg,
  23. unsigned long pc,
  24. unsigned long pstate);
  25. /* Abort a running handler. Context is discarded. */
  26. void __sdei_handler_abort(void);
  27. /*
  28. * The above entry point does the minimum to call C code. This function does
  29. * anything else, before calling the driver.
  30. */
  31. struct sdei_registered_event;
  32. asmlinkage unsigned long __sdei_handler(struct pt_regs *regs,
  33. struct sdei_registered_event *arg);
  34. unsigned long do_sdei_event(struct pt_regs *regs,
  35. struct sdei_registered_event *arg);
  36. unsigned long sdei_arch_get_entry_point(int conduit);
  37. #define sdei_arch_get_entry_point(x) sdei_arch_get_entry_point(x)
  38. #endif /* __ASSEMBLY__ */
  39. #endif /* __ASM_SDEI_H */