diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2003-08-08 20:42:21 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2003-08-08 20:42:21 +0000 |
commit | 77342e5ecc0d04f03bd7d8e48f2a1ce3a7ddbdd8 (patch) | |
tree | 2a17473812e9d0a36162269be10a988307303eef /sim/m68hc11/dv-m68hc11.c | |
parent | 53b3cd2254173d81b9be29572950a336386f9947 (diff) | |
download | gdb-77342e5ecc0d04f03bd7d8e48f2a1ce3a7ddbdd8.zip gdb-77342e5ecc0d04f03bd7d8e48f2a1ce3a7ddbdd8.tar.gz gdb-77342e5ecc0d04f03bd7d8e48f2a1ce3a7ddbdd8.tar.bz2 |
* sim-main.h (phys_to_virt): Use memory bank parameters to translate
the physical address in virtual address.
(struct _sim_cpu): Add memory bank members.
* m68hc11_sim.c (cpu_initialize): Clear memory bank parameters.
* interp.c (sim_hw_configure): Create memory bank according to memory
bank parameters.
(sim_get_bank_parameters): New function to obtain memory bank config
from the symbol table.
(sim_prepare_for_program): Call it to obtain the memory bank parameters.
(sim_open): Call sim_prepare_for_program.
* dv-m68hc11.c (m68hc11cpu_io_write_buffer): Use memory bank parameters
to check if address is within bank window.
(m68hc11cpu_io_read_buffer): Likewise.
(attach_m68hc11_regs): Map the memory bank according to memory bank
parameters.
Diffstat (limited to 'sim/m68hc11/dv-m68hc11.c')
-rw-r--r-- | sim/m68hc11/dv-m68hc11.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c index 669a045..cad100a 100644 --- a/sim/m68hc11/dv-m68hc11.c +++ b/sim/m68hc11/dv-m68hc11.c @@ -1,5 +1,5 @@ /* dv-m68hc11.c -- CPU 68HC11&68HC12 as a device. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Stephane Carrez (stcarrez@nerim.fr) (From a driver model Contributed by Cygnus Solutions.) @@ -324,8 +324,8 @@ attach_m68hc11_regs (struct hw *me, if (hw_find_property (me, "use_bank") != NULL) hw_attach_address (hw_parent (me), 0, exec_map, - 0x08000, - 0x04000, + cpu->bank_start, + cpu->bank_end - cpu->bank_start, me); cpu_mode = "expanded"; @@ -843,7 +843,7 @@ m68hc11cpu_io_read_buffer (struct hw *me, sd = hw_system (me); cpu = STATE_CPU (sd, 0); - if (base >= 0x8000 && base < 0xc000) + if (base >= cpu->bank_start && base < cpu->bank_end) { address_word virt_addr = phys_to_virt (cpu, base); if (virt_addr != base) @@ -864,7 +864,7 @@ m68hc11cpu_io_read_buffer (struct hw *me, break; memcpy (dest, &cpu->ios[base], 1); - dest++; + dest = (char*) dest + 1; base++; byte++; nr_bytes--; @@ -1091,7 +1091,7 @@ m68hc11cpu_io_write_buffer (struct hw *me, sd = hw_system (me); cpu = STATE_CPU (sd, 0); - if (base >= 0x8000 && base < 0xc000) + if (base >= cpu->bank_start && base < cpu->bank_end) { address_word virt_addr = phys_to_virt (cpu, base); if (virt_addr != base) @@ -1113,7 +1113,7 @@ m68hc11cpu_io_write_buffer (struct hw *me, val = *((uint8*) source); m68hc11cpu_io_write (me, cpu, base, val); - source++; + source = (char*) source + 1; base++; byte++; nr_bytes--; |