X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=sim%2Fmsp430%2Fsim-main.h;h=68910046997b2a2d1111dc464f3f939bc91de5fe;hb=784712bf4fed9507cb807277ac64d07686bab2c1;hp=9b2fdc90e919d5e6962fa7b1f3dfedc3553ab1d0;hpb=32d0add0a654c1204ab71dc8a55d9374538c4b33;p=binutils-gdb.git diff --git a/sim/msp430/sim-main.h b/sim/msp430/sim-main.h index 9b2fdc90e91..68910046997 100644 --- a/sim/msp430/sim-main.h +++ b/sim/msp430/sim-main.h @@ -1,6 +1,6 @@ /* Simulator for TI MSP430 and MSP430X processors. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2021 Free Software Foundation, Inc. Contributed by Red Hat, Inc. This file is part of simulators. @@ -22,12 +22,6 @@ #define _MSP430_MAIN_SIM_H_ #include "sim-basics.h" -#include "sim-signal.h" - -typedef unsigned32 sim_cia; - -typedef struct _sim_cpu SIM_CPU; - #include "msp430-sim.h" #include "sim-base.h" @@ -38,83 +32,12 @@ struct _sim_cpu sim_cpu_base base; }; -struct sim_state -{ - sim_cpu *cpu[MAX_NR_PROCESSORS]; - -#if (WITH_SMP) -#error WITH_SMP not supported by MSP430 sim -#else -#define STATE_CPU(sd,n) ((sd)->cpu[0]) -#endif - - asymbol **symbol_table; - long number_of_symbols; -#define STATE_SYMBOL_TABLE(sd) ((sd)->symbol_table) -#define STATE_NUM_SYMBOLS(sd) ((sd)->number_of_symbols) - - /* Simulator specific members. */ - sim_state_base base; -}; - #define MSP430_CPU(sd) (STATE_CPU ((sd), 0)) #define MSP430_CPU_STATE(sd) (MSP430_CPU ((sd)->state)) -#define CIA_GET(CPU) ((CPU)->state.regs[0] + 0) -#define CIA_SET(CPU,VAL) ((CPU)->state.regs[0] = (VAL)) - #include "sim-config.h" #include "sim-types.h" #include "sim-engine.h" #include "sim-options.h" -#include "run-sim.h" - -#define MAYBE_TRACE(type, cpu, fmt, ...) \ - do \ - { \ - if (TRACE_##type##_P (cpu)) \ - trace_generic (CPU_STATE (cpu), cpu, TRACE_##type##_IDX, \ - fmt, ## __VA_ARGS__); \ - } \ - while (0) - -#define TRACE_INSN(cpu, fmt, ...) MAYBE_TRACE (INSN, cpu, fmt, ## __VA_ARGS__) -#define TRACE_DECODE(cpu, fmt, ...) MAYBE_TRACE (DECODE, cpu, fmt, ## __VA_ARGS__) -#define TRACE_EXTRACT(cpu, fmt, ...) MAYBE_TRACE (EXTRACT, cpu, fmt, ## __VA_ARGS__) -#define TRACE_SYSCALL(cpu, fmt, ...) MAYBE_TRACE (SYSCALL, cpu, fmt, ## __VA_ARGS__) - -#define TRACE_CORE(cpu, addr, size, map, val) \ - do \ - { \ - MAYBE_TRACE (CORE, cpu, "%cBUS %s %i bytes @ 0x%08x: 0x%0*x", \ - map == exec_map ? 'I' : 'D', \ - map == write_map ? "STORE" : "FETCH", \ - size, addr, size * 2, val); \ - PROFILE_COUNT_CORE (cpu, addr, size, map); \ - } \ - while (0) - -#define TRACE_EVENTS(cpu, fmt, ...) MAYBE_TRACE (EVENTS, cpu, fmt, ## __VA_ARGS__) - -#define TRACE_BRANCH(cpu, oldpc, newpc, fmt, ...) \ - do \ - { \ - MAYBE_TRACE (BRANCH, cpu, fmt " to %#x", ## __VA_ARGS__, newpc); \ - } \ - while (0) - -extern void trace_register (SIM_DESC, sim_cpu *, const char *, ...) - __attribute__((format (printf, 3, 4))); - -#define TRACE_REGISTER(cpu, fmt, ...) \ - do \ - { \ - if (TRACE_CORE_P (cpu)) \ - trace_register (CPU_STATE (cpu), cpu, fmt, ## __VA_ARGS__); \ - } \ - while (0) - -#define TRACE_REG(cpu, reg, val) \ - TRACE_REGISTER (cpu, "wrote R%d = %#x", reg, val) #endif /* _MSP430_MAIN_SIM_H_ */