From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: [PATCH 3/3] compat code fixes for RHEL5 kernels Date: Fri, 23 Jan 2009 16:41:35 -0200 Message-ID: <1232736095-26244-4-git-send-email-ehabkost@redhat.com> References: <1232736095-26244-1-git-send-email-ehabkost@redhat.com> Cc: kvm@vger.kernel.org, Andrea Arcangeli , Eduardo Habkost To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:37025 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753562AbZAWSlz (ORCPT ); Fri, 23 Jan 2009 13:41:55 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0NIfsbW007849 for ; Fri, 23 Jan 2009 13:41:54 -0500 In-Reply-To: <1232736095-26244-1-git-send-email-ehabkost@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Andrea Arcangeli Compat code for some RHEL5 kernel versions. This patch also applies to the maint/2.6.29 branch. [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)] Signed-off-by: Andrea Arcangeli Signed-off-by: Eduardo Habkost --- 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 981dc96..7f4d591 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 +#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 -- 1.6.1