We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
asm("str lr,[sp, #-4]!"); asm("smc #0"); asm("mrc p15, 0, %0, c9, c1, 2" : "=r" (tcm_secure)); tcm_secure |= 1; asm("mcr p15, 0, %0, c9, c1, 2" /* set DTCM NS bit to 1 */ : : "r" (tcm_secure)); asm("movs pc, lr"); asm("ldr lr, [sp, #0]!");
The SMC instruction (from a privileged processor mode) will cause the core to trap execution to the exception table in Monitor mode, just like a user-kernel switch using the "SVC" instruction. So you can't just drop an "SMC" inline with your program code, that's not likely to work.What does happen when you reach the monitor exception table is entirely down to the monitor mode software which is installed, so I can't help on that bit =)