000-portability.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --- a/src/Makefile.am
  2. +++ b/src/Makefile.am
  3. @@ -154,7 +154,7 @@ if KERNEL_2_6
  4. drv_tapi_OBJS = "$(subst .c,.o, $(drv_tapi_SOURCES))"
  5. drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA_DIST)
  6. - @echo -e "Making Linux 2.6.x kernel object"
  7. + @echo "Making Linux 2.6.x kernel object"
  8. @for f in $(drv_tapi_SOURCES) ; do \
  9. if test ! -e $(PWD)/$$f; then \
  10. echo " LN $$f" ; \
  11. @@ -162,10 +162,10 @@ drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA
  12. ln -s @abs_srcdir@/$$f $(PWD)/$$f; \
  13. fi; \
  14. done;
  15. - @echo -e "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
  16. - @echo -e "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
  17. - @echo -e "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
  18. - @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
  19. + @echo "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
  20. + @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
  21. + @echo "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
  22. + @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
  23. $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
  24. clean-generic:
  25. --- a/configure.in
  26. +++ b/configure.in
  27. @@ -128,7 +128,7 @@ dnl Set kernel build path
  28. AC_ARG_ENABLE(kernelbuild,
  29. AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path),
  30. [
  31. - if test -r $enableval/include/linux/autoconf.h; then
  32. + if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
  33. AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
  34. else
  35. AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
  36. --- a/src/drv_tapi_linux.h
  37. +++ b/src/drv_tapi_linux.h
  38. @@ -24,6 +24,7 @@
  39. #include <linux/version.h>
  40. #include <linux/interrupt.h> /* in_interrupt() */
  41. #include <linux/delay.h> /* mdelay - udelay */
  42. +#include <linux/workqueue.h> /* work_struct */
  43. #include <asm/poll.h> /* POLLIN, POLLOUT */
  44. #include "ifx_types.h" /* ifx type definitions */
  45. --- a/src/drv_tapi_linux.c
  46. +++ b/src/drv_tapi_linux.c
  47. @@ -47,6 +47,7 @@
  48. #include <linux/errno.h>
  49. #include <asm/uaccess.h> /* copy_from_user(), ... */
  50. #include <asm/byteorder.h>
  51. +#include <linux/smp_lock.h> /* lock_kernel() */
  52. #include <asm/io.h>
  53. #ifdef LINUX_2_6
  54. @@ -55,7 +56,11 @@
  55. #include <linux/sched.h>
  56. #undef CONFIG_DEVFS_FS
  57. #ifndef UTS_RELEASE
  58. - #include "linux/utsrelease.h"
  59. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
  60. +# include <linux/utsrelease.h>
  61. +#else
  62. +# include <generated/utsrelease.h>
  63. +#endif
  64. #endif /* UTC_RELEASE */
  65. #else
  66. #include <linux/tqueue.h>
  67. @@ -3718,7 +3723,11 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
  68. flag and released after the down() call. */
  69. lock_kernel();
  70. mb();
  71. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
  72. kill_proc(pThrCntrl->tid, SIGKILL, 1);
  73. +#else
  74. + kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
  75. +#endif
  76. /* release the big kernel lock */
  77. unlock_kernel();
  78. wait_for_completion (&pThrCntrl->thrCompletion);