Skip to content

Instantly share code, notes, and snippets.

@imi415
Created July 22, 2021 08:19
Show Gist options
  • Save imi415/1dc833ee77d2c4a41f279af865d6c5e0 to your computer and use it in GitHub Desktop.
Save imi415/1dc833ee77d2c4a41f279af865d6c5e0 to your computer and use it in GitHub Desktop.
MMFR0 test module
#include <linux/module.h>
#include <linux/kernel.h>
static int init_mrs(void) {
u64 mmfr0_el1;
printk(KERN_INFO "MRS_TEST module initialized.\n");
asm("mrs %0, id_aa64mmfr0_el1" : "=r" (mmfr0_el1));
printk("ID_AA64MMFR0_EL1: 0x%016llx\n", mmfr0_el1);
return 0;
}
static void exit_mrs(void) {
printk(KERN_INFO "MRS_TEST module unload.\n");
}
MODULE_LICENSE("GPLv2");
module_init(init_mrs);
module_exit(exit_mrs);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment