Mercurial > ecos
annotate packages/hal/powerpc/fads/current/src/hal_diag.c @ 76:435cced73e2f ecos-v1_3_1-release
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
| author | jlarmour |
|---|---|
| date | Tue, 28 Mar 2000 14:10:45 +0000 |
| parents | bf00f99aec69 |
| children | c37d3a9e1b28 |
| rev | line source |
|---|---|
| 2 | 1 //============================================================================= |
| 2 // | |
| 3 // hal_diag.c | |
| 4 // | |
| 5 // HAL diagnostic output code | |
| 6 // | |
| 7 //============================================================================= | |
| 8 //####UNSUPPORTEDBEGIN#### | |
| 9 // | |
| 10 // ------------------------------------------- | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
11 // This source file has been contributed to eCos/Red Hat. It may have been |
| 2 | 12 // changed slightly to provide an interface consistent with those of other |
| 13 // files. | |
| 14 // | |
| 15 // The functionality and contents of this file is supplied "AS IS" | |
| 16 // without any form of support and will not necessarily be kept up | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
17 // to date by Red Hat. |
| 2 | 18 // |
| 19 // All inquiries about this file, or the functionality provided by it, | |
| 20 // should be directed to the 'ecos-discuss' mailing list (see | |
| 21 // http://sourceware.cygnus.com/ecos/intouch.html for details). | |
| 22 // | |
| 23 // Contributed by: Kevin Hester <khester@opticworks.com> | |
| 24 // Maintained by: <Unmaintained> | |
| 25 // ------------------------------------------- | |
| 26 // | |
| 27 //####UNSUPPORTEDEND#### | |
| 28 //============================================================================= | |
| 29 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
30 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
31 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
32 // 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
|
33 // 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:
14
diff
changeset
|
34 // 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
|
35 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
36 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
37 // 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:
14
diff
changeset
|
38 // 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:
14
diff
changeset
|
39 // 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:
14
diff
changeset
|
40 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
41 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
42 // 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:
14
diff
changeset
|
43 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
44 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
45 // 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:
14
diff
changeset
|
46 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
47 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
48 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
49 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
14
diff
changeset
|
50 // |
| 2 | 51 //####COPYRIGHTEND#### |
| 52 //============================================================================= | |
| 53 //#####DESCRIPTIONBEGIN#### | |
| 54 // | |
| 55 // Author(s): nickg, jskov | |
| 56 // Contributors:nickg | |
| 57 // Date: 1998-03-02 | |
| 58 // Purpose: HAL diagnostic output | |
| 59 // Description: Implementations of HAL diagnostic output support. | |
| 60 // | |
| 61 //####DESCRIPTIONEND#### | |
| 62 // | |
| 63 //============================================================================= | |
| 64 | |
| 65 #include <pkgconf/hal.h> | |
| 66 | |
| 67 #include <cyg/infra/cyg_type.h> // base types | |
| 68 #include <cyg/infra/cyg_trac.h> // tracing macros | |
| 69 #include <cyg/infra/cyg_ass.h> // assertion macros | |
| 70 | |
| 71 #include <cyg/hal/hal_io.h> // IO macros | |
| 72 #include <cyg/hal/hal_diag.h> | |
| 73 #include <cyg/hal/hal_intr.h> // Interrupt macros | |
| 74 | |
| 75 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) | |
| 76 #include <cyg/hal/hal_stub.h> // hal_output_gdb_string | |
| 77 #endif | |
| 78 | |
| 79 #include <cyg/hal/ppc_regs.h> | |
|
14
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
2
diff
changeset
|
80 #include <cyg/hal/quicc_smc2.h> |
| 2 | 81 |
| 82 //----------------------------------------------------------------------------- | |
| 83 // Select default diag channel to use | |
| 84 | |
| 85 //#define CYG_KERNEL_DIAG_ROMART | |
| 86 //#define CYG_KERNEL_DIAG_SERIAL | |
| 87 | |
| 88 #if !defined(CYG_KERNEL_DIAG_SERIAL) | |
| 89 #define CYG_KERNEL_DIAG_SERIAL | |
| 90 #endif | |
| 91 | |
| 92 //----------------------------------------------------------------------------- | |
| 93 // Fads board specific serial | |
| 94 | |
| 95 #if defined(CYG_KERNEL_DIAG_SERIAL) | |
| 96 | |
| 97 void hal_diag_init(void) | |
| 98 { | |
| 99 #if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS) | |
| 100 // init the actual serial port | |
| 101 cyg_smc2_init(9600); | |
| 102 #endif | |
| 103 } | |
| 104 | |
| 105 void hal_diag_write_char(char c) | |
| 106 { | |
| 107 #if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS) | |
| 108 unsigned long __state; | |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
66
diff
changeset
|
109 HAL_DISABLE_INTERRUPTS(__state); |
| 2 | 110 cyg_smc2_putchar(c); |
| 111 HAL_RESTORE_INTERRUPTS(__state); | |
| 112 #else | |
| 113 hal_output_gdb_string (&c, 1); | |
| 114 #endif | |
| 115 } | |
| 116 | |
| 117 void hal_diag_read_char(char *c) | |
| 118 { | |
| 119 *c = cyg_smc2_getchar(); | |
| 120 } | |
| 121 #endif | |
| 122 | |
| 123 |
