1/* 2 * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * The contents of this file constitute Original Code as defined in and 7 * are subject to the Apple Public Source License Version 1.1 (the 8 * "License"). You may not use this file except in compliance with the 9 * License. Please obtain a copy of the License at 10 * http://www.apple.com/publicsource and read it before using this file. 11 * 12 * This Original Code and all software distributed under the License are 13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 17 * License for the specific language governing rights and limitations 18 * under the License. 19 * 20 * @APPLE_LICENSE_HEADER_END@ 21 */ 22 23#ifndef _IOAUDIODEBUG_H 24#define _IOAUDIODEBUG_H 25 26#include <IOKit/IOTypes.h> 27#include <sys/kdebug.h> 28 29 30#ifdef DEBUG 31 #define DEBUG_LEVEL 3 //<rdar://problem/9725460> 32 //#define DEBUG_USE_FIRELOG 1 33 #define DEBUG_USE_FIREWIRE_KPRINTF 1 34 35 #ifdef DEBUG_USE_FIRELOG 36 #include <IOKit/firewire/FireLog.h> 37 #define audioDebugIOLog( level, message... ) \ 38 do {FireLog( message ); FireLog("\n");} while (0) 39 #endif 40 41 #ifdef DEBUG_USE_IOUSBLOG 42 #include <IOKit/usb/IOUSBLog.h> 43 #define audioDebugIOLog( level, message... ) \ 44 do {USBLog( level, message );} while (0) 45 #endif 46 47 #ifdef DEBUG_USE_FIREWIRE_KPRINTF 48 #define audioDebugIOLog( level, message... ) \ 49 do { if (level <= DEBUG_LEVEL) kprintf( message );} while (0) 50 #endif 51 52 53 54 #ifdef assert 55 #undef assert 56 57 #define AssertionMessage( cond, file, line ) \ 58 "assert \"" #cond "\" failed in " #file " at line " #line 59 60 #define AssertionFailed( cond, file, line ) \ 61 panic(AssertionMessage( cond, file, line )); 62 63 #define assert( cond ) \ 64 if( !(cond) ) { \ 65 AssertionFailed( cond, __FILE__, __LINE__ ) \ 66 } 67 #endif 68#else 69 #define audioDebugIOLog( level, message... ) ; 70#endif 71 72 73#endif /* _IOAUDIODEBUG_H */ 74