Skip to contentSkip to conversation

Blackfin arch: Fix decoding of opcodes 41-47 in decode_instruction()

PATCH In review Roel Kluin 2 participants 2 messages Jan 8, 2010 – Jan 9, 2010

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Blackfin arch: Fix decoding of opcodes 41-47 in decode_instruction()

This condition allowed only decoding of opcode 0x0040

---
 arch/blackfin/kernel/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Found with static code analysis. Correct?

arch/blackfin/kernel/traps.c +1 -1
index d3cbcd6..870d74b 100644
@@ -712,7 +712,7 @@ static void decode_instruction(unsigned short *address)
 			verbose_printk("RTE");
 		else if (opcode == 0x0025)
 			verbose_printk("EMUEXCPT");
-		else if (opcode == 0x0040 && opcode <= 0x0047)
+		else if (opcode >= 0x0040 && opcode <= 0x0047)
 			verbose_printk("STI R%i", opcode & 7);
 		else if (opcode >= 0x0050 && opcode <= 0x0057)
 			verbose_printk("JUMP (P%i)", opcode & 7);
#1 lore raw
Quoted 8 lines · Roel Kluin

This condition allowed only decoding of opcode 0x0040

---
 arch/blackfin/kernel/traps.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)

Found with static code analysis. Correct?

looks like it to me:

   0:   40 00           STI R0;
   2:   41 00           STI R1;
   4:   42 00           STI R2;
   6:   43 00           STI R3;
   8:   44 00           STI R4;
   a:   45 00           STI R5;
   c:   46 00           STI R6;
   e:   47 00           STI R7;

ive added this to the Blackfin repo, thanks
-mike