Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 17

kvm-83-164.el5_5.30.src.rpm

From e307220de5ee5b73353848454c5e1c9f15e6d660 Mon Sep 17 00:00:00 2001
From: Andrea Arcangeli <aarcange@redhat.com>
Date: Thu, 15 Jan 2009 07:26:49 +0100
Subject: [PATCH 16/54] compat code fixes for RHEL 5.3

Compat code for rhel 5.3 (and some RHEL 5.2 kernel versions).

[ehabkost: changed pagefault_* to check for RHEL < 5.2 instead of RHEL <= 5.2]
[ehabkost: changed __aligned to check for RHEL <= 5.2 && !defined(__aligned)]
[ehabkost: changed patch description to mention that some RHEL 5.2 kernels
           need this also]

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Type: bugfix(build)
RH-Upstream-status: submitted(kvm-devel)
---
 kernel/external-module-compat-comm.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 5cb70b0..22b3613 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -250,6 +250,7 @@ static inline void blahblah(void)
 
 /* pagefault_enable(), page_fault_disable() - 2.6.20 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2)
 
 static inline void pagefault_disable(void)
 {
@@ -276,6 +277,9 @@ static inline void pagefault_enable(void)
 	preempt_check_resched();
 }
 
+#else
+#include <linux/uaccess.h>
+#endif
 #endif
 
 /* vm ops ->fault() was introduced in 2.6.23. */
@@ -405,8 +409,10 @@ static inline ktime_t ktime_get(void)
 
 /* __aligned arrived in 2.6.21 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+#if !defined(RHEL_RELEASE_CODE) || (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(5,2) && !defined(__aligned))
 #define __aligned(x) __attribute__((__aligned__(x)))
 #endif
+#endif
 
 #include <linux/mm.h>
 
-- 
1.6.1