From patchwork Thu Jan 22 20:05:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 3653 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 n0MK16Qk021732 for ; Thu, 22 Jan 2009 12:01:07 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751151AbZAVUFr (ORCPT ); Thu, 22 Jan 2009 15:05:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751714AbZAVUFr (ORCPT ); Thu, 22 Jan 2009 15:05:47 -0500 Received: from ns2.suse.de ([195.135.220.15]:50500 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbZAVUFr (ORCPT ); Thu, 22 Jan 2009 15:05:47 -0500 Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D7D6C466CB; Thu, 22 Jan 2009 21:05:45 +0100 (CET) From: Alexander Graf To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] External module compatibility for hrtimer_expires_remaining Date: Thu, 22 Jan 2009 21:05:45 +0100 Message-Id: <1232654745-17842-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Due to Marcelo's APIC fix we now depend on hrtimer_expires_remaining, which is not available on my 2.6.27 kernel. This patch adds a backwards compatibility layer for it. Signed-off-by: Alexander Graf --- kernel/external-module-compat-comm.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h index 981dc96..634f717 100644 --- a/kernel/external-module-compat-comm.h +++ b/kernel/external-module-compat-comm.h @@ -501,6 +501,17 @@ struct timespec kvm_ns_to_timespec(const s64 nsec); #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) + +#define hrtimer_expires_remaining kvm_hrtimer_expires_remaining + +static inline ktime_t kvm_hrtimer_expires_remaining(const struct hrtimer *timer) +{ + return ktime_sub(timer->expires, timer->base->get_time()); +} + +#endif + /* work_struct lost the 'data' field in 2.6.20 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)