summaryrefslogtreecommitdiff
path: root/sim/m68hc11
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2000-11-24 20:53:35 +0000
committerStephane Carrez <stcarrez@nerim.fr>2000-11-24 20:53:35 +0000
commit3840b79c74356ab6c90eaeadea4969376bef5b91 (patch)
tree73174518581018b823c9daaa00945c14b334d090 /sim/m68hc11
parent92b16af5af9347d34735a1016fa54b6ee4e6eadd (diff)
downloadgdb-3840b79c74356ab6c90eaeadea4969376bef5b91.tar.gz
Fix device memory allocation in 68hc11 simulator
Diffstat (limited to 'sim/m68hc11')
-rw-r--r--sim/m68hc11/ChangeLog6
-rw-r--r--sim/m68hc11/dv-m68hc11eepr.c2
-rw-r--r--sim/m68hc11/dv-nvram.c6
3 files changed, 10 insertions, 4 deletions
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 61936522f06..2b77f0ab5a5 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,9 @@
+2000-11-24 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * dv-m68hc11eepr.c (attach_m68hc11eepr_regs): Use hw_malloc.
+ * dv-nvram.c (attach_nvram_regs): Use hw_free and hw_malloc
+ instead of free and malloc.
+
2000-09-11 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* Makefile.in: Was missing from initial patch.
diff --git a/sim/m68hc11/dv-m68hc11eepr.c b/sim/m68hc11/dv-m68hc11eepr.c
index df3b371bc29..d4aeb4833ad 100644
--- a/sim/m68hc11/dv-m68hc11eepr.c
+++ b/sim/m68hc11/dv-m68hc11eepr.c
@@ -218,7 +218,7 @@ attach_m68hc11eepr_regs (struct hw *me,
controller->attach_space = attach_space;
controller->base_address = attach_address;
- controller->eeprom = (char*) malloc (attach_size + 1);
+ controller->eeprom = (char*) hw_malloc (me, attach_size + 1);
controller->eeprom_min_cycles = 10000;
controller->size = attach_size + 1;
controller->mapped = 0;
diff --git a/sim/m68hc11/dv-nvram.c b/sim/m68hc11/dv-nvram.c
index 39bd6f24fb1..1a8a91a6804 100644
--- a/sim/m68hc11/dv-nvram.c
+++ b/sim/m68hc11/dv-nvram.c
@@ -187,7 +187,7 @@ attach_nvram_regs (struct hw *me, struct nvram *controller)
case NVRAM_SAVE_MODIFIED:
case NVRAM_SAVE_ALL:
- controller->data = (char*) malloc (attach_size);
+ controller->data = (char*) hw_malloc (me, attach_size);
if (controller->data == 0)
hw_abort (me, "Not enough memory, try to use the mode 'map'");
@@ -204,7 +204,7 @@ attach_nvram_regs (struct hw *me, struct nvram *controller)
if (result != attach_size)
{
oerrno = errno;
- free (controller->data);
+ hw_free (me, controller->data);
close (controller->fd);
errno = oerrno;
hw_abort (me, "Failed to save the ram content");
@@ -216,7 +216,7 @@ attach_nvram_regs (struct hw *me, struct nvram *controller)
if (result != attach_size)
{
oerrno = errno;
- free (controller->data);
+ hw_free (me, controller->data);
close (controller->fd);
errno = oerrno;
hw_abort (me, "Failed to load the ram content");