aboutsummaryrefslogtreecommitdiff
path: root/sim/avr/sim-main.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-11-21 22:00:57 -0800
committerMike Frysinger <vapier@gentoo.org>2015-11-22 01:12:21 -0500
commit82d442c6c67e42c1697b07aa7ac2b323baf333c0 (patch)
tree5590bc3ff7f6628793b06e0335c0eec817b4a00d /sim/avr/sim-main.h
parent807eaf04cb4ba3c1e5529069ac78af6d9969a5b0 (diff)
downloadfsf-binutils-gdb-82d442c6c67e42c1697b07aa7ac2b323baf333c0.zip
fsf-binutils-gdb-82d442c6c67e42c1697b07aa7ac2b323baf333c0.tar.gz
fsf-binutils-gdb-82d442c6c67e42c1697b07aa7ac2b323baf333c0.tar.bz2
sim: avr: move global state to sim/cpu state
We don't want global variables in the sim as all state should be in the sim state or in the cpu state. This pushes down all that logic for avr.
Diffstat (limited to 'sim/avr/sim-main.h')
-rw-r--r--sim/avr/sim-main.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/sim/avr/sim-main.h b/sim/avr/sim-main.h
index e0cac22..d317bf8 100644
--- a/sim/avr/sim-main.h
+++ b/sim/avr/sim-main.h
@@ -21,19 +21,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-basics.h"
-extern unsigned int pc;
-
#include "sim-base.h"
struct _sim_cpu {
+ /* The only real register. */
+ uint32_t pc;
+
+ /* We update a cycle counter. */
+ uint32_t cycles;
sim_cpu_base base;
};
struct sim_state {
-
sim_cpu *cpu[MAX_NR_PROCESSORS];
+ /* If true, the pc needs more than 2 bytes. */
+ int avr_pc22;
+
sim_state_base base;
};