Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Vamshi_V
Level 1
Level 1
5 sign-ins First like given First reply posted

is it possible to switch to supervisor mode from user mode so that we can do certain task in supervisor mode and switch back to the user mode. If possible can anyone tell me the ways do that ??

@User22023 

@indra @Aishwarya 

0 Likes
1 Solution
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

There is no sample code available for this specific task, but I have received information on enter supervisor mode by trigger a trap using the SYSCALL instruction. To implement it, you should refer to ifxcpu_trap.h.

View solution in original post

0 Likes
5 Replies
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Once the system starts up, the supervisor mode is enabled.

0 Likes
Vamshi_V
Level 1
Level 1
5 sign-ins First like given First reply posted

Hi, @Di_W thank you for your reply but I need to switch to the supervisor mode from user mode in the middle of an application.Can we do that?

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Can you explain how to switch to user mode using your code? Typically, the PSW is set while in supervisor mode.

0 Likes
Vamshi_V
Level 1
Level 1
5 sign-ins First like given First reply posted

Yes, that's what we do to switch to user mode initially when it is in supervisor mode 

Ifx_CPU_PSW psw;
psw.U = __mfcr(CPU_PSW);
psw.B.IO = 0x1;
__mtcr(CPU_PSW , psw.U);

This is the code that I use to switch to user mode but we cannot access the PSW register once we shift to the user mode right that's where the real problem comes. 

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

There is no sample code available for this specific task, but I have received information on enter supervisor mode by trigger a trap using the SYSCALL instruction. To implement it, you should refer to ifxcpu_trap.h.

0 Likes