Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 1 | /* |
| 2 | * @file IxOsalAssert.h |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 3 | * @author Intel Corporation |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 4 | * @date 25-08-2004 |
| 5 | * |
| 6 | * @brief description goes here |
| 7 | * |
| 8 | * @par |
| 9 | * IXP400 SW Release version 2.0 |
| 10 | * |
| 11 | * -- Copyright Notice -- |
| 12 | * |
| 13 | * @par |
| 14 | * Copyright 2001-2005, Intel Corporation. |
| 15 | * All rights reserved. |
| 16 | * |
| 17 | * @par |
| 18 | * Redistribution and use in source and binary forms, with or without |
| 19 | * modification, are permitted provided that the following conditions |
| 20 | * are met: |
| 21 | * 1. Redistributions of source code must retain the above copyright |
| 22 | * notice, this list of conditions and the following disclaimer. |
| 23 | * 2. Redistributions in binary form must reproduce the above copyright |
| 24 | * notice, this list of conditions and the following disclaimer in the |
| 25 | * documentation and/or other materials provided with the distribution. |
| 26 | * 3. Neither the name of the Intel Corporation nor the names of its contributors |
| 27 | * may be used to endorse or promote products derived from this software |
| 28 | * without specific prior written permission. |
| 29 | * |
| 30 | * @par |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' |
| 32 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 33 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 34 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 35 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 39 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 40 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 41 | * SUCH DAMAGE. |
| 42 | * |
| 43 | * @par |
| 44 | * -- End of Copyright Notice -- |
| 45 | */ |
| 46 | |
| 47 | #ifndef IX_OSAL_ASSERT_H |
| 48 | #define IX_OSAL_ASSERT_H |
| 49 | |
| 50 | /* |
| 51 | * Put the system defined include files required |
| 52 | * @par |
| 53 | * <TAGGED> |
| 54 | */ |
| 55 | |
| 56 | #include "IxOsalOsAssert.h" |
| 57 | |
| 58 | /** |
| 59 | * @brief Assert macro, assert the condition is true. This |
| 60 | * will not be compiled out. |
| 61 | * N.B. will result in a system crash if it is false. |
| 62 | */ |
Wolfgang Denk | d945527 | 2006-05-30 15:58:20 +0200 | [diff] [blame] | 63 | #define IX_OSAL_ASSERT(c) IX_OSAL_OS_ASSERT(c) |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 64 | |
| 65 | |
| 66 | /** |
| 67 | * @brief Ensure macro, ensure the condition is true. |
| 68 | * This will be conditionally compiled out and |
| 69 | * may be used for test purposes. |
| 70 | */ |
| 71 | #ifdef IX_OSAL_ENSURE_ON |
| 72 | #define IX_OSAL_ENSURE(c, str) do { \ |
| 73 | if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, str, \ |
| 74 | 0, 0, 0, 0, 0, 0); } while (0) |
| 75 | |
| 76 | #else |
| 77 | #define IX_OSAL_ENSURE(c, str) |
| 78 | #endif |
| 79 | |
| 80 | |
| 81 | #endif /* IX_OSAL_ASSERT_H */ |