Mercurial > ecos
annotate packages/infra/current/include/diag.h @ 66:bf00f99aec69 ecos-sw-2000-02-02
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
| author | jlarmour |
|---|---|
| date | Wed, 02 Feb 2000 19:57:02 +0000 |
| parents | c38311975d4f |
| children | 435cced73e2f |
| rev | line source |
|---|---|
| 0 | 1 #ifndef CYGONCE_INFRA_DIAG_H |
| 2 #define CYGONCE_INFRA_DIAG_H | |
| 3 | |
| 4 /*============================================================================= | |
| 5 // | |
| 2 | 6 // diag.h |
| 0 | 7 // |
| 2 | 8 // Diagnostic Routines for Infra Development |
| 0 | 9 // |
| 10 //========================================================================== | |
| 11 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
14 // The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
15 // Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
16 // compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
17 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
18 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
19 // Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
31 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
32 // |
| 0 | 33 //####COPYRIGHTEND#### |
| 34 //========================================================================== | |
| 35 //#####DESCRIPTIONBEGIN#### | |
| 36 // | |
| 2 | 37 // Author(s): nickg |
| 38 // Contributors: nickg | |
| 39 // Date: 1998-03-02 | |
| 40 // Purpose: Diagnostic Routines for Infra Development | |
| 41 // Description: Diagnostic routines for use during infra development. | |
| 42 // Usage: #include <cyg/infra/diag.h> | |
| 0 | 43 // |
| 44 //####DESCRIPTIONEND#### | |
| 45 // | |
| 46 //==========================================================================*/ | |
| 47 | |
| 2 | 48 #include <pkgconf/infra.h> |
| 0 | 49 #include <cyg/infra/cyg_type.h> |
| 50 | |
| 51 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG | |
| 52 #include <stdarg.h> | |
| 53 #endif | |
| 54 | |
| 2 | 55 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE |
| 56 #include <cyg/io/io_diag.h> | |
| 57 #endif | |
| 58 | |
| 0 | 59 /*---------------------------------------------------------------------------*/ |
| 60 /* Diagnostic routines */ | |
| 61 | |
| 62 externC void diag_init(void); /* Initialize, call before any others*/ | |
| 63 | |
| 64 externC void diag_write_char(char c); /* Write single char to output */ | |
| 65 | |
| 2 | 66 externC void diag_write_string(const char *psz); /* Write zero terminated string */ |
| 0 | 67 |
| 68 externC void diag_write_dec( cyg_int32 n); /* Write decimal value */ | |
| 69 | |
| 70 externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */ | |
| 71 | |
| 72 | |
| 73 #ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG | |
| 74 | |
| 2 | 75 externC void diag_printf( const char *fmt, ... ); /* Formatted print */ |
| 0 | 76 |
| 77 #else | |
| 78 | |
| 79 // This function deliberately has a K&R prototype to avoid having to use | |
| 80 // varargs, or pad arglists or anything grody like that. | |
| 81 | |
| 82 #warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled | |
| 83 #warning Expect a "function declaration isn't a prototype" warning | |
| 84 | |
| 2 | 85 externC void diag_printf(/* const char *fmt, CYG_ADDRWORD, CYG_ADDRWORD, |
| 0 | 86 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD, |
| 87 CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */); | |
| 88 | |
| 89 #endif | |
| 90 | |
| 91 /*---------------------------------------------------------------------------*/ | |
| 92 /* Internal Diagnostic MACROS */ | |
| 93 | |
| 94 #ifdef CYGDBG_INFRA_DIAG_USE_DEVICE | |
| 2 | 95 #define DIAG_DEVICE_START_SYNC() diag_device_start_sync() |
| 96 #define DIAG_DEVICE_END_SYNC() diag_device_end_sync() | |
| 0 | 97 #else |
| 98 #define DIAG_DEVICE_START_SYNC() | |
| 99 #define DIAG_DEVICE_END_SYNC() | |
| 100 #endif | |
| 101 | |
| 102 /*---------------------------------------------------------------------------*/ | |
| 103 #endif /* CYGONCE_INFRA_DIAG_H */ | |
| 104 /* EOF diag.h */ |
