Skip to content

Commit

Permalink
sim: m68hc11: standardize sim_cpu naming
Browse files Browse the repository at this point in the history
We use "sim_cpu *cpu" in the sim code base, not "struct _sim_cpu" or
the name "proc", so clean up this sim to follow along.
  • Loading branch information
vapier committed Aug 14, 2016
1 parent 527aaa4 commit 6f64fd4
Show file tree
Hide file tree
Showing 10 changed files with 366 additions and 347 deletions.
19 changes: 19 additions & 0 deletions sim/m68hc11/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2016-08-13 Mike Frysinger <[email protected]>

* dv-m68hc11.c (m68hc11cpu_port_event): Adjust cpu prototype style.
* dv-m68hc11spi.c (m68hc11spi_port_event): Likewise.
* dv-m68hc11tim.c (m68hc11tim_print_timer): Likewise.
* emulos.c (emul_bench): Likewise.
(emul_write): Likewise. Also rename state to cpu.
(emul_os): Rename proc to cpu.
* gencode.c: Rename proc to cpu.
* interrupts.c (interrupts_initialize): Likewise.
* interrupts.h (interrupts): Adjust cpu type.
(interrupts_initialize): Likewise.
* m68hc11_sim.c (cpu_get_reg): Adjust cpu prototype style.
(cpu_get_src_reg, cpu_set_dst_reg, cpu_set_reg,
cpu_get_indexed_operand_addr, cpu_get_indexed_operand8,
cpu_get_indexed_operand16, cpu_dbcc, cpu_exg): Likewise.
(cpu_ccr_update_tst8): Rename proc to cpu.
* sim-main.h: Rename PROC and proc to cpu.

2016-08-13 Mike Frysinger <[email protected]>

* dv-m68hc11eepr.c (attach_m68hc11eepr_regs): Drop cast with
Expand Down
2 changes: 1 addition & 1 deletion sim/m68hc11/dv-m68hc11.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ m68hc11cpu_port_event (struct hw *me,
{
struct m68hc11cpu *controller = hw_data (me);
SIM_DESC sd;
sim_cpu* cpu;
sim_cpu *cpu;

sd = hw_system (me);
cpu = STATE_CPU (sd, 0);
Expand Down
2 changes: 1 addition & 1 deletion sim/m68hc11/dv-m68hc11spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ m68hc11spi_port_event (struct hw *me,
{
SIM_DESC sd;
struct m68hc11spi *controller;
sim_cpu* cpu;
sim_cpu *cpu;
unsigned8 val;

controller = hw_data (me);
Expand Down
2 changes: 1 addition & 1 deletion sim/m68hc11/dv-m68hc11tim.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ m68hc11tim_print_timer (struct hw *me, const char *name,
else
{
signed64 t;
sim_cpu* cpu;
sim_cpu *cpu;

cpu = STATE_CPU (sd, 0);

Expand Down
22 changes: 11 additions & 11 deletions sim/m68hc11/emulos.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static struct timeval bench_start;
static struct timeval bench_stop;

static void
emul_bench (struct _sim_cpu* cpu)
emul_bench (sim_cpu *cpu)
{
int op;

Expand Down Expand Up @@ -91,18 +91,18 @@ emul_bench (struct _sim_cpu* cpu)
#endif

static void
emul_write(struct _sim_cpu* state)
emul_write (sim_cpu *cpu)
{
int addr = cpu_get_x (state) & 0x0FFFF;
int size = cpu_get_d (state) & 0x0FFFF;
int addr = cpu_get_x (cpu) & 0x0FFFF;
int size = cpu_get_d (cpu) & 0x0FFFF;

if (addr + size > 0x0FFFF) {
size = 0x0FFFF - addr;
}
state->cpu_running = 0;
cpu->cpu_running = 0;
while (size)
{
uint8 val = memory_read8 (state, addr);
uint8 val = memory_read8 (cpu, addr);

write(0, &val, 1);
addr ++;
Expand All @@ -124,17 +124,17 @@ emul_exit (sim_cpu *cpu)
}

void
emul_os (int code, sim_cpu *proc)
emul_os (int code, sim_cpu *cpu)
{
proc->cpu_current_cycle = 8;
cpu->cpu_current_cycle = 8;
switch (code)
{
case 0x0:
break;

/* 0xCD 0x01 */
case 0x01:
emul_write (proc);
emul_write (cpu);
break;

/* 0xCD 0x02 */
Expand All @@ -143,13 +143,13 @@ emul_os (int code, sim_cpu *proc)

/* 0xCD 0x03 */
case 0x03:
emul_exit (proc);
emul_exit (cpu);
break;

/* 0xCD 0x04 */
case 0x04:
#ifndef WIN32
emul_bench (proc);
emul_bench (cpu);
#endif
break;

Expand Down
Loading

0 comments on commit 6f64fd4

Please sign in to comment.