mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
arm exception level emulator entry examples
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-exception-level */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
int main(void) {
|
||||
register uint64_t x0 __asm__ ("x0");
|
||||
__asm__ ("mrs x0, CurrentEL;" : : : "%x0");
|
||||
printf("%" PRIu64 "\n", x0);
|
||||
register uint64_t x0 __asm__ ("x0");
|
||||
__asm__ ("mrs x0, CurrentEL;" : : : "%x0");
|
||||
printf("%" PRIu64 "\n", x0 >> 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user