my_mmap.h 690 B

12345678910111213141516171819202122232425
  1. #ifndef _MY_MMAP_H
  2. #define _MY_MMAP_H
  3. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
  4. typedef unsigned long (* do_mmap_pgoff_t)(struct file *file, unsigned long addr,
  5. unsigned long len, unsigned long prot,
  6. unsigned long flags,
  7. unsigned long pgoff, unsigned long *populate);
  8. static do_mmap_pgoff_t my_do_mmap_pgoff = NULL;
  9. #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
  10. typedef unsigned long (* do_mmap_pgoff_t)(struct file *file, unsigned long addr,
  11. unsigned long len, unsigned long prot,
  12. unsigned long flags,
  13. unsigned long pgoff);
  14. static do_mmap_pgoff_t my_do_mmap_pgoff = NULL;
  15. #endif //kernel version >=3.4
  16. #endif //_MY_MMAP_H