diff --git a/README.adoc b/README.adoc index edd841e..295995c 100644 --- a/README.adoc +++ b/README.adoc @@ -9300,8 +9300,10 @@ Converting `arch/*` images to `vmlinux` is possible in theory x86 with https://g The following kernel modules and <> 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: diff --git a/path_properties.py b/path_properties.py index 7316296..f51b13d 100644 --- a/path_properties.py +++ b/path_properties.py @@ -544,6 +544,10 @@ path_properties_tuples = ( }, }, ), + 'dump_regs.c': { + # https://gem5.atlassian.net/browse/GEM5-619 + 'allowed_emulators': {'qemu'}, + }, 'freestanding': ( freestanding_properties, { diff --git a/userland/arch/aarch64/dump_regs.c b/userland/arch/aarch64/dump_regs.c new file mode 100644 index 0000000..947dc76 --- /dev/null +++ b/userland/arch/aarch64/dump_regs.c @@ -0,0 +1,13 @@ +/* https://cirosantilli.com/linux-kernel-module-cheat#dump-regs */ + +#include +#include + +#include +#include + +int main(void) { + lkmc_sysreg_print_cntvct_el0(); + lkmc_sysreg_print_cntfrq_el0(); + return EXIT_SUCCESS; +}