Question

I'm looking at a core dump of a (Xenon) PowerPC executable compiled with MSVC. The function I'm debugging has an op that the MSVC disassembler calls mtmsree r13. mtmsree isn't in the IBM docs for the PPC; what does this op do?

It immediately follows a mfmsr and obviously it's moving something to the machine state register, but I don't know what that ee suffix is supposed to mean. It must be some sort of cutesy Microsoft nickname for an op the PPC docs call something different.

Was it helpful?

Solution

The instruction is an extended form of the mtmsrd instruction that has the L bit set (0x00010000). Instead of modifying the entire MSR, it only modifies the EE (External interrupt Enable) and RI (Recoverable Interrupt) btis. It is faster than mtmsrd L=0 as it execution synchronizing instead of context synchronizing. It is a priviledged instruction so will cause an exception to the os, and is .: still slow.

There is public documentation for this in IBM's Book III: PowerPC Operating Environment Architecture v2.02 (page 91), http://www.ibm.com/developerworks/power/library/pa-archguidev2/?S_TACT=105AGX16&S_CMP=LP

  • Luke H

OTHER TIPS

Bits 21:30 of the mtmsr instruction are 0010010010, not 0010110010.

My guess is that mtmsree is a Xenon-specific instruction that sets only the EE bit in the MSR. The Book E machines have the wrtee and wrteei instructions to do that. I wish I knew where to find a PEM for Xenon.

I picked apart the machine code for the instruction ( 011111 01101 00001 00000 0010110010 0 ) and it turns out that mtmsree is what everyone else just calls mtmsrd.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top