intc.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. *********************************************************************************************************
  3. * AR100 SYSTEM
  4. * AR100 Software System Develop Kits
  5. * interrupt module
  6. *
  7. * (c) Copyright 2012-2016, Sunny China
  8. * All Rights Reserved
  9. *
  10. * File : intc.h
  11. * By : Sunny
  12. * Version : v1.0
  13. * Date : 2012-4-27
  14. * Descript: interrupt controller public header.
  15. * Update : date auther ver notes
  16. * 2012-4-27 10:52:56 Sunny 1.0 Create this file.
  17. *********************************************************************************************************
  18. */
  19. #ifndef __INTC_H__
  20. #define __INTC_H__
  21. #include <hal_interrupt.h>
  22. #include <sunxi_hal_common.h>
  23. /*
  24. *********************************************************************************************************
  25. * INIT INTERRUPT MANAGER
  26. *
  27. * Description: initialize interrupt manager.
  28. *
  29. * Arguments : none.
  30. *
  31. * Returns : OK if initialize interrupt manager succeeded, others if failed.
  32. *********************************************************************************************************
  33. */
  34. s32 interrupt_init(void);
  35. /*
  36. *********************************************************************************************************
  37. * EXIT INTERRUPT MANAGER
  38. *
  39. * Description: exit interrupt manager.
  40. *
  41. * Arguments : none.
  42. *
  43. * Returns : OK if exit interrupt manager succeeded, others if failed.
  44. *********************************************************************************************************
  45. */
  46. s32 interrupt_exit(void);
  47. /*
  48. *********************************************************************************************************
  49. * ENABLE INTERRUPT
  50. *
  51. * Description: enable a specific interrupt.
  52. *
  53. * Arguments : intno : the number of interrupt which we want to enable.
  54. *
  55. * Returns : OK if enable interrupt succeeded, others if failed.
  56. *********************************************************************************************************
  57. */
  58. s32 interrupt_enable(u32 intno);
  59. /*
  60. *********************************************************************************************************
  61. * DISABLE INTERRUPT
  62. *
  63. * Description: disable a specific interrupt.
  64. *
  65. * Arguments : intno : the number of interrupt which we want to disable.
  66. *
  67. * Returns : OK if disable interrupt succeeded, others if failed.
  68. *********************************************************************************************************
  69. */
  70. s32 interrupt_disable(u32 intno);
  71. /*
  72. *********************************************************************************************************
  73. * SET NMI TRIGGER
  74. *
  75. * Description: set nmi trigger.
  76. *
  77. * Arguments : type : the trigger type.
  78. *
  79. * Returns : OK if set trigger type succeeded, others if failed.
  80. *********************************************************************************************************
  81. */
  82. s32 interrupt_set_nmi_trigger(u32 type);
  83. s32 interrupt_set_mask(u32 intno, u32 mask);
  84. s32 interrupt_set_group_config(u32 grp_irq_num, u32 mask);
  85. /*
  86. *********************************************************************************************************
  87. * INSTALL ISR
  88. *
  89. * Description: install ISR for a specific interrupt.
  90. *
  91. * Arguments : intno : the number of interrupt which we want to install ISR.
  92. * pisr : the ISR which to been install.
  93. * parg : the argument for the ISR.
  94. *
  95. * Returns : OK if install ISR succeeded, others if failed.
  96. *
  97. * Note : the ISR execute entironment : CPU disable interrupt response.
  98. *********************************************************************************************************
  99. */
  100. s32 install_isr(u32 intno, __pISR_hdle_t pisr, void *parg);
  101. /*
  102. *********************************************************************************************************
  103. * UNINSTALL ISR
  104. *
  105. * Description: uninstall ISR for a specific interrupt.
  106. *
  107. * Arguments : intno : the number of interrupt which we want to uninstall ISR.
  108. * pisr : the ISR which to been uninstall.
  109. *
  110. * Returns : OK if uninstall ISR succeeded, others if failed.
  111. *********************************************************************************************************
  112. */
  113. s32 uninstall_isr(u32 intno, __pISR_hdle_t pisr);
  114. /*
  115. *********************************************************************************************************
  116. * INTERRUPT ENTRY
  117. *
  118. * Description: the entry of CPU IRQ, mainly for CPU IRQ exception.
  119. *
  120. * Arguments : none.
  121. *
  122. * Returns : OK if process CPU IRQ succeeded, others if failed.
  123. *********************************************************************************************************
  124. */
  125. s32 interrupt_entry(void);
  126. s32 interrupt_query_pending(u32 intno);
  127. s32 interrupt_clear_pending(u32 intno);
  128. u32 interrupt_get_current_intno(void);
  129. s32 interrupt_standby_enter(void);
  130. s32 interrupt_standby_exit(void);
  131. #endif /* __INTC_H__ */