AnsweredAssumed Answered

Problem in entering supervisor mode in MPC5748g

Question asked by Ashish Raikar on Nov 15, 2017
Latest reply on Nov 28, 2017 by Peter Vlna

After triggering the software interrupt 1

INTC.SSCIR[1].B.SET = 1; // to trigger a software interrupt.

 

I'm using this assembly code inside the interrupt service routine to change the PR bit of the MSR register.

1) to read the current MSR value into variable var

var is declared as:

uint32_t var = 0;

__asm__ __volatile__ ("e_lis %r30, (var)@h");

__asm__ __volatile__("e_ori %r30, %r30, (var)@l");

__asm__ __volatile__("mfmsr %r31");

__asm__ __volatile__("e_stw %r31, 0(%r30)");

 

But the e_ori instruction is intrepretted as e_mulli instruction in the disassembly, therefore its not loading the lower 16 bits into the r30 register, and returning a IVOR1 exception after executing the e_stw instruction. 

Is this the correct way to do it? please suggest some solution.

Outcomes