Do top level sim-hw module for device tree.
[deliverable/binutils-gdb.git] / sim / common / sim-module.h
CommitLineData
76da6647
DE
1/* Module support.
2 Copyright (C) 1996, 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
4
5This file is part of GDB, the GNU debugger.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License along
18with this program; if not, write to the Free Software Foundation, Inc.,
1959 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21/* This file is intended to be included by sim-base.h. */
22
23#ifndef SIM_MODULES_H
24#define SIM_MODULES_H
25
26/* Modules are addons to the simulator that perform a specific function
27 (e.g. tracing, profiling, memory subsystem, etc.). Some modules are
28 builtin, and others are added at configure time. The intent is to
29 provide a uniform framework for all of the pieces that make up the
30 simulator.
31
32 TODO: Add facilities for saving/restoring state to/from a file. */
33
34/* Various function types. */
35typedef SIM_RC (MODULE_INSTALL_FN) (SIM_DESC);
36typedef SIM_RC (MODULE_INIT_FN) (SIM_DESC);
37typedef SIM_RC (MODULE_SUSPEND_FN) (SIM_DESC);
38typedef SIM_RC (MODULE_RESUME_FN) (SIM_DESC);
39typedef void (MODULE_UNINSTALL_FN) (SIM_DESC);
40
41/* Lists of installed handlers. */
42typedef struct module_init_list {
43 struct module_init_list *next;
44 MODULE_INIT_FN *fn;
45} MODULE_INIT_LIST;
46typedef struct module_resume_list {
47 struct module_resume_list *next;
48 MODULE_RESUME_FN *fn;
49} MODULE_RESUME_LIST;
50typedef struct module_suspend_list {
51 struct module_suspend_list *next;
52 MODULE_SUSPEND_FN *fn;
53} MODULE_SUSPEND_LIST;
54typedef struct module_uninstall_list {
55 struct module_uninstall_list *next;
56 MODULE_UNINSTALL_FN *fn;
57} MODULE_UNINSTALL_LIST;
58
59SIM_RC sim_module_install (SIM_DESC);
60void sim_module_uninstall (SIM_DESC);
61void sim_module_add_init_fn (SIM_DESC sd, MODULE_INIT_FN fn);
62void sim_module_add_resume_fn (SIM_DESC sd, MODULE_RESUME_FN fn);
63void sim_module_add_suspend_fn (SIM_DESC sd, MODULE_SUSPEND_FN fn);
64void sim_module_add_uninstall_fn (SIM_DESC sd, MODULE_UNINSTALL_FN fn);
65
66/* Initialize installed modules before argument processing.
67 Called by sim_open. */
68SIM_RC sim_pre_argv_init (SIM_DESC sd, const char *myname);
69/* Initialize installed modules after argument processing.
70 Called by sim_open. */
71SIM_RC sim_post_argv_init (SIM_DESC sd);
72/* Re-initialize the module. Called by sim_create_inferior. */
73SIM_RC sim_module_init (SIM_DESC sd);
74/* Suspend/resume modules. Called by sim_run or sim_resume */
75SIM_RC sim_module_suspend (SIM_DESC sd);
76SIM_RC sim_module_resume (SIM_DESC sd);
77
78#endif /* SIM_MODULES_H */
This page took 0.033656 seconds and 4 git commands to generate.