1 #ifndef CYGONCE_INFRA_DIAG_H
2 #define CYGONCE_INFRA_DIAG_H
4 /*=============================================================================
8 // Diagnostic Routines for Infra Development
10 //==========================================================================
11 //####COPYRIGHTBEGIN####
13 // ----------------------------------------------------------------------------
14 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
16 // This file is part of the eCos host tools.
18 // This program is free software; you can redistribute it and/or modify it
19 // under the terms of the GNU General Public License as published by the Free
20 // Software Foundation; either version 2 of the License, or (at your option)
23 // This program is distributed in the hope that it will be useful, but WITHOUT
24 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
28 // You should have received a copy of the GNU General Public License along with
29 // this program; if not, write to the Free Software Foundation, Inc.,
30 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 // ----------------------------------------------------------------------------
34 //####COPYRIGHTEND####
35 //==========================================================================
36 //#####DESCRIPTIONBEGIN####
39 // Contributors: nickg
41 // Purpose: Diagnostic Routines for Infra Development
42 // Description: Diagnostic routines for use during infra development.
43 // Usage: #include <cyg/infra/diag.h>
45 //####DESCRIPTIONEND####
47 //==========================================================================*/
49 #include <pkgconf/infra.h>
50 #include <cyg/infra/cyg_type.h>
52 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG
56 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE
57 #include <cyg/io/io_diag.h>
60 /*---------------------------------------------------------------------------*/
61 /* Diagnostic routines */
63 externC void diag_init(void); /* Initialize, call before any others*/
65 externC void diag_write_char(char c); /* Write single char to output */
67 externC void diag_write_string(const char *psz); /* Write zero terminated string */
69 externC void diag_write_dec( cyg_int32 n); /* Write decimal value */
71 externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */
73 externC void diag_dump_buf(void *buf, CYG_ADDRWORD len);
75 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG
77 externC void diag_printf( const char *fmt, ... ); /* Formatted print */
81 // This function deliberately has a K&R prototype to avoid having to use
82 // varargs, or pad arglists or anything grody like that.
84 #warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled
85 #warning Expect a "function declaration isn't a prototype" warning
87 externC void diag_printf(/* const char *fmt, CYG_ADDRWORD, CYG_ADDRWORD,
88 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD,
89 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */);
93 /*---------------------------------------------------------------------------*/
94 /* Internal Diagnostic MACROS */
96 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE
97 #define DIAG_DEVICE_START_SYNC() diag_device_start_sync()
98 #define DIAG_DEVICE_END_SYNC() diag_device_end_sync()
100 #define DIAG_DEVICE_START_SYNC()
101 #define DIAG_DEVICE_END_SYNC()
104 /*---------------------------------------------------------------------------*/
105 #endif /* CYGONCE_INFRA_DIAG_H */