annotate packages/hal/m68k/arch/current/src/m68k_stub.c @ 2729:74dbf4c3f2e1 after-copyright-change-20090129

Update all copyright banners to reflect FSF ownership; fix and improve licence text.
author jlarmour
date Thu, 29 Jan 2009 17:47:46 +0000
parents c8ac62402c90
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
1 //==========================================================================
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
2 //
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
3 // m68k_stub.c
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
4 //
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
5 // M68K gdb support
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
6 //
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
7 //==========================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
8 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
9 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
11 // Copyright (C) 2003, 2008 Free Software Foundation, Inc.
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
12 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
13 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
14 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
15 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
16 // version.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
17 //
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
18 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
21 // for more details.
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
22 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
23 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
24 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
26 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
27 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
28 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
29 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
30 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
31 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
32 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
33 // General Public License v2.
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
34 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
35 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
36 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
37 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2649
diff changeset
38 // ####ECOSGPLCOPYRIGHTEND####
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
39 //==========================================================================
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
40 //###DESCRIPTIONBEGIN####
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
41 //
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
42 // Author(s): bartv
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
43 // Date: 2003-06-04
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
44 //
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
45 //###DESCRIPTIONEND####
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
46 //========================================================================
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
47
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
48 #include <pkgconf/hal.h>
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
49 #include <pkgconf/hal_m68k.h>
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
50
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
51 #include <cyg/infra/cyg_type.h>
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
52 #include <cyg/infra/cyg_ass.h>
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
53 #include <cyg/infra/diag.h>
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
54 #include <cyg/hal/hal_arch.h>
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
55 #include <cyg/hal/hal_intr.h>
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
56 #include <cyg/hal/hal_if.h>
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
57 #include <cyg/hal/hal_stub.h>
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
58
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
59 // Translate between the eCos save state and what is expected by the gdb
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
60 // stubs. d0-d7/a0-a6 are in the right place already. SR/PS and the program
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
61 // counter need to come from variant-specific macros. The stack pointer
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
62 // can be determined from the saved context.
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
63 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
64 hal_get_gdb_registers(CYG_ADDRWORD* gdb_regs, HAL_SavedRegisters* ecos_regs)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
65 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
66 int sr;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
67 int pc;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
68 int i;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
69 for (i = 0; i < 15; i++) {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
70 gdb_regs[i] = ecos_regs->da[i];
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
71 }
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
72 gdb_regs[15] = (CYG_ADDRWORD) &(ecos_regs[1]);
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
73 HAL_CONTEXT_PCSR_GET_SR(ecos_regs, sr);
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
74 HAL_CONTEXT_PCSR_GET_PC(ecos_regs, pc);
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
75 gdb_regs[16] = sr;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
76 gdb_regs[17] = pc;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
77 }
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
78
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
79 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
80 hal_set_gdb_registers(HAL_SavedRegisters* ecos_regs, CYG_ADDRWORD* gdb_regs)
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
81 {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
82 int i;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
83 for (i = 0; i < 15; i++) {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
84 ecos_regs->da[i] = gdb_regs[i];
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
85 }
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
86 if (gdb_regs[15] != (CYG_ADDRWORD) &(ecos_regs[1])) {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
87 CYG_FAIL("gdb has requested a thread context switch - not supported,");
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
88 }
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
89 HAL_CONTEXT_PCSR_SET_SR(ecos_regs, gdb_regs[16]);
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
90 HAL_CONTEXT_PCSR_SET_PC(ecos_regs, gdb_regs[17]);
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
91 }
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
92
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
93 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
94
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
95 externC int
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
96 __computeSignal(unsigned int trap_number)
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
97 {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
98 switch(trap_number) {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
99 case CYGNUM_HAL_EXCEPTION_DATA_ACCESS:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
100 return SIGBUS;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
101 case CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
102 case CYGNUM_HAL_EXCEPTION_SYSTEM_ERROR:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
103 return SIGSEGV;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
104 case CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
105 return SIGILL;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
106 case CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
107 return SIGFPE;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
108 case CYGNUM_HAL_EXCEPTION_TRACE:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
109 case CYGNUM_HAL_VECTOR_TRAP0 ... CYGNUM_HAL_VECTOR_TRAP15:
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
110 default:
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
111 return SIGTRAP;
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
112 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
113 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
114
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
115 externC int
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
116 __get_trap_number(void)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
117 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
118 int result = CYGNUM_HAL_EXCEPTION_SYSTEM_ERROR;
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
119 if ((HAL_SavedRegisters*)0 != _hal_registers) {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
120 HAL_CONTEXT_PCSR_GET_EXCEPTION(_hal_registers, result);
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
121 }
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
122 return result;
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
123 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
124
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
125 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
126 set_pc(target_register_t pc)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
127 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
128 _registers[PC] = pc;
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
129 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
130
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
131 // Single-stepping just involves setting the trace bit in the status register
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
132 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
133 __single_step(void)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
134 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
135 _registers[PS] |= HAL_M68K_SR_T;
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
136 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
137
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
138 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
139 __clear_single_step(void)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
140 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
141 _registers[PS] &= ~HAL_M68K_SR_T;
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
142 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
143
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
144 // This breakpoint support is (probably) not needed because
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
145 // single-stepping is supported instead.
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
146 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
147 __install_breakpoints(void)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
148 {
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
149 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
150
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
151 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
152 __clear_breakpoints(void)
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
153 {
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
154 }
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
155
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
156 externC int
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
157 __is_breakpoint_function(void)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
158 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
159 return _registers[PC] == (target_register_t)&_breakinst;
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
160 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
161
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
162 // The 68K has variable length instructions so skipping an instruction
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
163 // is messy. However __skipinst() is only used for a breakpoint
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
164 // instruction or for a trap, and these are always 2 bytes.
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
165 externC void
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
166 __skipinst(void)
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
167 {
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
168 _registers[PC] += 2;
211
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
169 }
6eb55882e01c Merge from eCos master repository on 2002-05-29-16:32:18-BST
jlarmour
parents:
diff changeset
170
2649
c8ac62402c90 Contribute eCosCentric's M68K architectural HAL, replacing the old
bartv
parents: 211
diff changeset
171 #endif