OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [powerpc/] [fads/] [current/] [src/] [hal_diag.c] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//=============================================================================
2
//
3
//      hal_diag.c
4
//
5
//      HAL diagnostic output code
6
//
7
//=============================================================================
8
//####UNSUPPORTEDBEGIN####
9
//
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 
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
17
// to date by Red Hat.
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://ecos.sourceware.org/ecos/intouch.html for details).
22
//
23
// Contributed by: Kevin Hester <khester@opticworks.com>
24
// Maintained by:  <Unmaintained>
25
// -------------------------------------------
26
//
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 Free Software Foundation, Inc.
33
//
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      
37
// version.                                                                 
38
//
39
// eCos is distributed in the hope that it will be useful, but WITHOUT      
40
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
41
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
42
// for more details.                                                        
43
//
44
// You should have received a copy of the GNU General Public License        
45
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
46
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
47
//
48
// As a special exception, if other files instantiate templates or use      
49
// macros or inline functions from this file, or you compile this file      
50
// and link it with other works to produce a work based on this file,       
51
// this file does not by itself cause the resulting work to be covered by   
52
// the GNU General Public License. However the source code for this file    
53
// must still be made available in accordance with section (3) of the GNU   
54
// General Public License v2.                                               
55
//
56
// This exception does not invalidate any other reasons why a work based    
57
// on this file might be covered by the GNU General Public License.         
58
// -------------------------------------------                              
59
// ####ECOSGPLCOPYRIGHTEND####                                              
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
 
75
#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
76
 
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>
90
#include <cyg/hal/quicc_smc2.h>
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;
119
    HAL_DISABLE_INTERRUPTS(__state);
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
 
133
#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.