dump_regs.c 463 B

1234567891011121314151617181920212223242526
  1. /* https://cirosantilli.com/linux-kernel-module-cheat#dump-regs */
  2. #include <linux/module.h>
  3. #include <linux/kernel.h>
  4. #define LKMC_DUMP_SYSTEM_REGS_PRINTF pr_info
  5. #if defined(__aarch64__)
  6. #include <lkmc/aarch64_dump_regs.h>
  7. #else
  8. #define LKMC_DO_NOTHING
  9. #endif
  10. static int myinit(void)
  11. {
  12. #if !defined(LKMC_DO_NOTHING)
  13. lkmc_dump_system_regs();
  14. #endif
  15. return 0;
  16. }
  17. static void myexit(void) {}
  18. module_init(myinit)
  19. module_exit(myexit)
  20. MODULE_LICENSE("GPL");