From 271f42cf0e6bea05454d68d220507df69c97c1d1 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:13 -0300 Subject: [PATCH] feat: rename ARM and THUMB SWI functions --- src/cpu.zig | 8 ++++---- src/cpu/arm/software_interrupt.zig | 2 +- src/cpu/thumb/software_interrupt.zig | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpu.zig b/src/cpu.zig index 54c5dfd..6e7b025 100644 --- a/src/cpu.zig +++ b/src/cpu.zig @@ -16,7 +16,7 @@ const halfAndSignedDataTransfer = @import("cpu/arm/half_signed_data_transfer.zig const blockDataTransfer = @import("cpu/arm/block_data_transfer.zig").blockDataTransfer; const branch = @import("cpu/arm/branch.zig").branch; const branchAndExchange = @import("cpu/arm/branch.zig").branchAndExchange; -const softwareInterrupt = @import("cpu/arm/software_interrupt.zig").softwareInterrupt; +const armSoftwareInterrupt = @import("cpu/arm/software_interrupt.zig").armSoftwareInterrupt; const singleDataSwap = @import("cpu/arm/single_data_swap.zig").singleDataSwap; const multiply = @import("cpu/arm/multiply.zig").multiply; @@ -44,7 +44,7 @@ const format16 = @import("cpu/thumb/branch.zig").format16; const format18 = @import("cpu/thumb/branch.zig").format18; const format19 = @import("cpu/thumb/branch.zig").format19; -const format17 = @import("cpu/thumb/software_interrupt.zig").format17; +const thumbSoftwareInterrupt = @import("cpu/thumb/software_interrupt.zig").thumbSoftwareInterrupt; pub const ArmInstrFn = fn (*Arm7tdmi, *Bus, u32) void; pub const ThumbInstrFn = fn (*Arm7tdmi, *Bus, u16) void; @@ -485,7 +485,7 @@ fn thumbPopulate() [0x400]ThumbInstrFn { lut[i] = format13(S); } else if (i >> 2 & 0xFF == 0xDF) { - lut[i] = format17(); + lut[i] = thumbSoftwareInterrupt(); } else if (i >> 6 & 0xF == 0b1000) { const L = i >> 5 & 1 == 1; const offset = i & 0x1F; @@ -619,7 +619,7 @@ fn armPopulate() [0x1000]ArmInstrFn { lut[i] = armUndefined; } else if (i >> 8 & 0xF == 0b1111) { // Bits 27:24 - lut[i] = softwareInterrupt(); + lut[i] = armSoftwareInterrupt(); } } diff --git a/src/cpu/arm/software_interrupt.zig b/src/cpu/arm/software_interrupt.zig index d5c5812..f40e8a4 100644 --- a/src/cpu/arm/software_interrupt.zig +++ b/src/cpu/arm/software_interrupt.zig @@ -4,7 +4,7 @@ const Bus = @import("../../Bus.zig"); const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi; const InstrFn = @import("../../cpu.zig").ArmInstrFn; -pub fn softwareInterrupt() InstrFn { +pub fn armSoftwareInterrupt() InstrFn { return struct { fn inner(cpu: *Arm7tdmi, _: *Bus, _: u32) void { // Copy Values from Current Mode diff --git a/src/cpu/thumb/software_interrupt.zig b/src/cpu/thumb/software_interrupt.zig index ada29c0..daa4f34 100644 --- a/src/cpu/thumb/software_interrupt.zig +++ b/src/cpu/thumb/software_interrupt.zig @@ -2,7 +2,7 @@ const Bus = @import("../../Bus.zig"); const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi; const InstrFn = @import("../../cpu.zig").ThumbInstrFn; -pub fn format17() InstrFn { +pub fn thumbSoftwareInterrupt() InstrFn { return struct { fn inner(cpu: *Arm7tdmi, _: *Bus, _: u16) void { // Copy Values from Current Mode