1 #include <linux/kernel.h>
2 #include <linux/module.h>
3 #include <linux/export.h>
5 #include <linux/vmalloc.h>
6 #include <linux/slab.h>
7 #include <linux/sizes.h>
11 #include <asm/bootinfo.h>
20 static int __init
test_debug_virtual_init(void)
25 va
= (void *)VMALLOC_START
;
26 pa
= virt_to_phys(va
);
28 pr_info("PA: %pa for VA: 0x%lx\n", &pa
, (unsigned long)va
);
30 foo
= kzalloc(sizeof(*foo
), GFP_KERNEL
);
34 pa
= virt_to_phys(foo
);
36 pr_info("PA: %pa for VA: 0x%lx\n", &pa
, (unsigned long)va
);
40 module_init(test_debug_virtual_init
);
42 static void __exit
test_debug_virtual_exit(void)
46 module_exit(test_debug_virtual_exit
);
48 MODULE_LICENSE("GPL");
49 MODULE_DESCRIPTION("Test module for CONFIG_DEBUG_VIRTUAL");