1 //==========================================================================
5 // Miscellaneous BSP Interfaces.
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.
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.
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
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.
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.
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.
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####
44 // Contributors: gthomas
46 // Purpose: Miscellaneous BSP Interfaces.
50 //####DESCRIPTIONEND####
52 //=========================================================================
59 * Install a debug handler.
60 * Returns old handler being replaced.
63 bsp_install_dbg_handler(bsp_handler_t new_handler)
65 bsp_handler_t old_handler;
67 old_handler = *bsp_shared_data->__dbg_vector;
68 *bsp_shared_data->__dbg_vector = new_handler;
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.
79 bsp_invoke_dbg_handler(int exc_nr, void *regs)
81 (*bsp_shared_data->__dbg_vector)(exc_nr, regs);
85 * Install a 'kill' handler.
86 * Returns old handler being replaced.
89 bsp_install_kill_handler(bsp_handler_t new_handler)
91 bsp_handler_t old_handler;
93 old_handler = bsp_shared_data->__kill_vector;
94 bsp_shared_data->__kill_vector = new_handler;
103 return bsp_shared_data->__cpu_data;
110 return bsp_shared_data->__board_data;
115 bsp_sysinfo(enum bsp_info_id id, ...)
121 retval = bsp_shared_data->__sysinfo(id, ap);
127 bsp_set_debug_comm(int id)
129 return bsp_shared_data->__set_debug_comm(id);
133 bsp_set_console_comm(int id)
135 return bsp_shared_data->__set_console_comm(id);
139 bsp_set_serial_baud(int id, int baud)
141 return bsp_shared_data->__set_serial_baud(id, baud);
147 void _bsp_assert(const char *file, const int line, const char *condition)
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)
156 #endif /* defined(PORT_TOGGLE_DEBUG) */
159 #endif /* !defined(NDEBUG) */