]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/mn10300/sim-main.h
sim: split sim-signal.h include out
[thirdparty/binutils-gdb.git] / sim / mn10300 / sim-main.h
CommitLineData
c906108c
SS
1/* This file is part of the program psim.
2
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
3666a048 4 Copyright (C) 1997-2021 Free Software Foundation, Inc.
c906108c
SS
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
4744ac1b 8 the Free Software Foundation; either version 3 of the License, or
c906108c
SS
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.
4744ac1b 15
c906108c 16 You should have received a copy of the GNU General Public License
4744ac1b 17 along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
18
19 */
20
21
22#ifndef SIM_MAIN_H
23#define SIM_MAIN_H
24
dc3de083 25#define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) /* disable this hook */
c906108c
SS
26
27#include "sim-basics.h"
c906108c
SS
28
29#include <signal.h> /* For kill() in insns:do_trap */
30
31#include <errno.h>
32#ifdef HAVE_UNISTD_H
33#include <unistd.h>
34#endif
35
36/* These are generated files. */
37#include "itable.h"
38#include "idecode.h"
c906108c 39
c906108c
SS
40#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
41mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR))
42
43
44#include "sim-base.h"
45
46#include "mn10300_sim.h"
47
48/* Bring data in from the cold */
49
50#define IMEM8(EA) \
51(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA)))
52
53#define IMEM8_IMMED(EA, N) \
54(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA) + (N)))
55
56
57/* FIXME: For moment, save/restore PC value found in struct State.
58 Struct State will one day go away, being placed in the sim_cpu
59 state. */
c906108c
SS
60
61struct _sim_cpu {
62 sim_event *pending_nmi;
63 sim_cia cia;
64 sim_cpu_base base;
65};
66
c906108c
SS
67/* For compatibility, until all functions converted to passing
68 SIM_DESC as an argument */
69extern SIM_DESC simulator;
70
71/* (re) initialize the simulator */
72
73extern void engine_init(SIM_DESC sd);
74extern SIM_CORE_SIGNAL_FN mn10300_core_signal;
75
76#endif