This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH]: Register a delete handler for 68HC11 core device node


Hi!

A delete handler is necessary to cleanup the address space of the 68HC11
simulator when hw_tree_delete() is called. Otherwise, re-creation of
a device tree fails because a previous mapping is already registered.

I've committed this patch to solve this problem.

	Stephane

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.
Index: dv-m68hc11.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/dv-m68hc11.c,v
retrieving revision 1.2
diff -p -r1.2 dv-m68hc11.c
*** dv-m68hc11.c	2000/08/11 18:44:59	1.2
--- dv-m68hc11.c	2000/11/26 20:51:14
*************** dv_m6811_detach_address_callback (struct
*** 173,179 ****
--- 173,192 ----
                     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,
  		     struct m68hc11cpu *controller)
*************** attach_m68hc11_regs (struct hw *me,
*** 203,209 ****
                       controller->attach_address,
                       controller->attach_size,
  		     me);
! 
  
    /* Get cpu frequency.  */
    sd = hw_system (me);
--- 216,222 ----
                       controller->attach_address,
                       controller->attach_size,
  		     me);
!   set_hw_delete (me, m68hc11_delete);
  
    /* Get cpu frequency.  */
    sd = hw_system (me);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]