[kgtp] r990 committed - Try to fix the build bug in ARM linux 2.6.3x

  • From: kgtp@xxxxxxxxxxxxxx
  • To: kgtp@xxxxxxxxxxxxx
  • Date: Wed, 28 Mar 2012 03:38:28 +0000

Revision: 990
Author:   teawater
Date:     Tue Mar 27 20:38:10 2012
Log:      Try to fix the build bug in ARM linux 2.6.3x

http://code.google.com/p/kgtp/source/detail?r=990

Modified:
 /trunk/gtp_rb.c

=======================================
--- /trunk/gtp_rb.c     Mon Mar 12 06:54:29 2012
+++ /trunk/gtp_rb.c     Tue Mar 27 20:38:10 2012
@@ -39,7 +39,11 @@
 };

 static struct gtp_rb_s __percpu        *gtp_rb;
-static atomic64_t              gtp_rb_count;
+#if defined(CONFIG_ARM) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34))
+static atomic_t                                gtp_rb_count;
+#else
+static atomic64_t                      gtp_rb_count;
+#endif
 static unsigned int            gtp_rb_page_count;
 static atomic_t                        gtp_rb_discard_page_number;

@@ -88,14 +92,22 @@
                rb->rp_id = 0;
        }

+#if defined(CONFIG_ARM) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34))
+       atomic_set(&gtp_rb_count, 0);
+#else
        atomic64_set(&gtp_rb_count, 0);
+#endif
        atomic_set(&gtp_rb_discard_page_number, 0);
 }

 static inline u64
 gtp_rb_clock(void)
 {
+#if defined(CONFIG_ARM) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34))
+       return (u64)atomic_inc_return(&gtp_rb_count);
+#else
        return atomic64_inc_return(&gtp_rb_count);
+#endif
 }

 #define GTP_RB_PAGE_IS_EMPTY   (gtp_rb_page_count == 0)

Other related posts:

  • » [kgtp] r990 committed - Try to fix the build bug in ARM linux 2.6.3x - kgtp