dep.c 500 B

12345678910111213141516171819202122232425
  1. /* https://github.com/cirosantilli/linux-kernel-module-cheat#kernel-module-dependencies */
  2. #include <linux/debugfs.h>
  3. #include <linux/kernel.h>
  4. #include <linux/module.h>
  5. u32 lkmc_dep = 0;
  6. EXPORT_SYMBOL(lkmc_dep);
  7. static struct dentry *debugfs_file;
  8. static int myinit(void)
  9. {
  10. debugfs_file = debugfs_create_u32("lkmc_dep", S_IRUSR | S_IWUSR, NULL, &lkmc_dep);
  11. return 0;
  12. }
  13. static void myexit(void)
  14. {
  15. debugfs_remove(debugfs_file);
  16. }
  17. module_init(myinit)
  18. module_exit(myexit)
  19. MODULE_LICENSE("GPL");