Skip to contentSkip to conversation

MIPS: Add microMIPS breakpoints and DSP support.

PATCH Superseded Steven J. Hill 2 participants 2 messages May 11, 2012 – May 22, 2012 MIPS

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/9 MIPS: Add microMIPS breakpoints and DSP support.

From: "Steven J. Hill" <[email protected]>

---
 arch/mips/include/asm/break.h |   11 +++++++++--
 arch/mips/include/asm/dsp.h   |    4 ++++
 arch/mips/kernel/proc.c       |    1 +
 3 files changed, 14 insertions(+), 2 deletions(-)
arch/mips/include/asm/break.h +9 -2
index 9161e68..4e4dc87 100644
@@ -3,8 +3,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995, 2003 by Ralf Baechle
  * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1995, 2003 by Ralf Baechle
+ * Copyright (C) 2011, 2012 MIPS Technologies, Inc.
  */
 #ifndef __ASM_BREAK_H
 #define __ASM_BREAK_H
@@ -27,11 +28,17 @@
 #define BRK_STACKOVERFLOW 9	/* For Ada stackchecking */
 #define BRK_NORLD	10	/* No rld found - not used by Linux/MIPS */
 #define _BRK_THREADBP	11	/* For threads, user bp (used by debuggers) */
+
+#ifdef CONFIG_CPU_MICROMIPS
+#define BRK_BUG		12	/* Used by BUG() */
+#define BRK_KDB		13	/* Used in KDB_ENTER() */
+#else
 #define BRK_BUG		512	/* Used by BUG() */
 #define BRK_KDB		513	/* Used in KDB_ENTER() */
+#endif
+#define MM_BRK_MEMU	14	/* Used by FPU emulator (microMIPS) */
 #define BRK_MEMU	514	/* Used by FPU emulator */
 #define BRK_KPROBE_BP	515	/* Kprobe break */
 #define BRK_KPROBE_SSTEPBP 516	/* Kprobe single step software implementation */
-#define BRK_MULOVF	1023	/* Multiply overflow */
 
 #endif /* __ASM_BREAK_H */
arch/mips/include/asm/dsp.h +4 -0
index e9bfc08..3149b30 100644
@@ -16,7 +16,11 @@
 #include <asm/mipsregs.h>
 
 #define DSP_DEFAULT	0x00000000
+#ifdef CONFIG_CPU_MICROMIPS
+#define DSP_MASK	0x7f
+#else
 #define DSP_MASK	0x3ff
+#endif
 
 #define __enable_dsp_hazard()						\
 do {									\
arch/mips/kernel/proc.c +1 -0
index 5542817..2c18317 100644
@@ -64,6 +64,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 				cpu_data[n].watch_reg_masks[i]);
 		seq_printf(m, "]\n");
 	}
+	seq_printf(m, "microMIPS\t\t: %s\n", cpu_has_mmips ? "yes" : "no");
 	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
 		      cpu_has_mips16 ? " mips16" : "",
 		      cpu_has_mdmx ? " mdmx" : "",
Signature · 1 line
1.7.10
#1 lore raw

Steven,

arch/mips/kernel/proc.c static int show_cpuinfo(struct seq_file *m, void *v) · line 70

Quoted 12 lines
arch/mips/kernel/proc.c +1 -0
index 5542817..2c18317 100644
@@ -64,6 +64,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 				cpu_data[n].watch_reg_masks[i]);
 		seq_printf(m, "]\n");
 	}
+	seq_printf(m, "microMIPS\t\t: %s\n", cpu_has_mmips ? "yes" : "no");
 	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
 		      cpu_has_mips16 ? " mips16" : "",
 		      cpu_has_mdmx ? " mdmx" : "",

I'm sorry I didn't notice that before, but it got lost in the load of
formatting changes. I think this should really be reported along the other ASEs in the next line. Please move it down there, the pattern is obvious (and then the MCU ASE may be added too with a simple follow-up change).

However what I would find useful here and what I think is not reported
anywhere else and otherwise tricky (though possible) to track down is whether the kernel itself has been built as a microMIPS or standard MIPS binary. Perhaps you could reuse your entry above for that purpose -- I suppose no tool has relied on this /proc/cpuinfo entry to make any decisions so far, so it may be the right moment now to get it standardised somehow.

I'll try to get back to the rest of the microMIPS review soon, I welcome
your submission very warmly, but that's a substantial change and I'm really running out of time, sorry about that.

Maciej