Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 941d8107 authored by Michael Ellerman's avatar Michael Ellerman
Browse files

powerpc/xmon: Fix disassembly since printf changes



The recent change to add printf annotations to xmon inadvertently made
the disassembly output ugly, eg:

  c00000002001e058  7ee00026      mfcr    r23
  c00000002001e05c  fffffffffae101a0      std     r23,416(r1)
  c00000002001e060  fffffffff8230000      std     r1,0(r3)

The problem being that negative 32-bit values are being displayed in
full 64-bits.

The printf conversion was actually correct, we are passing unsigned
long so it should use "lx". But powerpc instructions are only 4 bytes
and the code only reads 4 bytes, so inst should really just be
unsigned int, and that also fixes the printing to look the way we
want:

  c00000002001e058  7ee00026      mfcr    r23
  c00000002001e05c  fae101a0      std     r23,416(r1)
  c00000002001e060  f8230000      std     r1,0(r3)

Fixes: e70d8f55 ("powerpc/xmon: Add __printf annotation to xmon_printf()")
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 021c9179
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2734,7 +2734,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr,
{
	int nr, dotted;
	unsigned long first_adr;
	unsigned long inst, last_inst = 0;
	unsigned int inst, last_inst = 0;
	unsigned char val[4];

	dotted = 0;
@@ -2758,7 +2758,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr,
		dotted = 0;
		last_inst = inst;
		if (praddr)
			printf(REG"  %.8lx", adr, inst);
			printf(REG"  %.8x", adr, inst);
		printf("\t");
		dump_func(inst, adr);
		printf("\n");