This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[Patch 5/7]: 68HC11 port of gdb (sim-overlap address maps)
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [Patch 5/7]: 68HC11 port of gdb (sim-overlap address maps)
- From: Stephane Carrez <Stephane dot Carrez at free dot fr>
- Date: Mon, 26 Jun 2000 00:40:36 +0200
Hi!
The following patch adds the support to overlap some address spaces.
I need this for 68hc11 because the IO is mapped over the normal memory.
The internal RAM is mapped in the same way. Both may be moved at any
4K boundary. The EEPROM can be unmapped, showing up what is underneath it.
Each device has an overlap flag that tells whether overlapping is
allowed or not. The default is to disable that. This is the current
behavior.
When overlapping is allowed, we just record the mapping rather than
rejecting it.
Stephane
The ChangeLog is for gdb/sim/common
2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* sim-core.c (sim_core_map_attach): Don't raise an error if
the device allows overlapping of address maps.
* hw-device.h (struct hw): Added the boolean 'overlap_mode_hw'
to enable/disable overlapping of address maps. Overlapping is
necessary for 68Hc11. The default is to disable overlapping
(previous behavior).
* dv-core.c (dv_core_attach_address_callback): Don't abort if
the address space refers to the IO memory.
diff -Nrup --exclude-from=gdb-exclude.lst /src/gnu/cygnus/gdb/sim/common/dv-core.c gdb/sim/common/dv-core.c
--- /src/gnu/cygnus/gdb/sim/common/dv-core.c Fri Apr 16 03:34:56 1999
+++ gdb/sim/common/dv-core.c Mon Feb 21 09:00:23 2000
@@ -57,8 +57,6 @@ dv_core_attach_address_callback (struct
/* NOTE: At preset the space is assumed to be zero. Perhaphs the
space should be mapped onto something for instance: space0 -
unified memory; space1 - IO memory; ... */
- if (space != 0)
- hw_abort (me, "Hey! Unknown space %d", space);
sim_core_attach (hw_system (me),
NULL, /*cpu*/
level,
diff -Nrup --exclude-from=gdb-exclude.lst /src/gnu/cygnus/gdb/sim/common/hw-device.h gdb/sim/common/hw-device.h
--- /src/gnu/cygnus/gdb/sim/common/hw-device.h Fri Apr 16 03:34:57 1999
+++ gdb/sim/common/hw-device.h Mon Feb 21 09:00:23 2000
@@ -529,6 +529,7 @@ struct hw {
struct hw_handle_data *handles_of_hw;
struct hw_instance_data *instances_of_hw;
+ int overlap_mode_hw;
};
diff -Nrup --exclude-from=gdb-exclude.lst /src/gnu/cygnus/gdb/sim/common/sim-core.c gdb/sim/common/sim-core.c
--- /src/gnu/cygnus/gdb/sim/common/sim-core.c Mon Apr 26 20:31:37 1999
+++ gdb/sim/common/sim-core.c Mon Feb 21 09:00:23 2000
@@ -27,6 +27,7 @@
#if (WITH_HW)
#include "sim-hw.h"
+#include "hw-device.h"
#endif
/* "core" module install handler.
@@ -234,6 +235,7 @@ sim_core_map_attach (SIM_DESC sd,
(long) next_mapping->nr_bytes);
#endif
#if WITH_HW
+ if (client->overlap_mode_hw == 0)
sim_hw_abort (sd, client, "memory map %d:0x%lx..0x%lx (%ld bytes) overlaps %d:0x%lx..0x%lx (%ld bytes)",
space,
(long) addr,
@@ -243,6 +245,7 @@ sim_core_map_attach (SIM_DESC sd,
(long) next_mapping->base,
(long) next_mapping->bound,
(long) next_mapping->nr_bytes);
+ if (client->overlap_mode_hw == 0)
#endif
sim_io_error (sd, "memory map %d:0x%lx..0x%lx (%ld bytes) overlaps %d:0x%lx..0x%lx (%ld bytes)",
space,