X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=tools%2Fsrc%2Finfra%2Fdiag.h;fp=tools%2Fsrc%2Finfra%2Fdiag.h;h=664e527af2026966e84b692b5d981f1317b4df55;hb=2b5bec7716c03d42cfb16d8c98c9cea573bf6722;hp=0000000000000000000000000000000000000000;hpb=47412fc4bd1aefc0d5498bcb3860a9d727196f16;p=karo-tx-redboot.git diff --git a/tools/src/infra/diag.h b/tools/src/infra/diag.h new file mode 100644 index 00000000..664e527a --- /dev/null +++ b/tools/src/infra/diag.h @@ -0,0 +1,106 @@ +#ifndef CYGONCE_INFRA_DIAG_H +#define CYGONCE_INFRA_DIAG_H + +/*============================================================================= +// +// diag.h +// +// Diagnostic Routines for Infra Development +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ---------------------------------------------------------------------------- +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// +// This file is part of the eCos host tools. +// +// 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. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU General Public License along with +// this program; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// ---------------------------------------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: Diagnostic Routines for Infra Development +// Description: Diagnostic routines for use during infra development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +#include +#include + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG +#include +#endif + +#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE +#include +#endif + +/*---------------------------------------------------------------------------*/ +/* Diagnostic routines */ + +externC void diag_init(void); /* Initialize, call before any others*/ + +externC void diag_write_char(char c); /* Write single char to output */ + +externC void diag_write_string(const char *psz); /* Write zero terminated string */ + +externC void diag_write_dec( cyg_int32 n); /* Write decimal value */ + +externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */ + +externC void diag_dump_buf(void *buf, CYG_ADDRWORD len); + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG + +externC void diag_printf( const char *fmt, ... ); /* Formatted print */ + +#else + +// This function deliberately has a K&R prototype to avoid having to use +// varargs, or pad arglists or anything grody like that. + +#warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled +#warning Expect a "function declaration isn't a prototype" warning + +externC void diag_printf(/* const char *fmt, CYG_ADDRWORD, CYG_ADDRWORD, + CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD, + CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */); + +#endif + +/*---------------------------------------------------------------------------*/ +/* Internal Diagnostic MACROS */ + +#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE +#define DIAG_DEVICE_START_SYNC() diag_device_start_sync() +#define DIAG_DEVICE_END_SYNC() diag_device_end_sync() +#else +#define DIAG_DEVICE_START_SYNC() +#define DIAG_DEVICE_END_SYNC() +#endif + +/*---------------------------------------------------------------------------*/ +#endif /* CYGONCE_INFRA_DIAG_H */ +/* EOF diag.h */