source: rtems/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c @ 9b64c2d5

4.104.114.84.95
Last change on this file since 9b64c2d5 was 0074691a, checked in by Joel Sherrill <joel.sherrill@…>, on 07/31/97 at 22:13:29

Merged very large and much appreciated patch from Chris Johns
<cjohns@…>. This patch includes the ods68302 bsp,
the RTEMS++ class library, and the rtems++ test.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*****************************************************************************/
2/*
3  $Id$
4 
5  Hooks for GDB
6
7 */
8/*****************************************************************************/
9
10
11#include <bsp.h>
12#include <m68302.h>
13#include <m68302scc.h>
14
15static int initialised = 0;
16
17void putDebugChar(char ch)
18{
19  if (!initialised)
20  {
21    scc_initialise(DEBUG_PORT, DEBUG_BAUD, 0);
22    initialised = 1;
23  }
24 
25  scc_out(DEBUG_PORT, ch);
26}
27
28char getDebugChar(void)
29{
30  if (!initialised)
31  {
32    scc_initialise(DEBUG_PORT, DEBUG_BAUD, 0);
33    initialised = 1;
34  }
35
36  while (!scc_status(DEBUG_PORT, 0));
37 
38  return scc_in(DEBUG_PORT); 
39}
40
41/*
42 * Need to create yet another jump table for gdb this time
43 */
44
45void (*exceptionHook)(unsigned int) = 0;
46
47typedef struct {
48  rtems_unsigned16 move_a7;            /* move #FORMAT_ID,%a7@- */
49  rtems_unsigned16 format_id;
50  rtems_unsigned16 jmp;                /* jmp  _ISR_Handlers */
51  rtems_unsigned32 isr_handler;
52} GDB_HANDLER_ENTRY;
53
54#if !defined(M68K_MOVE_A7)
55#define M68K_MOVE_A7 0x3F3C
56#endif
57
58#if !defined(M68K_JMP)
59#define M68K_JMP     0x4EF9
60#endif
61
62/* points to jsr-exception-table in targets wo/ VBR register */
63static GDB_HANDLER_ENTRY gdb_jump_table[256];
64
65void exceptionHandler(unsigned int vector, void *handler)
66{
67  rtems_unsigned32 *interrupt_table = 0;
68 
69  gdb_jump_table[vector].move_a7 = M68K_MOVE_A7;
70  gdb_jump_table[vector].format_id = vector;
71  gdb_jump_table[vector].jmp = M68K_JMP;
72  gdb_jump_table[vector].isr_handler = (rtems_unsigned32) handler;
73
74  interrupt_table[vector] = (rtems_unsigned32) &gdb_jump_table[vector];
75}
76
Note: See TracBrowser for help on using the repository browser.