]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/ft32/sim-main.h
sim: ft32: new port
[thirdparty/binutils-gdb.git] / sim / ft32 / sim-main.h
1 /* Simulator for FTDI FT32 processor.
2
3 Copyright (C) 2009-2015 Free Software Foundation, Inc.
4 Contributed by FTDI <support@ftdichip.com>
5
6 This file is part of simulators.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 #ifndef SIM_MAIN_H
22 #define SIM_MAIN_H
23
24 #include "sim-basics.h"
25
26 typedef address_word sim_cia;
27
28 #include "sim-base.h"
29 #include "bfd.h"
30
31 typedef struct _sim_cpu SIM_CPU;
32
33 #include "ft32-sim.h"
34
35 struct _sim_cpu {
36
37 /* The following are internal simulator state variables: */
38 #define CIA_GET(CPU) ((CPU)->state.pc + 0)
39 #define CIA_SET(CPU,CIA) ((CPU)->state.pc = (CIA))
40
41 struct ft32_cpu_state state;
42
43 sim_cpu_base base;
44 };
45
46 struct sim_state {
47
48 sim_cpu *cpu[MAX_NR_PROCESSORS];
49 #if (WITH_SMP)
50 #define STATE_CPU(sd,n) ((sd)->cpu[n])
51 #else
52 #define STATE_CPU(sd,n) ((sd)->cpu[0])
53 #endif
54
55 sim_state_base base;
56 };
57
58 #endif