150b0835df46586e0385988941a1f7b019854528
1 /* Simulator pseudo baseclass.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
5 This file is part of GDB, the GNU debugger.
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)
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.
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. */
21 /* This file is meant to be included by sim-basics.h. */
26 /* Global pointer to current state while sim_resume is running.
27 On a machine with lots of registers, it might be possible to reserve
28 one of them for current_state. However on a machine with few registers
29 current_state can't permanently live in one and indirecting through it
30 will be slower [in which case one can have sim_resume set globals from
31 current_state for faster access].
32 If CURRENT_STATE_REG is defined, it means current_state is living in
35 #ifdef CURRENT_STATE_REG
38 extern struct sim_state
*current_state
;
41 /* Simulator state pseudo base-class.
42 Each simulator is required to have a sim-main.h file that includes
43 sim-basics.h and defines struct sim_state to be:
46 struct sim_state_base base;
47 ... simulator specific members ...
51 struct sim_state_base
{
52 /* Marker for those wanting to do sanity checks. */
54 #define SIM_MAGIC_NUMBER 0x4242
55 #define STATE_MAGIC(sd) ((sd)->base.magic)
57 /* Simulator's argv[0]. */
59 #define STATE_MY_NAME(sd) ((sd)->base.my_name)
61 /* Who opened the simulator. */
62 SIM_OPEN_KIND open_kind
;
63 #define STATE_OPEN_KIND(sd) ((sd)->base.open_kind)
65 /* The host callbacks. */
66 struct host_callback_struct
*callback
;
67 #define STATE_CALLBACK(sd) ((sd)->base.callback)
69 #if 0 /* FIXME: Not ready yet. */
70 /* Stuff defined in sim-config.h. */
71 struct sim_config config
;
72 #define STATE_CONFIG(sd) ((sd)->base.config)
76 /* Functions for allocating/freeing a sim_state. */
77 SIM_DESC sim_state_alloc
PARAMS ((void));
78 void sim_state_free
PARAMS ((SIM_DESC
));
80 #endif /* SIM_BASE_H */
This page took 0.031425 seconds and 4 git commands to generate.