From patchwork Fri Jan 23 18:41:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 3814 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0NIbKkq006493 for ; Fri, 23 Jan 2009 10:37:21 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753562AbZAWSl5 (ORCPT ); Fri, 23 Jan 2009 13:41:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755514AbZAWSl4 (ORCPT ); Fri, 23 Jan 2009 13:41:56 -0500 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 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0NIfsQ4017194; Fri, 23 Jan 2009 13:41:54 -0500 Received: from blackpad.localdomain (vpn-10-13.bos.redhat.com [10.16.10.13]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0NIfsuD010612; Fri, 23 Jan 2009 13:41:54 -0500 Received: by blackpad.localdomain (Postfix, from userid 500) id 8517C6806A3; Fri, 23 Jan 2009 16:41:35 -0200 (BRST) From: Eduardo Habkost To: Avi Kivity Cc: kvm@vger.kernel.org, Andrea Arcangeli , 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> In-Reply-To: <1232736095-26244-1-git-send-email-ehabkost@redhat.com> References: <1232736095-26244-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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