AnsweredAssumed Answered

Privilege Violation Exception

Question asked by Salman Razzaq on Oct 15, 2013
Latest reply on Oct 16, 2013 by TomE

Hi,

 

I am encountering a privilege violation exception on MCF52259 MCU.

 

Whenever I am trying to disable/enable the interrupts, it throws this exception even the supervisor bit is set in Status register.

 

Here is my code: -

 

DWORD set_ipl( DWORD newIPL )

{

     DWORD curIPL;

 

     asm

     {

          // I am getting error on this line of code.

          move.w     SR,D7

          andi.l        #0x0700,D7

          lsr.l            #8,D7

 

          move.l     D7,curIPL

 

          move.l     newIPL,D7

          andi.l        #0x07,D7

          lsl.l            #8,D7

 

          move.w   SR,D6

          andi.l        #0x0000F8FF,D6

          or.l             D7,D6

          move.w    D6,SR

     }

 

     return curIPL;

}

 

Function Call

 

set_ipl(7);

set_ipl(0);

 

Any help will be highly appreciated.

 

Thanks in advance.

 

Regards.

Outcomes