xref: /freebsd/sys/dev/pms/RefTisa/tisa/sassata/common/ossa.h (revision 4436b51dff5736e74da464946049ea6899a88938)
1 /*******************************************************************************
2 *Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3 *
4 *Redistribution and use in source and binary forms, with or without modification, are permitted provided
5 *that the following conditions are met:
6 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7 *following disclaimer.
8 *2. Redistributions in binary form must reproduce the above copyright notice,
9 *this list of conditions and the following disclaimer in the documentation and/or other materials provided
10 *with the distribution.
11 *
12 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20 *
21 * $FreeBSD$
22 *
23 ********************************************************************************/
24 /*******************************************************************************/
25 /** \file
26  *
27  * The file defines the declaration of OS types
28  *
29  */
30 
31 #ifndef __OS_SA_H__
32 #define __OS_SA_H__
33 
34 #define DEBUG_LEVEL   OSSA_DEBUG_LEVEL_1
35 #define ossaLogDebugString    TIDEBUG_MSG
36 #define ossaAssert OS_ASSERT
37 
38 #define tddmLogDebugString TIDEBUG_MSG
39 #define DM_ASSERT OS_ASSERT
40 
41 #define tdsmLogDebugString TIDEBUG_MSG
42 #define SM_ASSERT OS_ASSERT
43 
44 #ifdef NOT_YET /* no longer valid */
45 #define ossaLogDebugString(agRoot, level, string, ptr1, ptr2, value1, value2) \
46   do { \
47     if ( level <= DEBUG_LEVEL ) \
48     {                          \
49       printk("%s:", __FUNCTION__); \
50       if ( agNULL != string )  \
51       {                        \
52         printk("%s:", string); \
53       }                        \
54       if ( agNULL != ptr1 )    \
55       {                        \
56         printk("ptr1=%p,", ptr1); \
57       }                           \
58       if ( agNULL != ptr2 )       \
59       {                           \
60         printk("ptr2=%p,", ptr2); \
61       }                           \
62       if ( OSSA_DEBUG_PRINT_INVALID_NUMBER != value1 ) \
63       {                                   \
64         printk("value1=0x%08x ", value1); \
65       }                                   \
66       if ( OSSA_DEBUG_PRINT_INVALID_NUMBER != value2 ) \
67       {                                                \
68         printk("value2=0x%08x ", value2);              \
69       } \
70       printk("\n"); \
71     }        \
72   } while (0);
73 
74 #ifndef ossaAssert
75 #define ossaAssert(agRoot, expr, message) \
76   do {                                                              \
77     if (agFALSE == (expr))                                            \
78     {                                                       \
79       printk("ossaAssert: %s", (message));                        \
80       printk(" - file %s, line %d\n", __FILE__, __LINE__);  \
81     }                                                       \
82   } while (0);
83 #endif
84 #endif /* 0 */
85 #include <dev/pms/freebsd/driver/common/osenv.h>
86 #include <dev/pms/freebsd/driver/common/ostypes.h>
87 #endif  /* __OS_SA_H__ */
88