Register a delete handler for 68HC11 core device node
authorStephane Carrez <stcarrez@nerim.fr>
Sun, 26 Nov 2000 20:53:11 +0000 (20:53 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Sun, 26 Nov 2000 20:53:11 +0000 (20:53 +0000)
sim/m68hc11/ChangeLog
sim/m68hc11/dv-m68hc11.c

index 2b77f0ab5a501c6fbda5e731ba2c8c7b27e2a813..f477cb7c230d154678113febea65882156841823 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-22  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
+
+       * dv-m68hc11.c (attach_m68hc11_regs): Register a delete handler.
+       (m68hc11cpu_delete): Delete handler to detach the address space.
+
 2000-11-24  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * dv-m68hc11eepr.c (attach_m68hc11eepr_regs): Use hw_malloc.
index 1ce8c13416f08e61e4f189ad29855c57cceac4aa..38000472289570067234c7846fad042929028374 100644 (file)
@@ -173,6 +173,19 @@ dv_m6811_detach_address_callback (struct hw *me,
                    level, space, addr);
 }
 
+static void
+m68hc11_delete (struct hw* me)
+{
+  struct m68hc11cpu *controller;
+  
+  controller = hw_data (me);
+
+  hw_detach_address (me, M6811_IO_LEVEL,
+                    controller->attach_space,
+                    controller->attach_address,
+                    controller->attach_size, me);
+}
+
 
 static void
 attach_m68hc11_regs (struct hw *me,
@@ -203,7 +216,7 @@ attach_m68hc11_regs (struct hw *me,
                      controller->attach_address,
                      controller->attach_size,
                     me);
-
+  set_hw_delete (me, m68hc11_delete);
 
   /* Get cpu frequency.  */
   sd = hw_system (me);