summaryrefslogtreecommitdiffstats
path: root/sim/m68hc11/dv-nvram.c
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
commit6e73e7ed648bdb2fdd4d36d75a4a824a9adc39a6 (patch)
treec2c7fcd66d0dc3d8cdfb93e5b905d0aefa8adefb /sim/m68hc11/dv-nvram.c
parent3b851bce1db6dd84666a59d7c0134cb502114557 (diff)
downloadppe42-binutils-6e73e7ed648bdb2fdd4d36d75a4a824a9adc39a6.tar.gz
ppe42-binutils-6e73e7ed648bdb2fdd4d36d75a4a824a9adc39a6.zip
Fix device memory allocation in 68hc11 simulator
Diffstat (limited to 'sim/m68hc11/dv-nvram.c')
-rw-r--r--sim/m68hc11/dv-nvram.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sim/m68hc11/dv-nvram.c b/sim/m68hc11/dv-nvram.c
index 39bd6f24fb..1a8a91a680 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");
OpenPOWER on IntegriCloud