comparison packages/infra/current/include/diag.h @ 2:443894e2e912 ecos-v1_2_1-release

Block commit of eCos version 1.2.1
author jlarmour
date Tue, 11 May 1999 12:24:34 +0000
parents 3111d98ba7b3
children c38311975d4f
comparison
equal deleted inserted replaced
1:72f549f0d891 2:443894e2e912
1 #ifndef CYGONCE_INFRA_DIAG_H 1 #ifndef CYGONCE_INFRA_DIAG_H
2 #define CYGONCE_INFRA_DIAG_H 2 #define CYGONCE_INFRA_DIAG_H
3 3
4 /*============================================================================= 4 /*=============================================================================
5 // 5 //
6 // diag.h 6 // diag.h
7 // 7 //
8 // Diagnostic Routines for Infra Development 8 // Diagnostic Routines for Infra Development
9 // 9 //
10 //========================================================================== 10 //==========================================================================
11 //####COPYRIGHTBEGIN#### 11 //####COPYRIGHTBEGIN####
12 // 12 //
13 // ------------------------------------------- 13 // -------------------------------------------
23 // 23 //
24 // The Original Code is eCos - Embedded Cygnus Operating System, released 24 // The Original Code is eCos - Embedded Cygnus Operating System, released
25 // September 30, 1998. 25 // September 30, 1998.
26 // 26 //
27 // The Initial Developer of the Original Code is Cygnus. Portions created 27 // The Initial Developer of the Original Code is Cygnus. Portions created
28 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. 28 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved.
29 // ------------------------------------------- 29 // -------------------------------------------
30 // 30 //
31 //####COPYRIGHTEND#### 31 //####COPYRIGHTEND####
32 //========================================================================== 32 //==========================================================================
33 //#####DESCRIPTIONBEGIN#### 33 //#####DESCRIPTIONBEGIN####
34 // 34 //
35 // Author(s): nickg 35 // Author(s): nickg
36 // Contributors: nickg 36 // Contributors: nickg
37 // Date: 1998-03-02 37 // Date: 1998-03-02
38 // Purpose: Diagnostic Routines for Infra Development 38 // Purpose: Diagnostic Routines for Infra Development
39 // Description: Diagnostic routines for use during infra development. 39 // Description: Diagnostic routines for use during infra development.
40 // Usage: #include <cyg/infra/diag.h> 40 // Usage: #include <cyg/infra/diag.h>
41 // 41 //
42 //####DESCRIPTIONEND#### 42 //####DESCRIPTIONEND####
43 // 43 //
44 //==========================================================================*/ 44 //==========================================================================*/
45 45
46 #include <pkgconf/infra.h>
46 #include <cyg/infra/cyg_type.h> 47 #include <cyg/infra/cyg_type.h>
47 48
48 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG 49 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG
49 #include <stdarg.h> 50 #include <stdarg.h>
51 #endif
52
53 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE
54 #include <cyg/io/io_diag.h>
50 #endif 55 #endif
51 56
52 /*---------------------------------------------------------------------------*/ 57 /*---------------------------------------------------------------------------*/
53 /* Diagnostic routines */ 58 /* Diagnostic routines */
54 59
55 externC void diag_init(void); /* Initialize, call before any others*/ 60 externC void diag_init(void); /* Initialize, call before any others*/
56 61
57 externC void diag_write_char(char c); /* Write single char to output */ 62 externC void diag_write_char(char c); /* Write single char to output */
58 63
59 externC void diag_write_string(char *psz); /* Write zero terminated string */ 64 externC void diag_write_string(const char *psz); /* Write zero terminated string */
60 65
61 externC void diag_write_dec( cyg_int32 n); /* Write decimal value */ 66 externC void diag_write_dec( cyg_int32 n); /* Write decimal value */
62 67
63 externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */ 68 externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */
64 69
65 70
66 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG 71 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG
67 72
68 externC void diag_printf( char *fmt, ... ); /* Formatted print */ 73 externC void diag_printf( const char *fmt, ... ); /* Formatted print */
69 74
70 #else 75 #else
71 76
72 // This function deliberately has a K&R prototype to avoid having to use 77 // This function deliberately has a K&R prototype to avoid having to use
73 // varargs, or pad arglists or anything grody like that. 78 // varargs, or pad arglists or anything grody like that.
74 79
75 #warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled 80 #warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled
76 #warning Expect a "function declaration isn't a prototype" warning 81 #warning Expect a "function declaration isn't a prototype" warning
77 82
78 externC void diag_printf(/* char *fmt, CYG_ADDRWORD, CYG_ADDRWORD, 83 externC void diag_printf(/* const char *fmt, CYG_ADDRWORD, CYG_ADDRWORD,
79 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD, 84 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD,
80 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */); 85 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */);
81 86
82 #endif 87 #endif
83 88
84 /*---------------------------------------------------------------------------*/ 89 /*---------------------------------------------------------------------------*/
85 /* Internal Diagnostic MACROS */ 90 /* Internal Diagnostic MACROS */
86 91
87 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE 92 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE
88 #define DIAG_DEVICE_START_SYNC() diag_device_start_sync() 93 #define DIAG_DEVICE_START_SYNC() diag_device_start_sync()
89 #define DIAG_DEVICE_END_SYNC() diag_device_end_sync() 94 #define DIAG_DEVICE_END_SYNC() diag_device_end_sync()
90 #else 95 #else
91 #define DIAG_DEVICE_START_SYNC() 96 #define DIAG_DEVICE_START_SYNC()
92 #define DIAG_DEVICE_END_SYNC() 97 #define DIAG_DEVICE_END_SYNC()
93 #endif 98 #endif
94 99