Mercurial > ecos
diff packages/infra/current/include/diag.h @ 0:3111d98ba7b3 ecos-v1_1-release
Initial commit of eCos version 1.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 11:16:07 +0000 |
| parents | |
| children | 443894e2e912 |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/diag.h @@ -0,0 +1,97 @@ +#ifndef CYGONCE_INFRA_DIAG_H +#define CYGONCE_INFRA_DIAG_H + +/*============================================================================= +// +// diag.h +// +// Diagnostic Routines for Infra Development +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####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 <cyg/infra/diag.h> +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +#include <cyg/infra/cyg_type.h> + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG +#include <stdarg.h> +#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(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 */ + + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG + +externC void diag_printf( 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(/* 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 */
