| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2010, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bxpt_interrupt.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/1 $ |
|---|
| 12 | * $brcm_Date: 10/25/10 2:09p $ |
|---|
| 13 | * |
|---|
| 14 | * Porting interface code for the data transport interrupt handlers. |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_interrupt.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/1 10/25/10 2:09p gmullen |
|---|
| 21 | * SW7425-15: Moved srcs to base2 folder |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/1 10/8/10 2:57p gmullen |
|---|
| 24 | * SW7425-15: Added header files |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/1 5/13/05 1:27p gmullen |
|---|
| 27 | * PR15309: First draft of XPT PI. |
|---|
| 28 | * |
|---|
| 29 | * |
|---|
| 30 | ***************************************************************************/ |
|---|
| 31 | |
|---|
| 32 | /*= Module Overview ********************************************************* |
|---|
| 33 | The interrupt module provides an API to install and remove transport |
|---|
| 34 | interrupt handlers. Functions are available for use by porting interface |
|---|
| 35 | clients, to enable and disable interrupts. Enabling the interrupt also |
|---|
| 36 | installs a pointer to high-level interrupt handler. |
|---|
| 37 | |
|---|
| 38 | Why is a separate API for transport interrupts needed? The Interrupt Interface |
|---|
| 39 | used by other modules can only support so-called L2 interrupts. Unfortunately, |
|---|
| 40 | the transport hardware does not support the L2 mechanism; all transport |
|---|
| 41 | interrupts are L1. |
|---|
| 42 | |
|---|
| 43 | Transport interrupts fall in to 3 classes: |
|---|
| 44 | Message Ready - A complete message has been transfered into the DRAM |
|---|
| 45 | message buffers. |
|---|
| 46 | |
|---|
| 47 | Message Overflow - A given buffer was not serviced quickly enough and |
|---|
| 48 | has overflowed. |
|---|
| 49 | |
|---|
| 50 | CPU Status - A catch-all for all the other interrupts the transport can |
|---|
| 51 | generate, such as continuity-counter error, playback channel finished, |
|---|
| 52 | or PCR arrival. |
|---|
| 53 | |
|---|
| 54 | An Enable and Disable call is provided for Message Ready and Message Overflow |
|---|
| 55 | classes of interrupts. The CPU Status interrupts are now supported by the |
|---|
| 56 | Interrupt Interface. |
|---|
| 57 | |
|---|
| 58 | Three function calls are provided for use by the low-level interrupt service |
|---|
| 59 | routines. These three calls map the 'status' interrupt, the message ready |
|---|
| 60 | interrupt, and the message overflow interrupt to the high-level handler |
|---|
| 61 | which was installed when the interrupt was enabled. |
|---|
| 62 | ***************************************************************************/ |
|---|
| 63 | |
|---|
| 64 | #ifndef BXPT_INTERRUPT_H__ |
|---|
| 65 | #define BXPT_INTERRUPT_H__ |
|---|
| 66 | |
|---|
| 67 | #include "bxpt.h" |
|---|
| 68 | #include "bint.h" |
|---|
| 69 | |
|---|
| 70 | #ifdef __cplusplus |
|---|
| 71 | extern "C" { |
|---|
| 72 | #endif |
|---|
| 73 | |
|---|
| 74 | /*************************************************************************** |
|---|
| 75 | Summary: |
|---|
| 76 | Enable a given CPU Message interrupt. |
|---|
| 77 | |
|---|
| 78 | Description: |
|---|
| 79 | Enable the given message buffer interrupt. The specified callback will be |
|---|
| 80 | called when the a complete message has been transfered into the message |
|---|
| 81 | buffer. That message could be an entire transport packet, a complete PSI |
|---|
| 82 | message, or complete PES packet, etc. |
|---|
| 83 | |
|---|
| 84 | This function CANNOT be called from within a Magnum interrupt context. |
|---|
| 85 | |
|---|
| 86 | The Parm1 and Parm2 arguments passed in will be used as the |
|---|
| 87 | arguments for the Callback function when the interrupt fires. |
|---|
| 88 | |
|---|
| 89 | Returns: |
|---|
| 90 | BERR_SUCCESS - Interrupt enabled. |
|---|
| 91 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 92 | |
|---|
| 93 | See Also: |
|---|
| 94 | BXPT_Interrupt_DisableMessageInt, BXPT_Interrupt_EnableMessageInt_isr, |
|---|
| 95 | BXPT_Interrupt_DisableMessageInt_isr |
|---|
| 96 | ****************************************************************************/ |
|---|
| 97 | BERR_Code BXPT_Interrupt_EnableMessageInt( |
|---|
| 98 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 99 | int MessageBufferNum, /* [in] Which message buffer to watch. */ |
|---|
| 100 | BINT_CallbackFunc Callback, /* [in] Handler for this interrupt. */ |
|---|
| 101 | void *Parm1, /* [in] First arg to be passed to callback */ |
|---|
| 102 | int Parm2 /* [in] Second arg to be passed to callback */ |
|---|
| 103 | ); |
|---|
| 104 | |
|---|
| 105 | /*************************************************************************** |
|---|
| 106 | Summary: |
|---|
| 107 | Disable a given CPU Message interrupt. |
|---|
| 108 | |
|---|
| 109 | Description: |
|---|
| 110 | Disable the given message buffer interrupt. The transport core will no longer |
|---|
| 111 | forward interrupts for this particular message buffer to the CPU for |
|---|
| 112 | processing. The event could still occur, but no interrupt will be generated. |
|---|
| 113 | |
|---|
| 114 | This function CANNOT be called from within a Magnum interrupt context. |
|---|
| 115 | |
|---|
| 116 | Returns: |
|---|
| 117 | BERR_SUCCESS - Interrupt disabled. |
|---|
| 118 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 119 | |
|---|
| 120 | See Also: |
|---|
| 121 | BXPT_Interrupt_EnableMessageInt, BXPT_Interrupt_EnableMessageInt_isr, |
|---|
| 122 | BXPT_Interrupt_DisableMessageInt_isr |
|---|
| 123 | ****************************************************************************/ |
|---|
| 124 | BERR_Code BXPT_Interrupt_DisableMessageInt( |
|---|
| 125 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 126 | int MessageBufferNum /* [in] Message interrupt to disable. */ |
|---|
| 127 | ); |
|---|
| 128 | |
|---|
| 129 | /*************************************************************************** |
|---|
| 130 | Summary: |
|---|
| 131 | Enable a given CPU Message interrupt, interrupt context version. |
|---|
| 132 | |
|---|
| 133 | Description: |
|---|
| 134 | A version of BXPT_Interrupt_EnableMessageInt(), callable from within an |
|---|
| 135 | interrupt context. |
|---|
| 136 | |
|---|
| 137 | Returns: |
|---|
| 138 | BERR_SUCCESS - Interrupt enabled. |
|---|
| 139 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 140 | |
|---|
| 141 | See Also: |
|---|
| 142 | BXPT_Interrupt_DisableMessageInt_isr |
|---|
| 143 | ****************************************************************************/ |
|---|
| 144 | BERR_Code BXPT_Interrupt_EnableMessageInt_isr( |
|---|
| 145 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 146 | int MessageBufferNum, /* [in] Which message buffer to watch. */ |
|---|
| 147 | BINT_CallbackFunc Callback, /* [in] Handler for this interrupt. */ |
|---|
| 148 | void *Parm1, /* [in] First arg to be passed to callback */ |
|---|
| 149 | int Parm2 /* [in] Second arg to be passed to callback */ |
|---|
| 150 | ); |
|---|
| 151 | |
|---|
| 152 | /*************************************************************************** |
|---|
| 153 | Summary: |
|---|
| 154 | Disable a given CPU Message interrupt, interrupt context version. |
|---|
| 155 | |
|---|
| 156 | Description: |
|---|
| 157 | A version of BXPT_Interrupt_DisableMessageInt(), callable from within an |
|---|
| 158 | interrupt context. |
|---|
| 159 | |
|---|
| 160 | Returns: |
|---|
| 161 | BERR_SUCCESS - Interrupt enabled. |
|---|
| 162 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 163 | |
|---|
| 164 | See Also: |
|---|
| 165 | BXPT_Interrupt_EnableMessageInt_isr |
|---|
| 166 | ****************************************************************************/ |
|---|
| 167 | BERR_Code BXPT_Interrupt_DisableMessageInt_isr( |
|---|
| 168 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 169 | int MessageBufferNum /* [in] Message interrupt to disable. */ |
|---|
| 170 | ); |
|---|
| 171 | |
|---|
| 172 | /*************************************************************************** |
|---|
| 173 | Summary: |
|---|
| 174 | Enable a given CPU Message Overflow interrupt. |
|---|
| 175 | |
|---|
| 176 | Description: |
|---|
| 177 | Enable the given message buffer overflow interrupt. The specified callback |
|---|
| 178 | will be called when the an overflow condition has occurred. |
|---|
| 179 | |
|---|
| 180 | The Parm1 and Parm2 arguments passed in will be used as the |
|---|
| 181 | arguments for the Callback function when the interrupt fires. |
|---|
| 182 | |
|---|
| 183 | This function CANNOT be called from within a Magnum interrupt context. |
|---|
| 184 | |
|---|
| 185 | Returns: |
|---|
| 186 | BERR_SUCCESS - Interrupt enabled. |
|---|
| 187 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 188 | |
|---|
| 189 | See Also: |
|---|
| 190 | BXPT_Interrupt_DisableMessageOverflowInt, |
|---|
| 191 | BXPT_Interrupt_EnableMessageOverflowInt_isr |
|---|
| 192 | ****************************************************************************/ |
|---|
| 193 | BERR_Code BXPT_Interrupt_EnableMessageOverflowInt( |
|---|
| 194 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 195 | int MessageBufferNum, /* [in] Which message buffer to watch. */ |
|---|
| 196 | BINT_CallbackFunc Callback, /* [in] Handler for this interrupt. */ |
|---|
| 197 | void *Parm1, /* [in] First arg to be passed to callback */ |
|---|
| 198 | int Parm2 /* [in] Second arg to be passed to callback */ |
|---|
| 199 | ); |
|---|
| 200 | |
|---|
| 201 | /*************************************************************************** |
|---|
| 202 | Summary: |
|---|
| 203 | Disable a given CPU Message Overflow interrupt. |
|---|
| 204 | |
|---|
| 205 | Description: |
|---|
| 206 | Disable the given message buffer overflow interrupt. The transport core will |
|---|
| 207 | no longer forward overflow interrupts for this particular message buffer to |
|---|
| 208 | the CPU. The event could still occur, but no interrupt will be generated. |
|---|
| 209 | |
|---|
| 210 | This function CANNOT be called from within a Magnum interrupt context. |
|---|
| 211 | |
|---|
| 212 | Returns: |
|---|
| 213 | BERR_SUCCESS - Interrupt disabled. |
|---|
| 214 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 215 | |
|---|
| 216 | See Also: |
|---|
| 217 | BXPT_Interrupt_EnableMessageOverflowInt, |
|---|
| 218 | BXPT_Interrupt_DisableMessageOverflowInt_isr |
|---|
| 219 | ****************************************************************************/ |
|---|
| 220 | BERR_Code BXPT_Interrupt_DisableMessageOverflowInt( |
|---|
| 221 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 222 | int MessageBufferNum /* [in] Message interrupt to disable. */ |
|---|
| 223 | ); |
|---|
| 224 | |
|---|
| 225 | /*************************************************************************** |
|---|
| 226 | Summary: |
|---|
| 227 | Enable a given CPU Message Overflow interrupt, interrupt context version. |
|---|
| 228 | |
|---|
| 229 | Description: |
|---|
| 230 | A version of BXPT_Interrupt_EnableMessageOverflowInt(), callable from within |
|---|
| 231 | an interrupt context. |
|---|
| 232 | |
|---|
| 233 | Returns: |
|---|
| 234 | BERR_SUCCESS - Interrupt enabled. |
|---|
| 235 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 236 | |
|---|
| 237 | See Also: |
|---|
| 238 | BXPT_Interrupt_DisableMessageOverflowInt |
|---|
| 239 | ****************************************************************************/ |
|---|
| 240 | BERR_Code BXPT_Interrupt_EnableMessageOverflowInt_isr( |
|---|
| 241 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 242 | int MessageBufferNum, /* [in] Which message buffer to watch. */ |
|---|
| 243 | BINT_CallbackFunc Callback, /* [in] Handler for this interrupt. */ |
|---|
| 244 | void *Parm1, /* [in] First arg to be passed to callback */ |
|---|
| 245 | int Parm2 /* [in] Second arg to be passed to callback */ |
|---|
| 246 | ); |
|---|
| 247 | |
|---|
| 248 | /*************************************************************************** |
|---|
| 249 | Summary: |
|---|
| 250 | Disable a given CPU Message Overflow interrupt, interrupt context version. |
|---|
| 251 | |
|---|
| 252 | Description: |
|---|
| 253 | A version of BXPT_Interrupt_DisableMessageOverflowInt(), callable from within |
|---|
| 254 | an interrupt context. |
|---|
| 255 | |
|---|
| 256 | Returns: |
|---|
| 257 | BERR_SUCCESS - Interrupt disabled. |
|---|
| 258 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 259 | |
|---|
| 260 | See Also: |
|---|
| 261 | BXPT_Interrupt_EnableMessageOverflowInt |
|---|
| 262 | ****************************************************************************/ |
|---|
| 263 | BERR_Code BXPT_Interrupt_DisableMessageOverflowInt_isr( |
|---|
| 264 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 265 | int MessageBufferNum /* [in] Message interrupt to disable. */ |
|---|
| 266 | ); |
|---|
| 267 | |
|---|
| 268 | |
|---|
| 269 | #ifdef __cplusplus |
|---|
| 270 | } |
|---|
| 271 | #endif |
|---|
| 272 | |
|---|
| 273 | #endif /* #ifndef BXPT_INTERRUPT_H__ */ |
|---|
| 274 | |
|---|
| 275 | /* end of file */ |
|---|
| 276 | |
|---|