sbi_irqchip.h 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2022 Ventana Micro Systems Inc.
  5. *
  6. * Authors:
  7. * Anup Patel <apatel@ventanamicro.com>
  8. */
  9. #ifndef __SBI_IRQCHIP_H__
  10. #define __SBI_IRQCHIP_H__
  11. #include <sbi/sbi_types.h>
  12. struct sbi_scratch;
  13. struct sbi_trap_regs;
  14. /**
  15. * Set external interrupt handling function
  16. *
  17. * This function is called by OpenSBI platform code to set a handler for
  18. * external interrupts
  19. *
  20. * @param fn function pointer for handling external irqs
  21. */
  22. void sbi_irqchip_set_irqfn(int (*fn)(struct sbi_trap_regs *regs));
  23. /**
  24. * Process external interrupts
  25. *
  26. * This function is called by sbi_trap_handler() to handle external
  27. * interrupts.
  28. *
  29. * @param regs pointer for trap registers
  30. */
  31. int sbi_irqchip_process(struct sbi_trap_regs *regs);
  32. /** Initialize interrupt controllers */
  33. int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot);
  34. /** Exit interrupt controllers */
  35. void sbi_irqchip_exit(struct sbi_scratch *scratch);
  36. #endif