Commit a23987ef authored by Sandipan Das's avatar Sandipan Das Committed by Michael Ellerman

powerpc: sstep: Add support for darn instruction

This adds emulation support for the following integer instructions:
  * Deliver A Random Number (darn)

As suggested by Michael, this uses a raw .long for specifying the
instruction word when using inline assembly to retain compatibility
with older binutils.
Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 930d6288
...@@ -1728,6 +1728,28 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, ...@@ -1728,6 +1728,28 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
(int) regs->gpr[rb]; (int) regs->gpr[rb];
goto arith_done; goto arith_done;
case 755: /* darn */
if (!cpu_has_feature(CPU_FTR_ARCH_300))
return -1;
switch (ra & 0x3) {
case 0:
/* 32-bit conditioned */
asm volatile(PPC_DARN(%0, 0) : "=r" (op->val));
goto compute_done;
case 1:
/* 64-bit conditioned */
asm volatile(PPC_DARN(%0, 1) : "=r" (op->val));
goto compute_done;
case 2:
/* 64-bit raw */
asm volatile(PPC_DARN(%0, 2) : "=r" (op->val));
goto compute_done;
}
return -1;
/* /*
* Logical instructions * Logical instructions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment