+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c: Include sim-syscall.h.
+ (sim_engine_run): Call sim_syscall for brki instructions.
+
2021-05-04 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
#include "sim-main.h"
#include "sim-options.h"
+#include "sim-syscall.h"
#include "microblaze-dis.h"
IMM_ENABLE = 0;
}
else
- /* no delay slot: increment cycle count */
- bonus_cycles++;
+ {
+ if (op == brki && IMM == 8)
+ {
+ RETREG = sim_syscall (cpu, CPU.regs[12], CPU.regs[5],
+ CPU.regs[6], CPU.regs[7],
+ CPU.regs[8]);
+ PC = RD + INST_SIZE;
+ }
+
+ /* no delay slot: increment cycle count */
+ bonus_cycles++;
+ }
}
}
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * pass.s: Delete output line.
+ * testutils.inc (system_call, write): New macros.
+ (exit): Mark nr required.
+ (pass, fail): Call write
+ * fail.s: New test.
+
2021-04-08 Mike Frysinger <vapier@gentoo.org>
* allinsn.exp (arch): Delete.
--- /dev/null
+# check that the sim doesn't die immediately.
+# mach: microblaze
+# status: 1
+# output: fail\n
+
+.include "testutils.inc"
+
+ start
+ fail
# check that the sim doesn't die immediately.
# mach: microblaze
-# output:
.include "testutils.inc"
+# MACRO: system_call
+# Make a libgloss/Linux system call
+ .macro system_call nr:req
+ addi r12, r0, \nr;
+ brki r14, 8;
+ .endm
+
# MACRO: exit
- .macro exit nr
+ .macro exit nr:req
addi r3, r0, \nr;
bri 0;
.endm
# MACRO: pass
# Write 'pass' to stdout and quit
.macro pass
+ write 1, 1f, 5
exit 0
.data
1: .asciz "pass\n"
# MACRO: fail
# Write 'fail' to stdout and quit
.macro fail
+ write 1, 1f, 5
exit 1
.data
1: .asciz "fail\n"
.global _start
_start:
.endm
+
+# MACRO: write
+# Just like the write() C function; uses system calls
+ .macro write fd:req, buf:req, count:req
+ addi r5, r0, \fd;
+ addi r6, r0, \buf;
+ addi r7, r0, \count;
+ system_call 5
+ .endm