-/* This file is part of the program psim.
+/* The common simulator framework for GDB, the GNU Debugger.
- Copyright (C) 1994-1996, 1998, Andrew Cagney <cagney@highland.com.au>
+ Copyright 2002 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ Contributed by Andrew Cagney and Red Hat.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- */
+ This file is part of GDB.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-#include "sim-main.h"
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+#include "hw-main.h"
#include "hw-base.h"
struct hw_base_data {
int finished_p;
- const struct hw_device_descriptor *descriptor;
+ const struct hw_descriptor *descriptor;
hw_delete_callback *to_delete;
};
/* locate a descriptor */
{
- const struct hw_device_descriptor **table;
+ const struct hw_descriptor **table;
for (table = hw_descriptors;
*table != NULL;
table++)
{
- const struct hw_device_descriptor *entry;
+ const struct hw_descriptor *entry;
for (entry = *table;
entry->family != NULL;
entry++)
create_hw_property_data (hw);
create_hw_port_data (hw);
create_hw_event_data (hw);
+ create_hw_handle_data (hw);
+ create_hw_instance_data (hw);
return hw;
}
/* give the object a chance to tidy up */
me->base_of_hw->to_delete (me);
+ delete_hw_instance_data (me);
+ delete_hw_handle_data (me);
delete_hw_event_data (me);
delete_hw_port_data (me);
delete_hw_property_data (me);
delete_hw_alloc_data (me);
/* finally */
- zfree (me->base_of_hw);
zfree (me);
}
+void
+set_hw_delete (struct hw *hw, hw_delete_callback method)
+{
+ hw->base_of_hw->to_delete = method;
+}
+
/* Go through the devices various reg properties for those that
specify attach addresses */