feat: stub coprocessor instructions
This commit is contained in:
50
src/arm/cpu/arm/coprocessor.zig
Normal file
50
src/arm/cpu/arm/coprocessor.zig
Normal file
@@ -0,0 +1,50 @@
|
||||
const std = @import("std");
|
||||
const Bus = @import("../../../lib.zig").Bus;
|
||||
|
||||
const log = std.log.scoped(.coprocessor_handler);
|
||||
|
||||
pub fn dataTransfer(comptime InstrFn: type, comptime P: bool, comptime U: bool, comptime N: bool, comptime W: bool, comptime L: bool) InstrFn {
|
||||
_ = L;
|
||||
_ = W;
|
||||
_ = N;
|
||||
_ = U;
|
||||
_ = P;
|
||||
const Arm32 = @typeInfo(@typeInfo(InstrFn).Pointer.child).Fn.params[0].type.?;
|
||||
|
||||
return struct {
|
||||
fn inner(cpu: Arm32, _: Bus, opcode: u32) void {
|
||||
_ = cpu;
|
||||
|
||||
log.err("TODO: handle 0x{X:0>8} which is a coprocessor data transfer instr", .{opcode});
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
|
||||
pub fn registerTransfer(comptime InstrFn: type, comptime opcode1: u3, comptime L: bool, comptime opcode2: u3) InstrFn {
|
||||
_ = opcode2;
|
||||
_ = L;
|
||||
_ = opcode1;
|
||||
const Arm32 = @typeInfo(@typeInfo(InstrFn).Pointer.child).Fn.params[0].type.?;
|
||||
|
||||
return struct {
|
||||
fn inner(cpu: Arm32, _: Bus, opcode: u32) void {
|
||||
_ = cpu;
|
||||
|
||||
log.err("TODO: handle 0x{X:0>8} which is a coprocessor register transfer instr", .{opcode});
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
|
||||
pub fn dataProcessing(comptime InstrFn: type, comptime opcode1: u4, comptime opcode2: u3) InstrFn {
|
||||
_ = opcode2;
|
||||
_ = opcode1;
|
||||
const Arm32 = @typeInfo(@typeInfo(InstrFn).Pointer.child).Fn.params[0].type.?;
|
||||
|
||||
return struct {
|
||||
fn inner(cpu: Arm32, _: Bus, opcode: u32) void {
|
||||
_ = cpu;
|
||||
|
||||
log.err("TODO: handle 0x{X:0>8} which is a coprocessor data processing instr", .{opcode});
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
Reference in New Issue
Block a user