aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-base.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-09-01 03:26:31 +0000
committerAndrew Cagney <cagney@redhat.com>1997-09-01 03:26:31 +0000
commit4b2a6aed8413d6e7d7b25d918896ae637266d9d5 (patch)
treefc0f49b0104f94778be3465dc74f0f206afef7aa /sim/common/sim-base.h
parent9f3f3525396695352bffc5f9cda3ae542e3b83f7 (diff)
downloadgdb-4b2a6aed8413d6e7d7b25d918896ae637266d9d5.zip
gdb-4b2a6aed8413d6e7d7b25d918896ae637266d9d5.tar.gz
gdb-4b2a6aed8413d6e7d7b25d918896ae637266d9d5.tar.bz2
Use sim_state_alloc to create common sim object.
Diffstat (limited to 'sim/common/sim-base.h')
-rw-r--r--sim/common/sim-base.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index b21c397..12e1a25 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -21,25 +21,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/* Simulator state pseudo baseclass.
- Each simulator is required to have a sim-main.h file that includes
- sim-basics.h, defines the base type sim_cia (the data type that
- contains the complete current instruction address information), and
- then sim-base.h:
+ Each simulator is required to have the file ``sim-main.h''. That
+ file includes ``sim-basics.h'', defines the base type ``sim_cia''
+ (the data type that contains complete current instruction address
+ information), include ``sim-base.h'':
#include "sim-basics.h"
typedef address_word sim_cia;
#include "sim-base.h"
- and defines two key simulator structures. Firstly, struct
- _sim_cpu:
+ finally, two data types ``struct _sim_cpu' and ``struct sim_state'
+ are defined:
struct _sim_cpu {
... simulator specific members ...
sim_cpu_base base;
};
- and secondly, struct sim_state (which uses the sim_cpu structure):
-
struct sim_state {
sim_cpu cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
@@ -64,6 +62,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef NULL_CIA
#define NULL_CIA ((sim_cia) 0)
#endif
+#ifndef INVALID_INSTRUCTION_ADDRESS
+#define INVALID_INSTRUCTION_ADDRESS ((address_word)0 - 1)
+#endif
typedef struct _sim_cpu sim_cpu;
#include "sim-module.h"
@@ -258,7 +259,7 @@ typedef struct {
/* Functions for allocating/freeing a sim_state. */
-SIM_DESC sim_state_alloc PARAMS ((void));
+SIM_DESC sim_state_alloc PARAMS ((SIM_OPEN_KIND kind, host_callback *callback));
void sim_state_free PARAMS ((SIM_DESC));