1 /* This file is part of the program psim.
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
4 Copyright (C) 1997, Free Software Foundation
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.
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.
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.
27 #define WITH_WATCHPOINTS 1
28 #define SIM_HANDLES_LMA 1
30 #define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) 0 /* disable this hook */
32 #include "sim-basics.h"
33 #include "sim-signal.h"
35 #include <signal.h> /* For kill() in insns:do_trap */
42 /* These are generated files. */
46 typedef instruction_address sim_cia
;
47 static const sim_cia null_cia
= {0}; /* Dummy */
48 #define NULL_CIA null_cia
49 /* FIXME: Perhaps igen should generate access macros for
50 `instruction_address' that we could use. */
51 /*#define CIA_ADDR(cia) ((cia).ip) doesn't work for mn10300*/
53 #define WITH_WATCHPOINTS 1
55 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
56 mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR))
61 #include "mn10300_sim.h"
63 /* Bring data in from the cold */
66 (sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA)))
68 #define IMEM8_IMMED(EA, N) \
69 (sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA) + (N)))
72 /* FIXME: For moment, save/restore PC value found in struct State.
73 Struct State will one day go away, being placed in the sim_cpu
75 #define CIA_GET(CPU) ((PC) + 0)
76 #define CIA_SET(CPU,VAL) ((CPU)->cia = (VAL), PC = (VAL))
80 sim_event
*pending_nmi
;
88 /* the processors proper */
90 #define STATE_CPU(sd, n) (&(sd)->cpu)
97 /* For compatibility, until all functions converted to passing
98 SIM_DESC as an argument */
99 extern SIM_DESC simulator
;
101 /* (re) initialize the simulator */
103 extern void engine_init(SIM_DESC sd
);
104 extern SIM_CORE_SIGNAL_FN mn10300_core_signal
;