Mercurial > ecos-v3_0-branch
annotate packages/hal/powerpc/fads/current/src/hal_diag.c @ 2729:74dbf4c3f2e1 after-copyright-change-20090129
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
| author | jlarmour |
|---|---|
| date | Thu, 29 Jan 2009 17:47:46 +0000 |
| parents | ca7141aff7c0 |
| children |
| 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 | |
| 1982 | 21 // http://ecos.sourceware.org/ecos/intouch.html for details). |
| 2 | 22 // |
| 23 // Contributed by: Kevin Hester <khester@opticworks.com> | |
| 24 // Maintained by: <Unmaintained> | |
| 25 // ------------------------------------------- | |
| 26 // | |
| 27 //####UNSUPPORTEDEND#### | |
| 28 //============================================================================= | |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
29 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
30 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
31 // This file is part of eCos, the Embedded Configurable Operating System. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
32 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
101
diff
changeset
|
33 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
34 // eCos is free software; you can redistribute it and/or modify it under |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
35 // the terms of the GNU General Public License as published by the Free |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
36 // Software Foundation; either version 2 or (at your option) any later |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
37 // version. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
101
diff
changeset
|
38 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
39 // eCos is distributed in the hope that it will be useful, but WITHOUT |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
40 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
41 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
42 // for more details. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
101
diff
changeset
|
43 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
44 // You should have received a copy of the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
45 // along with eCos; if not, write to the Free Software Foundation, Inc., |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
46 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
101
diff
changeset
|
47 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
48 // As a special exception, if other files instantiate templates or use |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
49 // macros or inline functions from this file, or you compile this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
50 // and link it with other works to produce a work based on this file, |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
51 // this file does not by itself cause the resulting work to be covered by |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
52 // the GNU General Public License. However the source code for this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
53 // must still be made available in accordance with section (3) of the GNU |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
54 // General Public License v2. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
101
diff
changeset
|
55 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
56 // This exception does not invalidate any other reasons why a work based |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
57 // on this file might be covered by the GNU General Public License. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
58 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1982
diff
changeset
|
59 // ####ECOSGPLCOPYRIGHTEND#### |
| 2 | 60 //============================================================================= |
| 61 //#####DESCRIPTIONBEGIN#### | |
| 62 // | |
| 63 // Author(s): nickg, jskov | |
| 64 // Contributors:nickg | |
| 65 // Date: 1998-03-02 | |
| 66 // Purpose: HAL diagnostic output | |
| 67 // Description: Implementations of HAL diagnostic output support. | |
| 68 // | |
| 69 //####DESCRIPTIONEND#### | |
| 70 // | |
| 71 //============================================================================= | |
| 72 | |
| 73 #include <pkgconf/hal.h> | |
| 74 | |
|
101
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
76
diff
changeset
|
75 #ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG |
|
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
76
diff
changeset
|
76 |
| 2 | 77 #include <cyg/infra/cyg_type.h> // base types |
| 78 #include <cyg/infra/cyg_trac.h> // tracing macros | |
| 79 #include <cyg/infra/cyg_ass.h> // assertion macros | |
| 80 | |
| 81 #include <cyg/hal/hal_io.h> // IO macros | |
| 82 #include <cyg/hal/hal_diag.h> | |
| 83 #include <cyg/hal/hal_intr.h> // Interrupt macros | |
| 84 | |
| 85 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) | |
| 86 #include <cyg/hal/hal_stub.h> // hal_output_gdb_string | |
| 87 #endif | |
| 88 | |
| 89 #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
|
90 #include <cyg/hal/quicc_smc2.h> |
| 2 | 91 |
| 92 //----------------------------------------------------------------------------- | |
| 93 // Select default diag channel to use | |
| 94 | |
| 95 //#define CYG_KERNEL_DIAG_ROMART | |
| 96 //#define CYG_KERNEL_DIAG_SERIAL | |
| 97 | |
| 98 #if !defined(CYG_KERNEL_DIAG_SERIAL) | |
| 99 #define CYG_KERNEL_DIAG_SERIAL | |
| 100 #endif | |
| 101 | |
| 102 //----------------------------------------------------------------------------- | |
| 103 // Fads board specific serial | |
| 104 | |
| 105 #if defined(CYG_KERNEL_DIAG_SERIAL) | |
| 106 | |
| 107 void hal_diag_init(void) | |
| 108 { | |
| 109 #if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS) | |
| 110 // init the actual serial port | |
| 111 cyg_smc2_init(9600); | |
| 112 #endif | |
| 113 } | |
| 114 | |
| 115 void hal_diag_write_char(char c) | |
| 116 { | |
| 117 #if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS) | |
| 118 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
|
119 HAL_DISABLE_INTERRUPTS(__state); |
| 2 | 120 cyg_smc2_putchar(c); |
| 121 HAL_RESTORE_INTERRUPTS(__state); | |
| 122 #else | |
| 123 hal_output_gdb_string (&c, 1); | |
| 124 #endif | |
| 125 } | |
| 126 | |
| 127 void hal_diag_read_char(char *c) | |
| 128 { | |
| 129 *c = cyg_smc2_getchar(); | |
| 130 } | |
| 131 #endif | |
| 132 | |
|
101
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
76
diff
changeset
|
133 #endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG |
