Wolfgang Denk | 4646d2a | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 1 | /** |
| 2 | * @file IxQMgrDispatcher_p.h |
| 3 | * |
| 4 | * @author Intel Corporation |
| 5 | * @date 07-Feb-2002 |
| 6 | * |
| 7 | * @brief This file contains the internal functions for dispatcher |
| 8 | * |
| 9 | * |
| 10 | * @par |
| 11 | * IXP400 SW Release version 2.0 |
| 12 | * |
| 13 | * -- Copyright Notice -- |
| 14 | * |
| 15 | * @par |
| 16 | * Copyright 2001-2005, Intel Corporation. |
| 17 | * All rights reserved. |
| 18 | * |
| 19 | * @par |
| 20 | * Redistribution and use in source and binary forms, with or without |
| 21 | * modification, are permitted provided that the following conditions |
| 22 | * are met: |
| 23 | * 1. Redistributions of source code must retain the above copyright |
| 24 | * notice, this list of conditions and the following disclaimer. |
| 25 | * 2. Redistributions in binary form must reproduce the above copyright |
| 26 | * notice, this list of conditions and the following disclaimer in the |
| 27 | * documentation and/or other materials provided with the distribution. |
| 28 | * 3. Neither the name of the Intel Corporation nor the names of its contributors |
| 29 | * may be used to endorse or promote products derived from this software |
| 30 | * without specific prior written permission. |
| 31 | * |
| 32 | * @par |
| 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' |
| 34 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 35 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 36 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 37 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 38 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 39 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 40 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 41 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 42 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 43 | * SUCH DAMAGE. |
| 44 | * |
| 45 | * @par |
| 46 | * -- End of Copyright Notice -- |
| 47 | */ |
| 48 | |
| 49 | #ifndef IXQMGRDISPATCHER_P_H |
| 50 | #define IXQMGRDISPATCHER_P_H |
| 51 | |
| 52 | /* |
| 53 | * User defined include files |
| 54 | */ |
| 55 | #include "IxQMgr.h" |
| 56 | |
| 57 | /* |
| 58 | * This structure defines the statistic data for a queue |
| 59 | */ |
| 60 | typedef struct |
| 61 | { |
| 62 | unsigned callbackCnt; /* Call count of callback */ |
| 63 | unsigned priorityChangeCnt; /* Priority change count */ |
| 64 | unsigned intNoCallbackCnt; /* Interrupt fired but no callback set count */ |
| 65 | unsigned intLostCallbackCnt; /* Interrupt lost and detected ; SCR541 */ |
| 66 | BOOL notificationEnabled; /* Interrupt enabled for this queue */ |
| 67 | IxQMgrSourceId srcSel; /* interrupt source */ |
| 68 | unsigned enableCount; /* num times notif enabled by LLP */ |
| 69 | unsigned disableCount; /* num of times notif disabled by LLP */ |
| 70 | } IxQMgrDispatcherQStats; |
| 71 | |
| 72 | /* |
| 73 | * This structure defines statistic data for the disatcher |
| 74 | */ |
| 75 | typedef struct |
| 76 | { |
| 77 | unsigned loopRunCnt; /* ixQMgrDispatcherLoopRun count */ |
| 78 | |
| 79 | IxQMgrDispatcherQStats queueStats[IX_QMGR_MAX_NUM_QUEUES]; |
| 80 | |
| 81 | } IxQMgrDispatcherStats; |
| 82 | |
| 83 | /* |
| 84 | * Initialise the dispatcher component |
| 85 | */ |
| 86 | void |
| 87 | ixQMgrDispatcherInit (void); |
| 88 | |
| 89 | /* |
| 90 | * Get the dispatcher statistics |
| 91 | */ |
| 92 | IxQMgrDispatcherStats* |
| 93 | ixQMgrDispatcherStatsGet (void); |
| 94 | |
| 95 | /** |
| 96 | * Retrieve the number of leading zero bits starting from the MSB |
| 97 | * This function is implemented as an (extremely fast) asm routine |
| 98 | * for XSCALE processor (see clz instruction) and as a (slower) C |
| 99 | * function for other systems. |
| 100 | */ |
| 101 | unsigned int |
| 102 | ixQMgrCountLeadingZeros(unsigned int value); |
| 103 | |
| 104 | #endif/*IXQMGRDISPATCHER_P_H*/ |
| 105 | |
| 106 | |