Files
linux-kernel-module-cheat/baremetal/arch/arm/el.c
Ciro Santilli 六四事件 法轮功 add6eedb76 baremetal: all examples working, all failures accounted for!
SIMD&FP is now enabled in arm from bootloader.
2019-05-25 00:00:01 +00:00

12 lines
270 B
C

/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-exception-levels */
#include <stdio.h>
#include <inttypes.h>
int main(void) {
uint32_t cpsr;
__asm__ ("mrs %0, CPSR" : "=r" (cpsr) : :);
printf("%" PRIu32 "\n", cpsr & 0x1F);
return 0;
}