2002-04-20 23:01:30 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 by Linus Nielsen Feltzing
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-04-20 23:01:30 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2005-01-27 19:17:08 +00:00
|
|
|
|
2002-04-20 23:01:30 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2002-04-30 19:43:54 +00:00
|
|
|
#include "config.h"
|
2005-01-27 19:17:08 +00:00
|
|
|
#include "cpu.h"
|
2006-02-04 00:04:02 +00:00
|
|
|
#ifdef HAVE_GDB_API
|
|
|
|
#include "gdb_api.h"
|
|
|
|
#endif
|
2002-04-20 23:01:30 +00:00
|
|
|
|
2002-05-31 13:15:48 +00:00
|
|
|
#ifdef DEBUG
|
2005-08-16 08:32:43 +00:00
|
|
|
static char debugmembuf[200];
|
2006-02-12 23:26:18 +00:00
|
|
|
#endif
|
2002-04-20 23:01:30 +00:00
|
|
|
|
2002-07-02 15:58:56 +00:00
|
|
|
#include "kernel.h"
|
|
|
|
#include "system.h"
|
2008-05-03 08:35:14 +00:00
|
|
|
#include "debug.h"
|
2002-04-30 19:43:54 +00:00
|
|
|
|
2005-05-08 13:24:30 +00:00
|
|
|
#ifdef DEBUG
|
2009-07-02 10:24:27 +00:00
|
|
|
void debug_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void debug(char *msg)
|
|
|
|
{
|
|
|
|
(void)msg;
|
|
|
|
}
|
2002-05-31 13:15:48 +00:00
|
|
|
#endif /* end of DEBUG section */
|
2002-04-20 23:01:30 +00:00
|
|
|
|
2002-10-20 22:50:58 +00:00
|
|
|
#ifdef __GNUC__
|
2004-08-16 23:37:23 +00:00
|
|
|
void debugf(const char *fmt, ...)
|
2002-10-20 22:50:58 +00:00
|
|
|
#endif
|
2002-04-20 23:01:30 +00:00
|
|
|
{
|
2002-05-02 14:05:51 +00:00
|
|
|
#ifdef DEBUG
|
2002-04-20 23:01:30 +00:00
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start(ap, fmt);
|
2002-05-02 11:44:15 +00:00
|
|
|
vsnprintf(debugmembuf, sizeof(debugmembuf), fmt, ap);
|
2002-04-20 23:01:30 +00:00
|
|
|
va_end(ap);
|
|
|
|
debug(debugmembuf);
|
2002-05-31 13:15:48 +00:00
|
|
|
#else
|
|
|
|
(void)fmt;
|
2002-05-02 14:05:51 +00:00
|
|
|
#endif
|
2002-04-20 23:01:30 +00:00
|
|
|
}
|
2002-04-30 19:43:54 +00:00
|
|
|
|