compat.h 836 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. *
  3. * @file compat.h
  4. * @author Michael Stapelberg
  5. * @date 2009-04-05
  6. * @brief Contains compatibility definitions for the different linux kernel versions to avoid
  7. * putting ifdefs all over the driver code.
  8. *
  9. */
  10. #ifndef _COMPAT_H
  11. #define _COMPAT_H
  12. #include <linux/version.h>
  13. /* Check macros and kernel version first */
  14. #ifndef KERNEL_VERSION
  15. # error "No KERNEL_VERSION macro! Stopping."
  16. #endif
  17. #ifndef LINUX_VERSION_CODE
  18. # error "No LINUX_VERSION_CODE macro! Stopping."
  19. #endif
  20. #if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
  21. # error "Linux 3.2 and latter are supported"
  22. #endif
  23. /* VM_RESERVED is removed in 3.7-rc1 */
  24. #ifndef VM_RESERVED
  25. # define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP)
  26. #endif
  27. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
  28. # define __devinit
  29. # define __devexit
  30. # define __devinitdata
  31. #endif
  32. #endif