+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-17 Mike Frysinger <vapier@gentoo.org>
* wrapper.c (arm_pc_get, arm_pc_set): New functions.
extern struct ARMul_State *state;
-#define CIA_GET(cpu) PC
-#define CIA_SET(cpu,val) ARMul_SetPC (state, (val))
-
struct _sim_cpu {
sim_cpu_base base;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-16 Mike Frysinger <vapier@gentoo.org>
* interp.c (avr_pc_get, avr_pc_set): New functions.
typedef address_word sim_cia;
extern unsigned int pc;
-#define CIA_GET(cpu) pc
-#define CIA_SET(cpu,val) (pc) = (val)
-
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
typedef unsigned32 sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
typedef struct _sim_cpu SIM_CPU;
#include "bfin-sim.h"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * cgen-utils.c (cgen_rtx_error): Change CIA_GET to CPU_PC_GET.
+ * sim-core.c (sim_core_read_buffer, sim_core_write_buffer): Likewise.
+ * sim-engine.h (SIM_ENGINE_HALT_HOOK): Change CIA_SET to CPU_PC_SET.
+ * sim-run.c (sim_engine_run): Change CIA_GET to CPU_PC_GET and
+ CIA_SET to CPU_PC_SET.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_NEW_COMMON_OBJS): Add sim-cpu.o.
sim_io_printf (sd, msg);
sim_io_printf (sd, "\n");
- sim_engine_halt (sd, cpu, NULL, CIA_GET (cpu), sim_stopped, SIM_SIGTRAP);
+ sim_engine_halt (sd, cpu, NULL, CPU_PC_GET (cpu), sim_stopped, SIM_SIGTRAP);
}
if (mapping->device != NULL)
{
int nr_bytes = len - count;
- sim_cia cia = cpu ? CIA_GET (cpu) : NULL_CIA;
+ sim_cia cia = cpu ? CPU_PC_GET (cpu) : NULL_CIA;
if (raddr + nr_bytes - 1> mapping->bound)
nr_bytes = mapping->bound - raddr + 1;
if (device_io_read_buffer (mapping->device,
&& mapping->device != NULL)
{
int nr_bytes = len - count;
- sim_cia cia = cpu ? CIA_GET (cpu) : NULL_CIA;
+ sim_cia cia = cpu ? CPU_PC_GET (cpu) : NULL_CIA;
if (raddr + nr_bytes - 1 > mapping->bound)
nr_bytes = mapping->bound - raddr + 1;
if (device_io_write_buffer (mapping->device,
#if !defined (SIM_ENGINE_HALT_HOOK)
#define SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA) \
-if ((LAST_CPU) != NULL) CIA_SET (LAST_CPU, CIA)
+if ((LAST_CPU) != NULL) CPU_PC_SET (LAST_CPU, CIA)
#endif
/* NB: If a port uses the SIM_CPU_EXCEPTION_* hooks, the default
sim_cpu *cpu;
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
cpu = STATE_CPU (sd, 0);
- cia = CIA_GET (cpu);
+ cia = CPU_PC_GET (cpu);
while (1)
{
instruction_word insn = IMEM32 (cia);
/* process any events */
if (sim_events_tick (sd))
{
- CIA_SET (cpu, cia);
+ CPU_PC_SET (cpu, cia);
sim_events_process (sd);
}
}
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-17 Mike Frysinger <vapier@gentoo.org>
* interp.c (cr16_pc_get, cr16_pc_set): New functions.
#include "cr16_sim.h"
-#define CIA_GET(cpu) PC
-#define CIA_SET(cpu,val) SET_PC (val)
-
struct _sim_cpu {
sim_cpu_base base;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * crisv10f.c (deliver_interrupt): Change CIA_GET to CPU_PC_GET.
+ * crisv32f.c (deliver_interrupt): Likewise.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
GET_H_SR (H_SR_PRE_V32_IBR) + vec * 4, 4) == 0)
{
/* Nothing to do actually; either abort or send a signal. */
- sim_core_signal (sd, current_cpu, CIA_GET (current_cpu), 0, 4,
+ sim_core_signal (sd, current_cpu, CPU_PC_GET (current_cpu), 0, 4,
GET_H_SR (H_SR_PRE_V32_IBR) + vec * 4,
read_transfer, sim_core_unmapped_signal);
return 0;
GET_H_SR (H_SR_EBP) + vec * 4, 4) == 0)
{
/* Nothing to do actually; either abort or send a signal. */
- sim_core_signal (sd, current_cpu, CIA_GET (current_cpu), 0, 4,
+ sim_core_signal (sd, current_cpu, CPU_PC_GET (current_cpu), 0, 4,
GET_H_SR (H_SR_EBP) + vec * 4,
read_transfer, sim_core_unmapped_signal);
return 0;
/* These must be defined before sim-base.h. */
typedef USI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
#define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
do { \
if (cpu) /* Null if ctrl-c. */ \
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-17 Mike Frysinger <vapier@gentoo.org>
* interp.c (d10v_pc_get, d10v_pc_set): New functions.
#include "d10v_sim.h"
-#define CIA_GET(cpu) PC
-#define CIA_SET(cpu,val) SET_PC (val)
-
struct _sim_cpu {
sim_cpu_base base;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+ * traps.c (frv_sim_engine_halt_hook): Change CIA_SET to CPU_PC_SET.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
/* These must be defined before sim-base.h. */
typedef USI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
void frv_sim_engine_halt_hook (SIM_DESC, SIM_CPU *, sim_cia);
#define SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA) \
frv_sim_engine_halt_hook ((SD), (LAST_CPU), (CIA))
{
int i;
if (current_cpu != NULL)
- CIA_SET (current_cpu, cia);
+ CPU_PC_SET (current_cpu, cia);
/* Invalidate the insn and data caches of all cpus. */
for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (ft32_read_item): Change CIA_GET to CPU_PC_GET.
+ (ft32_write_item): Likewise.
+ (step_once): Likewise.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
ft32_read_item (SIM_DESC sd, int dw, uint32_t ea)
{
sim_cpu *cpu = STATE_CPU (sd, 0);
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
uint8_t byte[4];
uint32_t r;
ft32_write_item (SIM_DESC sd, int dw, uint32_t ea, uint32_t v)
{
sim_cpu *cpu = STATE_CPU (sd, 0);
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
uint8_t byte[4];
ea = ft32_align (dw, ea);
step_once (SIM_DESC sd)
{
sim_cpu *cpu = STATE_CPU (sd, 0);
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
uint32_t inst;
uint32_t dw;
uint32_t cb;
struct _sim_cpu {
/* The following are internal simulator state variables: */
-#define CIA_GET(CPU) ((CPU)->state.pc + 0)
-#define CIA_SET(CPU,CIA) ((CPU)->state.pc = (CIA))
struct ft32_cpu_state state;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-17 Mike Frysinger <vapier@gentoo.org>
* compile.c (h8300_pc_get, h8300_pc_set): New functions.
/* The current state of the processor; registers, memory, etc. */
-#define CIA_GET(CPU) (cpu_get_pc (CPU))
-#define CIA_SET(CPU, VAL) (cpu_set_pc ((CPU), (VAL)))
#define cpu_set_pc(CPU, VAL) (((CPU)->pc) = (VAL))
#define cpu_get_pc(CPU) (((CPU)->pc))
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * gen-engine.c (print_run_body): Change CIA_GET to CPU_PC_GET and
+ CIA_SET to CPU_PC_SET.
+
2015-03-31 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
lf_putstr (file, "/* prime the main loop */\n");
lf_putstr (file, "SIM_ASSERT (current_cpu == 0);\n");
lf_putstr (file, "SIM_ASSERT (nr_cpus == 1);\n");
- lf_putstr (file, "cia = CIA_GET (CPU);\n");
+ lf_putstr (file, "cia = CPU_PC_GET (CPU);\n");
lf_putstr (file, "\n");
lf_putstr (file, "while (1)\n");
lf_putstr (file, "/* process any events */\n");
lf_putstr (file, "if (sim_events_tick (sd))\n");
lf_putstr (file, " {\n");
- lf_putstr (file, " CIA_SET (CPU, cia);\n");
+ lf_putstr (file, " CPU_PC_SET (CPU, cia);\n");
lf_putstr (file, " sim_events_process (sd);\n");
- lf_putstr (file, " cia = CIA_GET (CPU);\n");
+ lf_putstr (file, " cia = CPU_PC_GET (CPU);\n");
lf_putstr (file, " }\n");
lf_indent (file, -4);
lf_putstr (file, " {\n");
lf_indent (file, +4);
lf_putstr (file, "sim_cpu *cpu = STATE_CPU (sd, current_cpu);\n");
- lf_putstr (file, "instruction_address cia = CIA_GET (cpu);\n");
+ lf_putstr (file, "instruction_address cia = CPU_PC_GET (cpu);\n");
lf_putstr (file, "\n");
if (!options.gen.icache)
options.insn_bit_size);
print_engine_issue_prefix_hook (file);
print_idecode_body (file, table, "cia =");
- lf_putstr (file, "CIA_SET (cpu, cia);\n");
+ lf_putstr (file, "CPU_PC_SET (cpu, cia);\n");
print_engine_issue_postfix_hook (file);
}
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
/* These must be defined before sim-base.h. */
typedef USI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
#include "sim-base.h"
#include "cgen-sim.h"
#include "iq2000-sim.h"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * dv-lm32cpu.c (deliver_lm32cpu_interrupt): Change CIA_GET to
+ CPU_PC_GET.
+ (lm32cpu_port_event): Likewise.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+ * traps.c (lm32_core_signal): Change CIA_SET to CPU_PC_SET.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
struct lm32cpu *controller = hw_data (me);
SIM_DESC sd = hw_system (me);
sim_cpu *cpu = STATE_CPU (sd, 0); /* NB: fix CPU 0. */
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
int interrupt = (int) data;
struct lm32cpu *controller = hw_data (me);
SIM_DESC sd = hw_system (me);
sim_cpu *cpu = STATE_CPU (sd, 0); /* NB: fix CPU 0. */
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
HW_TRACE ((me, "interrupt event on port %d, level %d", my_port, level));
/* These must be defined before sim-base.h. */
typedef USI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
#define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
do { \
if (cpu) /* null if ctrl-c */ \
SET_H_GR (30, ip);
/* Save and clear interrupt enable. */
SET_H_CSR (LM32_CSR_IE, (GET_H_CSR (LM32_CSR_IE) & 1) << 1);
- CIA_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
+ CPU_PC_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
sim_engine_halt (sd, cpu, NULL, LM32_EID_DATA_BUS_ERROR * 32,
sim_stopped, SIM_SIGSEGV);
break;
SET_H_GR (30, ip);
/* Save and clear interrupt enable. */
SET_H_CSR (LM32_CSR_IE, (GET_H_CSR (LM32_CSR_IE) & 1) << 1);
- CIA_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
+ CPU_PC_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
sim_engine_halt (sd, cpu, NULL, LM32_EID_DATA_BUS_ERROR * 32,
sim_stopped, SIM_SIGBUS);
break;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
/* These must be defined before sim-base.h. */
typedef USI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
#define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
do { \
if (cpu) /* null if ctrl-c */ \
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
/* The current state of the processor; registers, memory, etc. */
-#define CIA_GET(CPU) (cpu_get_pc (CPU))
-#define CIA_SET(CPU,VAL) (cpu_set_pc ((CPU), (VAL)))
-
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
device *devices;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (set_initial_gprs): Change CIA_SET to CPU_PC_SET.
+ (sim_resume): Change CIA_GET to CPU_PC_GET and CIA_SET to
+ CPU_PC_SET.
+ (sim_create_inferior): Change CIA_SET to CPU_PC_SET.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-16 Mike Frysinger <vapier@gentoo.org>
* interp.c (mcore_pc_get, mcore_pc_set): New functions.
init_pointers ();
/* Set up machine just out of reset. */
- CIA_SET (scpu, 0);
+ CPU_PC_SET (scpu, 0);
cpu.sr = 0;
memsize = cpu.asregs.msize / (1024 * 1024);
word WLhash;
cpu.asregs.exception = step ? SIGTRAP: 0;
- pc = CIA_GET (scpu);
+ pc = CPU_PC_GET (scpu);
/* Fetch the initial instructions that we'll decode. */
ibuf = rlat (pc & 0xFFFFFFFC);
while (!cpu.asregs.exception);
/* Hide away the things we've cached while executing. */
- CIA_SET (scpu, pc);
+ CPU_PC_SET (scpu, pc);
cpu.asregs.insts += insts; /* instructions done ... */
cpu.asregs.cycles += insts; /* and each takes a cycle */
cpu.asregs.cycles += bonus_cycles; /* and extra cycles for branches */
issue_messages = l;
hi_stack = cpu.asregs.msize - 4;
- CIA_SET (scpu, bfd_get_start_address (prog_bfd));
+ CPU_PC_SET (scpu, bfd_get_start_address (prog_bfd));
/* Calculate the argument and environment strings. */
s_length = 0;
#include "sim-base.h"
#include "bfd.h"
-#define CIA_GET(cpu) (cpu)->pc
-#define CIA_SET(cpu,val) (cpu)->pc = (val)
-
struct _sim_cpu {
word pc;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-17 Mike Frysinger <vapier@gentoo.org>
* interp.c (microblaze_pc_get, microblaze_pc_set): New functions.
typedef address_word sim_cia;
-#define CIA_GET(cpu) (cpu)->microblaze_cpu.spregs[0]
-#define CIA_SET(cpu,val) (cpu)->microblaze_cpu.spregs[0] = (val)
-
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * dv-tx3904cpu.c (deliver_tx3904cpu_interrupt): Change CIA_GET to
+ PU_PC_GET.
+ * interp.c (interrupt_event): Change CIA_GET to CPU_PC_GET.
+ (sim_create_inferior): Change CIA_SET to CPU_PC_SET.
+ * m16run.c (sim_engine_run): Change CIA_GET to CPU_PC_GET and
+ CIA_SET to CPU_PC_SET.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
struct tx3904cpu *controller = hw_data (me);
SIM_DESC sd = hw_system (me);
sim_cpu *cpu = STATE_CPU (sd, 0); /* NB: fix CPU 0. */
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
#define CPU cpu
#define SD current_state
if (controller->pending_reset)
{
controller->pending_reset = 0;
- HW_TRACE ((me, "reset pc=0x%08lx", (long) CIA_GET (cpu)));
+ HW_TRACE ((me, "reset pc=0x%08lx", (long) CPU_PC_GET (cpu)));
SignalExceptionNMIReset();
}
else if (controller->pending_nmi)
{
controller->pending_nmi = 0;
- HW_TRACE ((me, "nmi pc=0x%08lx", (long) CIA_GET (cpu)));
+ HW_TRACE ((me, "nmi pc=0x%08lx", (long) CPU_PC_GET (cpu)));
SignalExceptionNMIReset();
}
else if (controller->pending_level)
{
HW_TRACE ((me, "interrupt level=%d pc=0x%08lx sr=0x%08lx",
controller->pending_level,
- (long) CIA_GET (cpu), (long) SR));
+ (long) CPU_PC_GET (cpu), (long) SR));
/* Clear CAUSE register. It may stay this way if the interrupt
was cleared with a negative pending_level. */
interrupt_event (SIM_DESC sd, void *data)
{
sim_cpu *cpu = STATE_CPU (sd, 0); /* FIXME */
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
if (SR & status_IE)
{
interrupt_pending = 0;
for (cpu_nr = 0; cpu_nr < sim_engine_nr_cpus (sd); cpu_nr++)
{
sim_cpu *cpu = STATE_CPU (sd, cpu_nr);
- CIA_SET (cpu, (unsigned64) bfd_get_start_address (abfd));
+ CPU_PC_SET (cpu, (unsigned64) bfd_get_start_address (abfd));
}
}
int siggnal) /* ignore */
{
sim_cpu *cpu = STATE_CPU (sd, next_cpu_nr);
- address_word cia = CIA_GET (cpu);
+ address_word cia = CPU_PC_GET (cpu);
while (1)
{
/* process any events */
if (sim_events_tick (sd))
{
- CIA_SET (CPU, cia);
+ CPU_PC_SET (CPU, cia);
sim_events_process (sd);
- cia = CIA_GET (CPU);
+ cia = CPU_PC_GET (CPU);
}
}
/* The following are internal simulator state variables: */
-#define CIA_GET(CPU) ((CPU)->registers[PCIDX] + 0)
-#define CIA_SET(CPU,CIA) ((CPU)->registers[PCIDX] = (CIA))
address_word dspc; /* delay-slot PC */
#define DSPC ((CPU)->dspc)
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * dv-mn103cpu.c (deliver_mn103cpu_interrupt): Change CIA_GET to
+ CPU_PC_GET and CIA_SET to CPU_PC_SET.
+ * interp.c (sim_create_inferior): Change CIA_SET to CPU_PC_SET.
+ (program_interrupt): Change CIA_GET to CPU_PC_GET and CIA_SET to
+ CPU_PC_SET.
+ (mn10300_cpu_exception_trigger): Change CIA_SET to CPU_PC_SET.
+ (mn10300_cpu_exception_suspend): Likewise.
+ (mn10300_cpu_exception_resume): Likewise.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (MN10300_OBJS): Delete sim-cpu.o.
else if (controller->pending_nmi)
{
controller->pending_nmi = 0;
- store_word (SP - 4, CIA_GET (cpu));
+ store_word (SP - 4, CPU_PC_GET (cpu));
store_half (SP - 8, PSW);
PSW &= ~PSW_IE;
SP = SP - 8;
- CIA_SET (cpu, 0x40000008);
+ CPU_PC_SET (cpu, 0x40000008);
HW_TRACE ((me, "nmi pc=0x%08lx psw=0x%04x sp=0x%08lx",
- (long) CIA_GET (cpu), (unsigned) PSW, (long) SP));
+ (long) CPU_PC_GET (cpu), (unsigned) PSW, (long) SP));
}
else if ((controller->pending_level < EXTRACT_PSW_LM)
&& (PSW & PSW_IE))
{
/* Don't clear pending level. Request continues to be pending
until the interrupt controller clears/changes it */
- store_word (SP - 4, CIA_GET (cpu));
+ store_word (SP - 4, CPU_PC_GET (cpu));
store_half (SP - 8, PSW);
PSW &= ~PSW_IE;
PSW &= ~PSW_LM;
PSW |= INSERT_PSW_LM (controller->pending_level);
SP = SP - 8;
- CIA_SET (cpu, 0x40000000 + controller->interrupt_vector[controller->pending_level]);
+ CPU_PC_SET (cpu, 0x40000000 + controller->interrupt_vector[controller->pending_level]);
HW_TRACE ((me, "port-out ack %d", controller->pending_level));
hw_port_event (me, ACK_PORT, controller->pending_level);
HW_TRACE ((me, "int level=%d pc=0x%08lx psw=0x%04x sp=0x%08lx",
controller->pending_level,
- (long) CIA_GET (cpu), (unsigned) PSW, (long) SP));
+ (long) CPU_PC_GET (cpu), (unsigned) PSW, (long) SP));
}
if (controller->pending_level < 7) /* FIXME */
} else {
PC = 0;
}
- CIA_SET (STATE_CPU (sd, 0), (unsigned64) PC);
+ CPU_PC_SET (STATE_CPU (sd, 0), (unsigned64) PC);
if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2)
PSW |= PSW_FE;
{
in_interrupt = 1;
/* copy NMI handler code from dv-mn103cpu.c */
- store_word (SP - 4, CIA_GET (cpu));
+ store_word (SP - 4, CPU_PC_GET (cpu));
store_half (SP - 8, PSW);
/* Set the SYSEF flag in NMICR by backdoor method. See
PSW &= ~PSW_IE;
SP = SP - 8;
- CIA_SET (cpu, 0x40000008);
+ CPU_PC_SET (cpu, 0x40000008);
in_interrupt = 0;
sim_engine_halt(sd, cpu, NULL, cia, sim_stopped, sig);
if(State.exc_suspended > 0)
sim_io_eprintf(sd, "Warning, nested exception triggered (%d)\n", State.exc_suspended);
- CIA_SET (cpu, cia);
+ CPU_PC_SET (cpu, cia);
memcpy(State.exc_trigger_regs, State.regs, sizeof(State.exc_trigger_regs));
State.exc_suspended = 0;
}
memcpy(State.exc_suspend_regs, State.regs, sizeof(State.exc_suspend_regs));
memcpy(State.regs, State.exc_trigger_regs, sizeof(State.regs));
- CIA_SET (cpu, PC); /* copy PC back from new State.regs */
+ CPU_PC_SET (cpu, PC); /* copy PC back from new State.regs */
State.exc_suspended = exception;
}
State.exc_suspended, exception);
memcpy(State.regs, State.exc_suspend_regs, sizeof(State.regs));
- CIA_SET (cpu, PC); /* copy PC back from new State.regs */
+ CPU_PC_SET (cpu, PC); /* copy PC back from new State.regs */
}
else if(exception != 0 && State.exc_suspended == 0)
{
/* FIXME: For moment, save/restore PC value found in struct State.
Struct State will one day go away, being placed in the sim_cpu
state. */
-#define CIA_GET(CPU) ((PC) + 0)
-#define CIA_SET(CPU,VAL) ((CPU)->cia = (VAL), PC = (VAL))
-
struct _sim_cpu {
sim_event *pending_nmi;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (wbat, wsat, wlat, rsat, rbat, rlat, sim_engine_run):
+ Change CIA_GET to CPU_PC_GET.
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-16 Mike Frysinger <vapier@gentoo.org>
* interp.c (moxie_pc_get, moxie_pc_set): New functions.
static INLINE void
wbat (sim_cpu *scpu, word pc, word x, word v)
{
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
sim_core_write_aligned_1 (scpu, cia, write_map, x, v);
}
static INLINE void
wsat (sim_cpu *scpu, word pc, word x, word v)
{
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
sim_core_write_aligned_2 (scpu, cia, write_map, x, v);
}
static INLINE void
wlat (sim_cpu *scpu, word pc, word x, word v)
{
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
sim_core_write_aligned_4 (scpu, cia, write_map, x, v);
}
static INLINE int
rsat (sim_cpu *scpu, word pc, word x)
{
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
return (sim_core_read_aligned_2 (scpu, cia, read_map, x));
}
static INLINE int
rbat (sim_cpu *scpu, word pc, word x)
{
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
return (sim_core_read_aligned_1 (scpu, cia, read_map, x));
}
static INLINE int
rlat (sim_cpu *scpu, word pc, word x)
{
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
return (sim_core_read_aligned_4 (scpu, cia, read_map, x));
}
word pc, opc;
unsigned short inst;
sim_cpu *scpu = STATE_CPU (sd, 0); /* FIXME */
- address_word cia = CIA_GET (scpu);
+ address_word cia = CPU_PC_GET (scpu);
pc = cpu.asregs.regs[PC_REGNO];
struct _sim_cpu {
/* The following are internal simulator state variables: */
-#define CIA_GET(CPU) ((CPU)->registers[PCIDX] + 0)
-#define CIA_SET(CPU,CIA) ((CPU)->registers[PCIDX] = (CIA))
/* To keep this default simulator simple, and fast, we use a direct
vector of registers. The internal simulator engine then uses
};
#endif
-
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
#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"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-17 Mike Frysinger <vapier@gentoo.org>
* interp.c (sh_pc_get, sh_pc_set): New functions.
typedef address_word sim_cia;
-#define CIA_GET(cpu) saved_state.asregs.pc
-#define CIA_SET(cpu,val) saved_state.asregs.pc = (val)
-
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
/* These must be defined before sim-base.h. */
typedef UDI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val) | (sh64_h_ism_get (cpu)))
-
#include "sim-base.h"
#include "cgen-sim.h"
#include "sh64-sim.h"
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (CIA_GET, CIA_SET): Delete.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
sim_cpu_base base;
};
-#define CIA_GET(CPU) ((CPU)->reg.pc + 0)
-#define CIA_SET(CPU,VAL) ((CPU)->reg.pc = (VAL))
-
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if 0