cpukit/score/cpu/microblaze: Use a reserved opcode

_CPU_Instruction_illegal() emitted ".word 0x0".  Major opcode 0 is
"add", so the word is "add r0, r0, r0" and retires without an exception
unless the core is synthesized with C_OPCODE_0x0_ILLEGAL.  Both this
option and C_ILL_OPCODE_EXCEPTION are synthesis options of the soft
core, and QEMU defaults both to false.

Use major opcode 0x3f, which is unallocated in the MicroBlaze
architecture.  An invalid major opcode requires only
C_ILL_OPCODE_EXCEPTION to raise an illegal opcode exception.

Close #5759.

Signed-off-by: Aaditya Agarwal <aadityaagarwal894@gmail.com>
This commit is contained in:
Aaditya Agarwal authored and Joel Sherrill committed 2026-11-14 13:49:00 -06:00
1 parent 3c0e1be44d
commit 51c7966892
1 file changed
+7 -1
@@ -91,7 +91,13 @@ void _CPU_Context_validate( uintptr_t pattern );
static inline void _CPU_Instruction_illegal( void )
{
__asm__ volatile ( ".word 0x0" );
/*
* A ".word 0x0" is an "add r0, r0, r0" on this architecture, which retires
* without an exception unless the core is synthesized with
* C_OPCODE_0x0_ILLEGAL. The major opcode 0x3f is unallocated, so it raises
* the illegal opcode exception requiring only C_ILL_OPCODE_EXCEPTION.
*/
__asm__ volatile ( ".word 0xfc000000" );
}
static inline void _CPU_Instruction_no_operation( void )