mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
factor out baremetal aarch64 dump_regs.c for kernel module usage
Create dump-regs section.
This commit is contained in:
25
kernel_modules/dump_regs.c
Normal file
25
kernel_modules/dump_regs.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/* https://cirosantilli.com/linux-kernel-module-cheat#dump-regs */
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#define LKMC_DUMP_SYSTEM_REGS_PRINTF pr_info
|
||||
#if defined(__aarch64__)
|
||||
#include <lkmc/aarch64_dump_regs.h>
|
||||
#else
|
||||
#define LKMC_DO_NOTHING
|
||||
#endif
|
||||
|
||||
static int myinit(void)
|
||||
{
|
||||
#if !defined(LKMC_DO_NOTHING)
|
||||
LKMC_DUMP_SYSTEM_REGS;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myexit(void) {}
|
||||
|
||||
module_init(myinit)
|
||||
module_exit(myexit)
|
||||
MODULE_LICENSE("GPL");
|
||||
Reference in New Issue
Block a user