xref: /netbsd-src/external/gpl3/gdb/dist/sim/example-synacor/sim-main.h (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
1 /* Example synacor simulator.
2 
3    Copyright (C) 2005-2023 Free Software Foundation, Inc.
4    Contributed by Mike Frysinger.
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 #include "sim-base.h"
26 
27 struct _sim_cpu {
28   /* ... simulator specific members ... */
29   uint16_t regs[8];
30   sim_cia pc;
31 
32   /* This isn't a real register, and the stack is not directly addressable,
33      so use memory outside of the 16-bit address space.  */
34   uint32_t sp;
35 
36   sim_cpu_base base;
37 };
38 
39 extern void step_once (SIM_CPU *);
40 extern void initialize_cpu (SIM_DESC, SIM_CPU *);
41 
42 #endif
43