1 /**************************************************************************
3 * Copyright (c) 2000-2002 Alacritech, Inc. All rights reserved.
5 * $Id: slicdbg.h,v 1.2 2006/03/27 15:10:04 mook Exp $
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY ALACRITECH, INC. ``AS IS'' AND ANY
19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ALACRITECH, INC. OR
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
25 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * The views and conclusions contained in the software and documentation
32 * are those of the authors and should not be interpreted as representing
33 * official policies, either expressed or implied, of Alacritech, Inc.
35 **************************************************************************/
40 * All debug and assertion-based definitions and macros are included
41 * in this file for the SLICOSS driver.
43 #ifndef _SLIC_DEBUG_H_
44 #define _SLIC_DEBUG_H_
46 #ifdef SLIC_DEFAULT_LOG_LEVEL
48 #define SLICLEVEL KERN_DEBUG
50 #define SLIC_DISPLAY printk
51 #define DBG_ERROR(n, args...) SLIC_DISPLAY(KERN_EMERG n, ##args)
53 #define SLIC_DEBUG_MESSAGE 1
54 #if SLIC_DEBUG_MESSAGE
55 /*#define DBG_MSG(n, args...) SLIC_DISPLAY(SLICLEVEL n, ##args)*/
56 #define DBG_MSG(n, args...)
58 #define DBG_MSG(n, args...)
65 #if SLIC_ASSERT_ENABLED
67 #define VALID_ADDRESS(p) (1)
69 #define VALID_ADDRESS(p) (((ulong32)(p) & 0x80000000) || ((ulong32)(p) == 0))
75 DBG_ERROR("ASSERT() Failure: file %s, function %s line %d\n",\
76 __FILE__, __func__, __LINE__); \
82 #define ASSERTMSG(a,msg) \
85 DBG_ERROR("ASSERT() Failure: file %s, function %s"\
87 __FILE__, __func__, __LINE__, (msg)); \
97 #define ASSERTMSG(a, msg)
99 #endif /* SLIC_ASSERT_ENABLED */
101 #endif /* _SLIC_DEBUG_H_ */