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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [cygmon/] [v2_0/] [misc/] [bsp/] [common/] [bsp_if.c] - Blame information for rev 361

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//==========================================================================
2
//
3
//      bsp_if.c
4
//
5
//      Miscellaneous BSP Interfaces.
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 Red Hat, 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 version.
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20
// for more details.
21
//
22
// You should have received a copy of the GNU General Public License along
23
// with eCos; if not, write to the Free Software Foundation, Inc.,
24
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25
//
26
// As a special exception, if other files instantiate templates or use macros
27
// or inline functions from this file, or you compile this file and link it
28
// with other works to produce a work based on this file, this file does not
29
// by itself cause the resulting work to be covered by the GNU General Public
30
// License. However the source code for this file must still be made available
31
// in accordance with section (3) of the GNU General Public License.
32
//
33
// This exception does not invalidate any other reasons why a work based on
34
// this file might be covered by the GNU General Public License.
35
//
36
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37
// at http://sources.redhat.com/ecos/ecos-license/
38
// -------------------------------------------
39
//####ECOSGPLCOPYRIGHTEND####
40
//==========================================================================
41
//#####DESCRIPTIONBEGIN####
42
//
43
// Author(s):    
44
// Contributors: gthomas
45
// Date:         1999-10-20
46
// Purpose:      Miscellaneous BSP Interfaces.
47
// Description:  
48
//               
49
//
50
//####DESCRIPTIONEND####
51
//
52
//=========================================================================
53
 
54
 
55
#include <bsp/bsp.h>
56
#include "bsp_if.h"
57
 
58
/*
59
 * Install a debug handler.
60
 * Returns old handler being replaced.
61
 */
62
bsp_handler_t
63
bsp_install_dbg_handler(bsp_handler_t new_handler)
64
{
65
    bsp_handler_t old_handler;
66
 
67
    old_handler = *bsp_shared_data->__dbg_vector;
68
    *bsp_shared_data->__dbg_vector = new_handler;
69
 
70
    return old_handler;
71
}
72
 
73
/*
74
 * Sometimes it is desireable to call the debug handler directly. This routine
75
 * accomplishes that. It is the responsibility of the caller to insure that
76
 * interrupts are disabled before calling this routine.
77
 */
78
void
79
bsp_invoke_dbg_handler(int exc_nr, void *regs)
80
{
81
    (*bsp_shared_data->__dbg_vector)(exc_nr, regs);
82
}
83
 
84
/*
85
 * Install a 'kill' handler.
86
 * Returns old handler being replaced.
87
 */
88
bsp_handler_t
89
bsp_install_kill_handler(bsp_handler_t new_handler)
90
{
91
    bsp_handler_t old_handler;
92
 
93
    old_handler = bsp_shared_data->__kill_vector;
94
    bsp_shared_data->__kill_vector = new_handler;
95
 
96
    return old_handler;
97
}
98
 
99
 
100
void *
101
bsp_cpu_data(void)
102
{
103
  return bsp_shared_data->__cpu_data;
104
}
105
 
106
 
107
void *
108
bsp_board_data(void)
109
{
110
    return bsp_shared_data->__board_data;
111
}
112
 
113
 
114
int
115
bsp_sysinfo(enum bsp_info_id id, ...)
116
{
117
    int     retval;
118
    va_list ap;
119
 
120
    va_start (ap, id);
121
    retval = bsp_shared_data->__sysinfo(id, ap);
122
    va_end(ap);
123
    return retval;
124
}
125
 
126
int
127
bsp_set_debug_comm(int id)
128
{
129
    return bsp_shared_data->__set_debug_comm(id);
130
}
131
 
132
int
133
bsp_set_console_comm(int id)
134
{
135
    return bsp_shared_data->__set_console_comm(id);
136
}
137
 
138
int
139
bsp_set_serial_baud(int id, int baud)
140
{
141
    return bsp_shared_data->__set_serial_baud(id, baud);
142
}
143
 
144
 
145
#if !defined(NDEBUG)
146
 
147
void _bsp_assert(const char *file, const int line, const char *condition)
148
{
149
    bsp_printf("Assertion \"%s\" failed\n", condition);
150
    bsp_printf("File \"%s\"\n", file);
151
    bsp_printf("Line %d\n", line);
152
#if defined(PORT_TOGGLE_DEBUG)
153
    PORT_TOGGLE_DEBUG();
154
#else
155
    while(1) ;
156
#endif /* defined(PORT_TOGGLE_DEBUG) */
157
}
158
 
159
#endif /* !defined(NDEBUG) */
160
 

powered by: WebSVN 2.1.0

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