Current value using as a trap instruction (0xefefefef) is not a good choice for MIPS because it's a valid MIPS instruction swc3 $15,-4113(ra). This patch replaces 0xefefefef by 0x04170001. For all MIPS ISA revisions before R6, this value is just invalid instruction. Starting from MIPS R6 it's a valid instruction sigrie 1 which signals a Reserved Instruction exception.
mips-traps.s test case is added to test trap encoding. Other test cases are modified to remove redundant checking.
Maybe I'm being stupid, but won't this do the wrong thing on a big-endian host? If, say, we're building for mips64 on mips64, Config->IsLE and sys::IsLittleEndianHost will both be false, so we'll take the write32le path, which will write 0x04170001 (represented in-memory natively as big-endian) as a little-endian value, i.e. incorrectly byte-swapping? It seems to me like this should be just a check for if (Config->IsLE)?