I'm trying to read the SCR from the A15.
unsigned nsacr, scr;
__asm__ __volatile__("mrc p15, 0, %0, c1, c1, 0" : "=r"(scr));
printf("Secure config register = %x\n", scr);
The same is true for the NSACR:
__asm__ __volatile__("mrc p15, 0, %0, c1, c1, 2" : "=r"(nsacr));
printf("NSACR = 0x%x\n", nsacr);
When I run the above inlined assembly code, the processor hangs.
ARM's ducumentaiton suggests that both should be readable in Secure Mode, and the second should be readable in non-secure mode - how can I tell whether I am in secure mode or not?
If I am not in secure mode, how can I switch to it?
Thanks.