1 //=============================================================================
5 // HAL diagnostic output code
7 //=============================================================================
8 //####UNSUPPORTEDBEGIN####
10 // -------------------------------------------
11 // This source file has been contributed to eCos/Red Hat. It may have been
12 // changed slightly to provide an interface consistent with those of other
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
17 // to date by Red Hat.
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://ecos.sourceware.org/ecos/intouch.html for details).
23 // Contributed by: Kevin Hester <khester@opticworks.com>
24 // Maintained by: <Unmaintained>
25 // -------------------------------------------
27 //####UNSUPPORTEDEND####
28 //=============================================================================
29 //####ECOSGPLCOPYRIGHTBEGIN####
30 // -------------------------------------------
31 // This file is part of eCos, the Embedded Configurable Operating System.
32 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
34 // eCos is free software; you can redistribute it and/or modify it under
35 // the terms of the GNU General Public License as published by the Free
36 // Software Foundation; either version 2 or (at your option) any later version.
38 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
39 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
40 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
43 // You should have received a copy of the GNU General Public License along
44 // with eCos; if not, write to the Free Software Foundation, Inc.,
45 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
47 // As a special exception, if other files instantiate templates or use macros
48 // or inline functions from this file, or you compile this file and link it
49 // with other works to produce a work based on this file, this file does not
50 // by itself cause the resulting work to be covered by the GNU General Public
51 // License. However the source code for this file must still be made available
52 // in accordance with section (3) of the GNU General Public License.
54 // This exception does not invalidate any other reasons why a work based on
55 // this file might be covered by the GNU General Public License.
57 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
58 // at http://sources.redhat.com/ecos/ecos-license/
59 // -------------------------------------------
60 //####ECOSGPLCOPYRIGHTEND####
61 //=============================================================================
62 //#####DESCRIPTIONBEGIN####
64 // Author(s): nickg, jskov
67 // Purpose: HAL diagnostic output
68 // Description: Implementations of HAL diagnostic output support.
70 //####DESCRIPTIONEND####
72 //=============================================================================
74 #include <pkgconf/hal.h>
76 #ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
78 #include <cyg/infra/cyg_type.h> // base types
79 #include <cyg/infra/cyg_trac.h> // tracing macros
80 #include <cyg/infra/cyg_ass.h> // assertion macros
82 #include <cyg/hal/hal_io.h> // IO macros
83 #include <cyg/hal/hal_diag.h>
84 #include <cyg/hal/hal_intr.h> // Interrupt macros
86 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
87 #include <cyg/hal/hal_stub.h> // hal_output_gdb_string
90 #include <cyg/hal/ppc_regs.h>
91 #include <cyg/hal/quicc_smc2.h>
93 //-----------------------------------------------------------------------------
94 // Select default diag channel to use
96 //#define CYG_KERNEL_DIAG_ROMART
97 //#define CYG_KERNEL_DIAG_SERIAL
99 #if !defined(CYG_KERNEL_DIAG_SERIAL)
100 #define CYG_KERNEL_DIAG_SERIAL
103 //-----------------------------------------------------------------------------
104 // Fads board specific serial
106 #if defined(CYG_KERNEL_DIAG_SERIAL)
108 void hal_diag_init(void)
110 #if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS)
111 // init the actual serial port
116 void hal_diag_write_char(char c)
118 #if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS)
119 unsigned long __state;
120 HAL_DISABLE_INTERRUPTS(__state);
122 HAL_RESTORE_INTERRUPTS(__state);
124 hal_output_gdb_string (&c, 1);
128 void hal_diag_read_char(char *c)
130 *c = cyg_smc2_getchar();
134 #endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG