200-linux-37.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --- a/src/drv_tapi_linux.c
  2. +++ b/src/drv_tapi_linux.c
  3. @@ -47,7 +47,9 @@
  4. #include <linux/errno.h>
  5. #include <asm/uaccess.h> /* copy_from_user(), ... */
  6. #include <asm/byteorder.h>
  7. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
  8. #include <linux/smp_lock.h> /* lock_kernel() */
  9. +#endif
  10. #include <asm/io.h>
  11. #ifdef LINUX_2_6
  12. @@ -65,7 +67,9 @@
  13. #else
  14. #include <linux/tqueue.h>
  15. #include <linux/sched.h>
  16. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
  17. #include <linux/smp_lock.h> /* lock_kernel() */
  18. +#endif
  19. #endif /* LINUX_2_6 */
  20. #include "drv_tapi.h"
  21. @@ -133,8 +137,13 @@
  22. size_t count, loff_t * ppos);
  23. static ssize_t ifx_tapi_read(struct file * filp, char *buf,
  24. size_t length, loff_t * ppos);
  25. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  26. static int ifx_tapi_ioctl(struct inode *inode, struct file *filp,
  27. unsigned int nCmd, unsigned long nArgument);
  28. +#else
  29. +static long ifx_tapi_ioctl(struct file *filp,
  30. + unsigned int nCmd, unsigned long nArgument);
  31. +#endif
  32. static unsigned int ifx_tapi_poll (struct file *filp, poll_table *table);
  33. #ifdef CONFIG_PROC_FS
  34. @@ -218,7 +227,11 @@
  35. IFX_char_t *pRegDrvName = IFX_NULL;
  36. IFX_int32_t ret = 0;
  37. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  38. if (tapi_fops.ioctl == IFX_NULL)
  39. +#else
  40. + if (tapi_fops.unlocked_ioctl == IFX_NULL)
  41. +#endif
  42. {
  43. #ifdef MODULE
  44. tapi_fops.owner = THIS_MODULE;
  45. @@ -226,7 +239,11 @@
  46. tapi_fops.read = ifx_tapi_read;
  47. tapi_fops.write = ifx_tapi_write;
  48. tapi_fops.poll = ifx_tapi_poll;
  49. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  50. tapi_fops.ioctl = ifx_tapi_ioctl;
  51. +#else
  52. + tapi_fops.unlocked_ioctl = ifx_tapi_ioctl;
  53. +#endif
  54. tapi_fops.open = ifx_tapi_open;
  55. tapi_fops.release = ifx_tapi_release;
  56. }
  57. @@ -881,8 +898,13 @@
  58. - 0 and positive values - success
  59. - negative value - ioctl failed
  60. */
  61. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  62. static int ifx_tapi_ioctl(struct inode *inode, struct file *filp,
  63. unsigned int nCmd, unsigned long nArg)
  64. +#else
  65. +static long ifx_tapi_ioctl(struct file *filp,
  66. + unsigned int nCmd, unsigned long nArg)
  67. +#endif
  68. {
  69. TAPI_FD_PRIV_DATA_t *pTapiPriv;
  70. IFX_TAPI_ioctlCtx_t ctx;
  71. @@ -3721,7 +3743,9 @@
  72. kernel lock (lock_kernel()). The lock must be
  73. grabbed before changing the terminate
  74. flag and released after the down() call. */
  75. - lock_kernel();
  76. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
  77. + lock_kernel();
  78. +#endif
  79. mb();
  80. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
  81. kill_proc(pThrCntrl->tid, SIGKILL, 1);
  82. @@ -3729,8 +3753,10 @@
  83. kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
  84. #endif
  85. /* release the big kernel lock */
  86. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
  87. unlock_kernel();
  88. - wait_for_completion (&pThrCntrl->thrCompletion);
  89. +#endif
  90. + wait_for_completion (&pThrCntrl->thrCompletion);
  91. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
  92. /* Now we are sure the thread is in zombie state.
  93. --- a/src/lib/lib_fifo/lib_fifo.c
  94. +++ b/src/lib/lib_fifo/lib_fifo.c
  95. @@ -41,7 +41,7 @@
  96. #ifdef LINUX
  97. /* if linux/slab.h is not available, use the precessor linux/malloc.h */
  98. #include <linux/slab.h>
  99. -#elif VXWORKS
  100. +#elif defined(VXWORKS)
  101. #include <sys_drv_debug.h>
  102. #endif /* LINUX */