On 01/17/2013 02:54 PM, Ralf Baechle wrote:
On Thu, Jan 17, 2013 at 10:15:49AM -0800, David Daney wrote:
diff --git a/arch/mips/include/asm/break.h b/arch/mips/include/asm/break.h
index 9161e68..df9d090 100644
@@ -27,6 +27,7 @@
#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) */
+#define BRK_BUG_MM 12 /* Used by BUG() in microMIPS mode */
#define BRK_BUG 512 /* Used by BUG() */
Can we move the CONFIG_CPU_MICROMIPS to here and just call the thing
Or perhaps redefining it unconditionally. I am not sure what the
implications of doing that would be.
The kernel decodes break and trap instruction in traps.c. For a microMIPS-
enabled kernel it needs to be able to decode both classic and microMIPS
encoded instructions so we want separate symbols.
For any given kernel, BUG() will be implemented using exactly one trap
value. That should be the value tested in traps.c
So we could make non-microMIPS use the same value as microMIPS and then
we don't have to test for two values.
Side note: The values used only internally to the kernel should not be
exported in a userspace visible header file.
Or we do something like
#define BRK_MM_BUG 12 /* Used by BUG() in microMIPS mode */
#define BRK_CM_BUG 512 /* Used by BUG() */
#define BRK_BUG BRK_MM_BUG
#define BRK_BUG BRK_CM_BUG
This makes the BRK_MM_* / BRK_CM_* macros available for decoding instructions
and the microMIPS-agnostic BRK_BUG for code such as BUG().
#define BRK_KDB 513 /* Used in KDB_ENTER() */
#define BRK_MEMU 514 /* Used by FPU emulator */
diff --git a/arch/mips/include/asm/bug.h b/arch/mips/include/asm/bug.h
index 540c98a..b716fb9 100644
@@ -7,6 +7,10 @@
+#define BRK_BUG BRK_BUG_MM
...We don't need this bit. Doing an #undef risks using different
values for BRK_BUG depending on whether or not asm/bug.h is
And generally is not very elegant.