Skip to content

Commit ee54d37

Browse files
seehearfeeltsbogend
authored andcommitted
MIPS: Make check condition for SDBBP consistent with EJTAG spec
According to MIPS EJTAG Specification [1], a Debug Breakpoint exception occurs when an SDBBP instruction is executed, the CP0_DEBUG bit DBp indicates that a Debug Breakpoint exception occurred. When I read the original code, it looks a little confusing at first glance, just check bit DBp for SDBBP to make the code more readable, it will be much easier to understand. [1] http://www.t-es-t.hu/download/mips/md00047f.pdf Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent e66ef72 commit ee54d37

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

arch/mips/include/asm/mipsregs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,10 @@
10851085
#define CVMVMCONF_RMMUSIZEM1_S 0
10861086
#define CVMVMCONF_RMMUSIZEM1 (_U64CAST_(0xff) << CVMVMCONF_RMMUSIZEM1_S)
10871087

1088+
/* Debug register field definitions */
1089+
#define MIPS_DEBUG_DBP_SHIFT 1
1090+
#define MIPS_DEBUG_DBP (_ULCAST_(1) << MIPS_DEBUG_DBP_SHIFT)
1091+
10881092
/*
10891093
* Coprocessor 1 (FPU) register names
10901094
*/

arch/mips/kernel/genex.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ NESTED(ejtag_debug_handler, PT_SIZE, sp)
349349
MTC0 k0, CP0_DESAVE
350350
mfc0 k0, CP0_DEBUG
351351

352-
sll k0, k0, 30 # Check for SDBBP.
353-
bgez k0, ejtag_return
352+
andi k0, k0, MIPS_DEBUG_DBP # Check for SDBBP.
353+
beqz k0, ejtag_return
354354

355355
#ifdef CONFIG_SMP
356356
1: PTR_LA k0, ejtag_debug_buffer_spinlock

0 commit comments

Comments
 (0)