xref: /netbsd-src/external/gpl3/gdb/dist/sim/common/hw-base.h (revision 88241920d21b339bf319c0e979ffda80c49a2936)
14e98e3e1Schristos /* The common simulator framework for GDB, the GNU Debugger.
24e98e3e1Schristos 
3*88241920Schristos    Copyright 2002-2024 Free Software Foundation, Inc.
44e98e3e1Schristos 
54e98e3e1Schristos    Contributed by Andrew Cagney and Red Hat.
64e98e3e1Schristos 
74e98e3e1Schristos    This file is part of GDB.
84e98e3e1Schristos 
94e98e3e1Schristos    This program is free software; you can redistribute it and/or modify
104e98e3e1Schristos    it under the terms of the GNU General Public License as published by
114e98e3e1Schristos    the Free Software Foundation; either version 3 of the License, or
124e98e3e1Schristos    (at your option) any later version.
134e98e3e1Schristos 
144e98e3e1Schristos    This program is distributed in the hope that it will be useful,
154e98e3e1Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
164e98e3e1Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
174e98e3e1Schristos    GNU General Public License for more details.
184e98e3e1Schristos 
194e98e3e1Schristos    You should have received a copy of the GNU General Public License
204e98e3e1Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
214e98e3e1Schristos 
224e98e3e1Schristos 
234e98e3e1Schristos #ifndef HW_BASE
244e98e3e1Schristos #define HW_BASE
254e98e3e1Schristos 
264e98e3e1Schristos /* Create a primative device */
274e98e3e1Schristos 
284e98e3e1Schristos struct hw *hw_create
294e98e3e1Schristos (struct sim_state *sd,
304e98e3e1Schristos  struct hw *parent,
314e98e3e1Schristos  const char *family,
324e98e3e1Schristos  const char *name,
334e98e3e1Schristos  const char *unit,
344e98e3e1Schristos  const char *args);
354e98e3e1Schristos 
364e98e3e1Schristos 
374e98e3e1Schristos /* Complete the creation of that device (finish overrides methods
384e98e3e1Schristos    using the set_hw_* operations below) */
394e98e3e1Schristos 
404e98e3e1Schristos void hw_finish
414e98e3e1Schristos (struct hw *me);
424e98e3e1Schristos 
434e98e3e1Schristos int hw_finished_p
444e98e3e1Schristos (struct hw *me);
454e98e3e1Schristos 
464e98e3e1Schristos 
474e98e3e1Schristos /* Delete the entire device */
484e98e3e1Schristos 
494e98e3e1Schristos void hw_delete
504e98e3e1Schristos (struct hw *me);
514e98e3e1Schristos 
524e98e3e1Schristos 
534e98e3e1Schristos /* Override device methods */
544e98e3e1Schristos 
554e98e3e1Schristos typedef void (hw_delete_callback)
564e98e3e1Schristos      (struct hw *me);
574e98e3e1Schristos 
584e98e3e1Schristos extern void set_hw_delete(struct hw* hw, hw_delete_callback method);
594e98e3e1Schristos 
604e98e3e1Schristos 
614e98e3e1Schristos /* ALLOC */
624e98e3e1Schristos 
634e98e3e1Schristos extern void create_hw_alloc_data
644e98e3e1Schristos (struct hw *hw);
654e98e3e1Schristos extern void delete_hw_alloc_data
664e98e3e1Schristos (struct hw *hw);
674e98e3e1Schristos 
684e98e3e1Schristos 
694e98e3e1Schristos /* PORTS */
704e98e3e1Schristos 
714e98e3e1Schristos extern void create_hw_port_data
724e98e3e1Schristos (struct hw *hw);
734e98e3e1Schristos extern void delete_hw_port_data
744e98e3e1Schristos (struct hw *hw);
754e98e3e1Schristos 
764e98e3e1Schristos 
774e98e3e1Schristos /* PROPERTIES */
784e98e3e1Schristos 
794e98e3e1Schristos extern void create_hw_property_data
804e98e3e1Schristos (struct hw *hw);
814e98e3e1Schristos extern void delete_hw_property_data
824e98e3e1Schristos (struct hw *hw);
834e98e3e1Schristos 
844e98e3e1Schristos 
854e98e3e1Schristos /* EVENTS */
864e98e3e1Schristos 
874e98e3e1Schristos extern void create_hw_event_data
884e98e3e1Schristos (struct hw *hw);
894e98e3e1Schristos extern void delete_hw_event_data
904e98e3e1Schristos (struct hw *hw);
914e98e3e1Schristos 
924e98e3e1Schristos 
934e98e3e1Schristos /* HANDLES */
944e98e3e1Schristos 
954e98e3e1Schristos extern void create_hw_handle_data
964e98e3e1Schristos (struct hw *hw);
974e98e3e1Schristos extern void delete_hw_handle_data
984e98e3e1Schristos (struct hw *hw);
994e98e3e1Schristos 
1004e98e3e1Schristos 
1014e98e3e1Schristos /* INSTANCES */
1024e98e3e1Schristos 
1034e98e3e1Schristos extern void create_hw_instance_data
1044e98e3e1Schristos (struct hw *hw);
1054e98e3e1Schristos extern void delete_hw_instance_data
1064e98e3e1Schristos (struct hw *hw);
1074e98e3e1Schristos 
1084e98e3e1Schristos 
1094e98e3e1Schristos #endif
110