From patchwork Wed Dec 22 15:06:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 427981 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBMF7VsX014364 for ; Wed, 22 Dec 2010 15:07:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753572Ab0LVPHH (ORCPT ); Wed, 22 Dec 2010 10:07:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63842 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400Ab0LVPGc (ORCPT ); Wed, 22 Dec 2010 10:06:32 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBMF6WGX002401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 Dec 2010 10:06:32 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBMF6VSZ010588; Wed, 22 Dec 2010 10:06:31 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 9B69218D3F0; Wed, 22 Dec 2010 17:06:29 +0200 (IST) From: Gleb Natapov To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH unit-tests 07/16] Move irq_(enable|disable) into library code. Date: Wed, 22 Dec 2010 17:06:20 +0200 Message-Id: <1293030389-1143-8-git-send-email-gleb@redhat.com> In-Reply-To: <1293030389-1143-1-git-send-email-gleb@redhat.com> References: <1293030389-1143-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Dec 2010 15:07:33 +0000 (UTC) diff --git a/lib/x86/processor.h b/lib/x86/processor.h index c3ab109..52881a3 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -280,4 +280,14 @@ static inline void wrtsc(u64 tsc) asm volatile("wrmsr" : : "a"(a), "d"(d), "c"(0x10)); } +static inline void irq_disable(void) +{ + asm volatile("cli"); +} + +static inline void irq_enable(void) +{ + asm volatile("sti"); +} + #endif diff --git a/x86/apic.c b/x86/apic.c index 4f05b02..3dd2485 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -134,16 +134,6 @@ static void handle_irq(unsigned vec, void (*func)(isr_regs_t *regs)) #endif } -static void irq_disable(void) -{ - asm volatile("cli"); -} - -static void irq_enable(void) -{ - asm volatile("sti"); -} - static void eoi(void) { apic_write(APIC_EOI, 0);