]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/common/sim-module.h
Fix comment.
[thirdparty/binutils-gdb.git] / sim / common / sim-module.h
1 /* Module support.
2 Copyright (C) 1996, 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
4
5 This file is part of GDB, the GNU debugger.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 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. */
35 typedef SIM_RC (MODULE_INSTALL_FN) (SIM_DESC);
36 typedef SIM_RC (MODULE_INIT_FN) (SIM_DESC);
37 typedef SIM_RC (MODULE_SUSPEND_FN) (SIM_DESC);
38 typedef SIM_RC (MODULE_RESUME_FN) (SIM_DESC);
39 typedef void (MODULE_UNINSTALL_FN) (SIM_DESC);
40
41 /* Lists of installed handlers. */
42 typedef struct module_init_list {
43 struct module_init_list *next;
44 MODULE_INIT_FN *fn;
45 } MODULE_INIT_LIST;
46 typedef struct module_resume_list {
47 struct module_resume_list *next;
48 MODULE_RESUME_FN *fn;
49 } MODULE_RESUME_LIST;
50 typedef struct module_suspend_list {
51 struct module_suspend_list *next;
52 MODULE_SUSPEND_FN *fn;
53 } MODULE_SUSPEND_LIST;
54 typedef struct module_uninstall_list {
55 struct module_uninstall_list *next;
56 MODULE_UNINSTALL_FN *fn;
57 } MODULE_UNINSTALL_LIST;
58
59 SIM_RC sim_module_install (SIM_DESC);
60 void sim_module_uninstall (SIM_DESC);
61 void sim_module_add_init_fn (SIM_DESC sd, MODULE_INIT_FN fn);
62 void sim_module_add_resume_fn (SIM_DESC sd, MODULE_RESUME_FN fn);
63 void sim_module_add_suspend_fn (SIM_DESC sd, MODULE_SUSPEND_FN fn);
64 void 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. */
68 SIM_RC sim_pre_argv_init (SIM_DESC sd, const char *myname);
69 /* Initialize installed modules after argument processing.
70 Called by sim_open. */
71 SIM_RC sim_post_argv_init (SIM_DESC sd);
72 /* Re-initialize the module. Called by sim_create_inferior. */
73 SIM_RC sim_module_init (SIM_DESC sd);
74 /* Suspend/resume modules. Called by sim_run or sim_resume */
75 SIM_RC sim_module_suspend (SIM_DESC sd);
76 SIM_RC sim_module_resume (SIM_DESC sd);
77
78 #endif /* SIM_MODULES_H */