Commit | Line | Data |
---|---|---|
15c16493 AC |
1 | /* This file is part of the program psim. |
2 | ||
3 | Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au> | |
4 | Copyright (C) 1997, Free Software Foundation | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
19 | ||
20 | */ | |
21 | ||
22 | ||
23 | #ifndef _SIM_MAIN_H_ | |
24 | #define _SIM_MAIN_H_ | |
25 | ||
128b5154 | 26 | |
15c16493 | 27 | #include "sim-basics.h" |
aaa11abe AC |
28 | #include "sim-signal.h" |
29 | ||
30 | #include <signal.h> /* For kill() in insns:do_trap */ | |
d9b75947 | 31 | |
8c5b6ead | 32 | #include <errno.h> |
ff82f214 AC |
33 | #ifdef HAVE_UNISTD_H |
34 | #include <unistd.h> | |
35 | #endif | |
15c16493 AC |
36 | |
37 | /* These are generated files. */ | |
38 | #include "itable.h" | |
39 | #include "idecode.h" | |
40 | #include "idecode.h" | |
41 | ||
d9b75947 AC |
42 | typedef instruction_address sim_cia; |
43 | static const sim_cia null_cia = {0}; /* Dummy */ | |
44 | #define NULL_CIA null_cia | |
d5d9a1e1 DE |
45 | /* FIXME: Perhaps igen should generate access macros for |
46 | `instruction_address' that we could use. */ | |
47 | #define CIA_ADDR(cia) ((cia).ip) | |
d9b75947 | 48 | |
128b5154 AC |
49 | #define WITH_WATCHPOINTS 1 |
50 | ||
d9b75947 AC |
51 | #include "sim-base.h" |
52 | ||
15c16493 | 53 | #include "alu.h" |
381f42ef | 54 | #include "cpu.h" |
15c16493 | 55 | |
15c16493 AC |
56 | |
57 | struct sim_state { | |
58 | ||
15c16493 AC |
59 | /* the processors proper */ |
60 | sim_cpu cpu; | |
61 | #define STATE_CPU(sd, n) (&(sd)->cpu) | |
62 | ||
63 | /* The base class. */ | |
64 | sim_state_base base; | |
65 | ||
66 | }; | |
67 | ||
68 | /* (re) initialize the simulator */ | |
69 | ||
70 | extern void engine_init | |
71 | (SIM_DESC sd); | |
72 | ||
73 | ||
8c5b6ead MM |
74 | #ifndef HAVE_GETPID |
75 | #define getpid() 42 | |
76 | #endif | |
77 | ||
78 | #ifndef HAVE_KILL | |
2001e533 | 79 | #define kill(sig, pid) (errno = EINVAL, -1) |
8c5b6ead | 80 | #endif |
15c16493 | 81 | #endif |