/*1* Debug macros for run-time debugging.2* Turned on/off with CONFIG_RUNTIME_DEBUG option.3*4* Copyright (C) 2001 MontaVista Software Inc.5* Author: Jun Sun, [email protected] or [email protected]6*7* This program is free software; you can redistribute it and/or modify it8* under the terms of the GNU General Public License as published by the9* Free Software Foundation; either version 2 of the License, or (at your10* option) any later version.11*12*/1314#ifndef _ASM_DEBUG_H15#define _ASM_DEBUG_H161718/*19* run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in20* kernel hacking config menu to use them.21*22* Use them as run-time debugging aid. NEVER USE THEM AS ERROR HANDLING CODE!!!23*/2425#ifdef CONFIG_RUNTIME_DEBUG2627#include <linux/kernel.h>2829#define db_assert(x) if (!(x)) { \30panic("assertion failed at %s:%d: %s", __FILE__, __LINE__, #x); }31#define db_warn(x) if (!(x)) { \32printk(KERN_WARNING "warning at %s:%d: %s", __FILE__, __LINE__, #x); }33#define db_verify(x, y) db_assert(x y)34#define db_verify_warn(x, y) db_warn(x y)35#define db_run(x) do { x; } while (0)3637#else3839#define db_assert(x)40#define db_warn(x)41#define db_verify(x, y) x42#define db_verify_warn(x, y) x43#define db_run(x)4445#endif4647#endif /* _ASM_DEBUG_H */484950