+ case 0xffffffff: /* Linux System Call */
+ {
+ unsigned int handler = cpu.asregs.sregs[1];
+ unsigned int sp = cpu.asregs.regs[1];
+ cpu.asregs.sregs[2] = 3; /* MOXIE_EX_SWI */
+
+ /* Save a slot for the static chain. */
+ sp -= 4;
+
+ /* Push the return address. */
+ sp -= 4;
+ wlat (opc, sp, pc + 6);
+
+ /* Push the current frame pointer. */
+ sp -= 4;
+ wlat (opc, sp, cpu.asregs.regs[0]);
+
+ /* Uncache the stack pointer and set the fp & pc. */
+ cpu.asregs.regs[1] = sp;
+ cpu.asregs.regs[0] = sp;
+ pc = handler - 6;
+ }