home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / System / MorphOS / Developer / include / public / quark / interrupt.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-02  |  3.8 KB  |  167 lines

  1. #ifndef    QUARK_INTERRUPT_H
  2. #define    QUARK_INTERRUPT_H
  3.  
  4. typedef unsigned long long    q_iid_t;
  5.  
  6. /* Level0=Spurios Amiga Int...that may be
  7.  * used by other unknown sources.
  8.  */
  9. #define    INTID_AMIGA_TBE        0
  10. #define    INTID_AMIGA_DSKBLK    1
  11. #define    INTID_AMIGA_SOFTINT    2
  12. #define    INTID_AMIGA_PORTS    3
  13. #define    INTID_AMIGA_COPER    4
  14. #define    INTID_AMIGA_VERTB    5
  15. #define    INTID_AMIGA_BLIT    6
  16. #define    INTID_AMIGA_AUD0    7
  17. #define    INTID_AMIGA_AUD1    8
  18. #define    INTID_AMIGA_AUD2    9
  19. #define    INTID_AMIGA_AUD3    10
  20. #define    INTID_AMIGA_RBF        11
  21. #define    INTID_AMIGA_DSKSYNC    12
  22. #define    INTID_AMIGA_EXTER    13
  23. #define    INTID_AMIGA_COPPERINTEN    14
  24. #define    INTID_AMIGA_NMI        15
  25.  
  26. #define    INTID_DECREMENTER    16    /* Exclusive */
  27. #define    INTID_SYSTEMANAGEMENT    17    /* Exclusive */
  28.  
  29. #define    INTID_ENTRIES        18
  30.  
  31.  
  32.  
  33.  
  34.  
  35. /*
  36.  * a shared INT line of units those ints aren`t locked after an
  37.  * Int(so the event can happen again any microsecond).
  38.  * Here..int latency is the factor.
  39.  * While processing Ints the interrupt must be disabled.
  40.  * Example:
  41.  *          several microsecond timer share one INT line
  42.  */
  43.  
  44. #define    INTTYPE_QUICK    0
  45.  
  46.  
  47. /*
  48.  * a shared INT line of units those ints aren`t locked after an
  49.  * Int(so the event can happen again...but NOT at once)n.
  50.  * While processing Ints the interrupt may not be disabled
  51.  * because the same int is unlikely to occur again until it`s
  52.  * handled..even under worst case
  53.  * Example:
  54.  *          several vblank timer share one INT line
  55.  */
  56.  
  57. #define    INTTYPE_SLOW    1
  58.  
  59. /*
  60.  * a shared INT line of units those int causing units are locked
  61.  * after an Int, so we have a lot time to react on these ints and the
  62.  * interrupt must not be disabled.
  63.  * While processing Ints the interrupt can be enabled because
  64.  * the same int won`t occur again.
  65.  * Example:
  66.  *          a SCSI controller.
  67.  *          Here the scsi stateengine is stopped until the interrupt
  68.  *          is handled.
  69.  */
  70.  
  71. #define    INTTYPE_LOCKED    2
  72.  
  73. /***************************************************************/
  74.  
  75. #define    INTFLAG_RESCHEDULE    0x1
  76.  
  77.  
  78.  
  79. /***************************************************************/
  80.  
  81.  
  82.  
  83.  
  84. #define    INTTAG_Dummy        0x00001000
  85.  
  86. /* Name of the Interrupt Server Node
  87.  */
  88. #define    INTTAG_NAME        (INTTAG_Dummy+0x0)
  89.  
  90. /* Ptr to a PCDOE routine which can be used to
  91.  * move the check of the interrupt source into the
  92.  * kernel and therefore cause less thread context switches
  93.  */
  94. #define    INTTAG_PCODE        (INTTAG_Dummy+0x1)
  95.  
  96. /* Allow the thread`s intnode to be rescheduled.
  97.  * This way we would speed up average interrupt
  98.  * processing if the interrupts types which happen
  99.  * the most times are also the first in the shared
  100.  * interrupt chain.
  101.  */
  102. #define    INTTAG_PRIORITY        (INTTAG_Dummy+0x2)
  103.  
  104. /* Allow the thread`s intnode to be rescheduled.
  105.  * This way we would speed up average interrupt
  106.  * processing if the interrupts types which happen
  107.  * the most times are also the first in the shared
  108.  * interrupt chain.
  109.  */
  110. #define    INTTAG_RESCHEDULE    (INTTAG_Dummy+0x3)
  111.  
  112. /* The IntThread is sent a signal instead of
  113.  * being started synchron.
  114.  * Only useful with the PCODE tag.
  115.  * That`s a very easy and quick way to handle
  116.  * ints.
  117.  */
  118. #define    INTTAG_SIGNAL        (INTTAG_Dummy+0x4)
  119.  
  120.  
  121.  
  122. /* The mask which define the
  123.  * base state of an interrupt
  124.  */
  125. #define    WAITINTSTATE_MASK    0x7fff
  126.  
  127. /* WaitInterrupt(State)
  128.  */
  129.  
  130. /* No success..go to next entry
  131.  * Interrupt OFF state
  132.  */
  133. #define    WAITINTSTATE_FALSE    0
  134.  
  135. /* Hit and no other hits possible
  136.  * Interrupt ON/OFF state
  137.  */
  138. #define    WAITINTSTATE_OK_DONE    1
  139.  
  140.  
  141. /* Hit but there may be more than one hit
  142.  * shared TRUE line..vblank for example
  143.  * Interrupt ON/OFF state
  144.  */
  145. #define    WAITINTSTATE_OK_NEXT    2
  146.  
  147.  
  148. /* Ignore the entry
  149.  */
  150. #define    WAITINTSTATE_SKIP    0x8000
  151.  
  152.  
  153. /* Ignore the entry as the thread isn`t
  154.  * done yet.
  155.  * mostly used for reactivating ints very
  156.  * quickly and to return to the Intthread
  157.  * in Interrupt ON state so do some real
  158.  * work. While this work is done other
  159.  * ints ignore this node.
  160.  */
  161. #define    WAITINTSTATE_OK_RETURN    0x8001
  162.  
  163.  
  164.  
  165. #endif
  166.  
  167.