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