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

4.104.114.84.95
Last change on this file since a4318d0c was a4318d0c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/31/04 at 04:39:50

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • clock/ckinit.c, include/bare.h, include/bsp.h, include/crc.h, startup/bspstart.c, startup/cpuboot.c, startup/crc.c, startup/gdb-hooks.c, startup/m68302scc.c, timer/timer.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 1.5 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  uint16_t         move_a7;            /* move #FORMAT_ID,%a7@- */
49  uint16_t         format_id;
50  uint16_t         jmp;                /* jmp  _ISR_Handlers */
51  uint32_t         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  uint32_t         *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 = (uint32_t) handler;
73
74  interrupt_table[vector] = (uint32_t) &gdb_jump_table[vector];
75}
76
Note: See TracBrowser for help on using the repository browser.