Files
linux-kernel-module-cheat/baremetal/arch/aarch64/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
268 B
C

/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-exception-levels */
#include <stdio.h>
#include <inttypes.h>
int main(void) {
uint64_t el;
__asm__ ("mrs %0, CurrentEL;" : "=r" (el) : :);
printf("%" PRIu64 "\n", el >> 2);
return 0;
}