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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [i386/] [pc/] [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
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
9
// -------------------------------------------                              
10
// This file is part of eCos, the Embedded Configurable Operating System.   
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under    
14
// the terms of the GNU General Public License as published by the Free     
15
// Software Foundation; either version 2 or (at your option) any later      
16
// version.                                                                 
17
//
18
// eCos is distributed in the hope that it will be useful, but WITHOUT      
19
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
20
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
21
// for more details.                                                        
22
//
23
// You should have received a copy of the GNU General Public License        
24
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
25
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
26
//
27
// As a special exception, if other files instantiate templates or use      
28
// macros or inline functions from this file, or you compile this file      
29
// and link it with other works to produce a work based on this file,       
30
// this file does not by itself cause the resulting work to be covered by   
31
// the GNU General Public License. However the source code for this file    
32
// must still be made available in accordance with section (3) of the GNU   
33
// General Public License v2.                                               
34
//
35
// This exception does not invalidate any other reasons why a work based    
36
// on this file might be covered by the GNU General Public License.         
37
// -------------------------------------------                              
38
// ####ECOSGPLCOPYRIGHTEND####                                              
39
//=============================================================================
40
//#####DESCRIPTIONBEGIN####
41
//
42
// Author(s):   proven
43
// Contributors:proven
44
// Date:        1998-10-05
45
// Purpose:     HAL diagnostic output
46
// Description: Implementations of HAL diagnostic output support.
47
//
48
//####DESCRIPTIONEND####
49
//
50
//=============================================================================
51
 
52
#include <pkgconf/hal.h>
53
 
54
#include <cyg/infra/cyg_type.h>         // base types
55
 
56
#include <cyg/hal/hal_diag.h>
57
 
58
#include <cyg/hal/plf_misc.h>
59
 
60
//-----------------------------------------------------------------------------
61
// New Hal_Diag init to comply with the eCos/ROM Calling Interface.
62
 
63
#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
64
 
65
#include <cyg/hal/hal_arch.h>           // basic machine info
66
#include <cyg/hal/hal_intr.h>           // interrupt macros
67
#include <cyg/hal/hal_io.h>             // IO macros
68
#include <cyg/hal/drv_api.h>
69
#include <cyg/hal/hal_if.h>             // interface API
70
#include <cyg/hal/hal_misc.h>           // Helper functions
71
 
72
#include <cyg/hal/pcmb_serial.h>
73
 
74
//=============================================================================
75
 
76
#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) \
77
    || defined(CYGPRI_HAL_IMPLEMENTS_IF_SERVICES)
78
 
79
channel_data_t pc_ser_channels[CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS];
80
 
81
void
82
cyg_hal_plf_comms_init(void)
83
{
84
    static int initialized = 0;
85
    int num_serial;
86
 
87
    if (initialized)
88
        return;
89
 
90
    initialized = 1;
91
 
92
    num_serial = CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS;
93
#ifdef CYGSEM_HAL_I386_PC_DIAG_SCREEN
94
    --num_serial;
95
#endif
96
    if (num_serial > 0) {
97
        // COM1
98
        pc_ser_channels[0].base = 0x3F8;
99
        pc_ser_channels[0].msec_timeout = 1000;
100
        pc_ser_channels[0].isr_vector = 36;
101
    }
102
    if (num_serial > 1) {
103
        // COM2
104
        pc_ser_channels[1].base = 0x2F8;
105
        pc_ser_channels[1].msec_timeout = 1000;
106
        pc_ser_channels[1].isr_vector = 35;
107
    }
108
 
109
    cyg_hal_plf_serial_init();
110
 
111
#ifdef CYGSEM_HAL_I386_PC_DIAG_SCREEN
112
 
113
    pc_ser_channels[num_serial].base = 0x060;
114
    pc_ser_channels[num_serial].msec_timeout = 1000;
115
    pc_ser_channels[num_serial].isr_vector = 33;
116
 
117
    cyg_hal_plf_screen_init();
118
 
119
#endif    
120
}
121
 
122
//=============================================================================
123
 
124
#endif  //defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
125
        //  || defined(CYGPRI_HAL_IMPLEMENTS_IF_SERVICES)
126
 
127
#endif
128
 
129
//=============================================================================
130
 
131
#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
132
 
133
// TODO: add stand-alone code
134
 
135
#endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
136
 
137
//-----------------------------------------------------------------------------
138
// End of hal_diag.c
139
 

powered by: WebSVN 2.1.0

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