userland/arch/aarch64/dump_regs.c

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-06-03 01:00:00 +00:00
parent 1341df0682
commit ed369cd57e
3 changed files with 20 additions and 1 deletions

View File

@@ -9300,8 +9300,10 @@ Converting `arch/*` images to `vmlinux` is possible in theory x86 with https://g
The following kernel modules and <<baremetal>> executables dump and disassemble various registers which cannot be observed from userland (usually "system registers", "control registers"):
* link:kernel_modules/dump_regs.c[]
* link:baremetal/arch/aarch64/dump_regs.c[]
* link:userland/arch/arm/dump_regs.c[]
* link:userland/arch/aarch64/dump_regs.c[]
* link:baremetal/arch/arm/dump_regs.c[]
* link:baremetal/arch/aarch64/dump_regs.c[]
Some of those programs are using:

View File

@@ -544,6 +544,10 @@ path_properties_tuples = (
},
},
),
'dump_regs.c': {
# https://gem5.atlassian.net/browse/GEM5-619
'allowed_emulators': {'qemu'},
},
'freestanding': (
freestanding_properties,
{

View File

@@ -0,0 +1,13 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#dump-regs */
#include <stdio.h>
#include <stdlib.h>
#include <lkmc.h>
#include <lkmc/aarch64.h>
int main(void) {
lkmc_sysreg_print_cntvct_el0();
lkmc_sysreg_print_cntfrq_el0();
return EXIT_SUCCESS;
}