1*6c8f7fc3SBen Gras /* $NetBSD: debug.h,v 1.4 2012/04/15 19:07:40 martin Exp $ */ 2*6c8f7fc3SBen Gras 3*6c8f7fc3SBen Gras /*- 4*6c8f7fc3SBen Gras * Copyright (c) 2007 The NetBSD Foundation, Inc. 5*6c8f7fc3SBen Gras * All rights reserved. 6*6c8f7fc3SBen Gras * 7*6c8f7fc3SBen Gras * This code is derived from software contributed to The NetBSD Foundation 8*6c8f7fc3SBen Gras * by Andrew Doran. 9*6c8f7fc3SBen Gras * 10*6c8f7fc3SBen Gras * Redistribution and use in source and binary forms, with or without 11*6c8f7fc3SBen Gras * modification, are permitted provided that the following conditions 12*6c8f7fc3SBen Gras * are met: 13*6c8f7fc3SBen Gras * 1. Redistributions of source code must retain the above copyright 14*6c8f7fc3SBen Gras * notice, this list of conditions and the following disclaimer. 15*6c8f7fc3SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 16*6c8f7fc3SBen Gras * notice, this list of conditions and the following disclaimer in the 17*6c8f7fc3SBen Gras * documentation and/or other materials provided with the distribution. 18*6c8f7fc3SBen Gras * 19*6c8f7fc3SBen Gras * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20*6c8f7fc3SBen Gras * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21*6c8f7fc3SBen Gras * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22*6c8f7fc3SBen Gras * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23*6c8f7fc3SBen Gras * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24*6c8f7fc3SBen Gras * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25*6c8f7fc3SBen Gras * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26*6c8f7fc3SBen Gras * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27*6c8f7fc3SBen Gras * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28*6c8f7fc3SBen Gras * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29*6c8f7fc3SBen Gras * POSSIBILITY OF SUCH DAMAGE. 30*6c8f7fc3SBen Gras */ 31*6c8f7fc3SBen Gras 32*6c8f7fc3SBen Gras #ifndef __SYS_DEBUG_H__ 33*6c8f7fc3SBen Gras #define __SYS_DEBUG_H__ 34*6c8f7fc3SBen Gras 35*6c8f7fc3SBen Gras #ifndef _KERNEL 36*6c8f7fc3SBen Gras #error "Sorry, nothing of interest to user level programs here." 37*6c8f7fc3SBen Gras #endif 38*6c8f7fc3SBen Gras 39*6c8f7fc3SBen Gras void debug_init(void); 40*6c8f7fc3SBen Gras 41*6c8f7fc3SBen Gras void freecheck_out(void **, void *); 42*6c8f7fc3SBen Gras void freecheck_in(void **, void *); 43*6c8f7fc3SBen Gras 44*6c8f7fc3SBen Gras #if defined(DEBUG) && defined(_HARDKERNEL) 45*6c8f7fc3SBen Gras #define FREECHECK_OUT(h, a) freecheck_out((h), (a)) 46*6c8f7fc3SBen Gras #define FREECHECK_IN(h, a) freecheck_in((h), (a)) 47*6c8f7fc3SBen Gras #else 48*6c8f7fc3SBen Gras #define FREECHECK_OUT(h, a) /* nothing */ 49*6c8f7fc3SBen Gras #define FREECHECK_IN(h, a) /* nothing */ 50*6c8f7fc3SBen Gras #endif 51*6c8f7fc3SBen Gras 52*6c8f7fc3SBen Gras #endif /* __SYS_DEBUG_H__ */ 53