From patchwork Tue Aug 30 11:51:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Gross X-Patchwork-Id: 9305277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 76B95607D2 for ; Tue, 30 Aug 2016 11:55:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67EEE28503 for ; Tue, 30 Aug 2016 11:55:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C96328B9A; Tue, 30 Aug 2016 11:55:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D8C4428503 for ; Tue, 30 Aug 2016 11:55:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1behZm-0001Qk-K9; Tue, 30 Aug 2016 11:51:34 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1behZm-0001PV-3T; Tue, 30 Aug 2016 11:51:34 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 34/FC-12874-54375C75; Tue, 30 Aug 2016 11:51:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRWlGSWpSXmKPExsVyuP0Ov65L8dF wg/n3dC3efl3CbPF9y2QmByaPwx+usAQwRrFm5iXlVySwZhw5K1hwg7+i9e4K5gbGw7xdjJwc EgJGEm8n/mPqYuTiEBJYyChxZfJ0dpAEm4CqxIbrp1hBbBEBN4kv32exgdjMAhEScz6cYgGxh YHsPXPPANkcHCxA9bvmR4OEeQXsJXb+ucUKMV9O4vrM6UwgNqeAg8SThQvBxggB1Sy8/IJ5Ai P3AkaGVYzqxalFZalFuhZ6SUWZ6RkluYmZObqGBqZ6uanFxYnpqTmJScV6yfm5mxiBPmYAgh2 MB5udDzFKcjApifJOjT8SLsSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mCd0bh0XAhwaLU9NSKtMwc YLDBpCU4eJREeNWLgNK8xQWJucWZ6RCpU4yKUuK8R0D6BEASGaV5cG2wAL/EKCslzMsIdIgQT 0FqUW5mCar8K0ZxDkYlYV42kPE8mXklcNNfAS1mAlpccOcwyOKSRISUVAOj0Qx1k9z93uoLsq LOtuYIWMov9J18MzxlstDDU5V34md/mLzTfkrwp5NrDx73+jYrvd5WedImxRx2d7sPNVoPy7I 7Z0lYfv7AKNHH83XCMq9bcmUZZabLTRWrTeZorezsLf/LVehy5sHkLX5mGd4yu81/MiX3aK79 +qmHcV785qeyXoE+s18rsRRnJBpqMRcVJwIApNdP0GsCAAA= X-Env-Sender: jgross@suse.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1472557891!44727382!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31287 invoked from network); 30 Aug 2016 11:51:32 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-11.tower-206.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 30 Aug 2016 11:51:32 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4FCE3ABF0; Tue, 30 Aug 2016 11:51:31 +0000 (UTC) From: Juergen Gross To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org Date: Tue, 30 Aug 2016 13:51:22 +0200 Message-Id: <1472557883-21300-3-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1472557883-21300-1-git-send-email-jgross@suse.com> References: <1472557883-21300-1-git-send-email-jgross@suse.com> Cc: Juergen Gross , samuel.thibault@ens-lyon.org, wei.liu2@citrix.com Subject: [Xen-devel] [PATCH 2/3] mini-os: provide irq on/off/save/restore functions for Mini-OS apps X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Provide non-inline variants of the local_irq_*() functions for Mini-OS apps which should not depend on Mini-OS configuration. Signed-off-by: Juergen Gross Reviewed-by: Wei Liu Acked-by: Samuel Thibault --- arch/x86/sched.c | 28 ++++++++++++++++++++++++++++ include/x86/os.h | 13 +++++++++++++ 2 files changed, 41 insertions(+) diff --git a/arch/x86/sched.c b/arch/x86/sched.c index ec13694..e7b6954 100644 --- a/arch/x86/sched.c +++ b/arch/x86/sched.c @@ -135,5 +135,33 @@ void run_idle_thread(void) #endif } +unsigned long __local_irq_save(void) +{ + unsigned long flags; + local_irq_save(flags); + return flags; +} +void __local_irq_restore(unsigned long flags) +{ + local_irq_restore(flags); +} + +unsigned long __local_save_flags(void) +{ + unsigned long flags; + + local_save_flags(flags); + return flags; +} + +void __local_irq_disable(void) +{ + local_irq_disable(); +} + +void __local_irq_enable(void) +{ + local_irq_enable(); +} diff --git a/include/x86/os.h b/include/x86/os.h index e118b91..90ab6e6 100644 --- a/include/x86/os.h +++ b/include/x86/os.h @@ -176,11 +176,24 @@ static inline int irqs_disabled(void) #endif +#ifdef __INSIDE_MINIOS__ #define local_irq_save(x) __save_and_cli(x) #define local_irq_restore(x) __restore_flags(x) #define local_save_flags(x) __save_flags(x) #define local_irq_disable() __cli() #define local_irq_enable() __sti() +#else +unsigned long __local_irq_save(void); +void __local_irq_restore(unsigned long flags); +unsigned long __local_save_flags(void); +void __local_irq_disable(void); +void __local_irq_enable(void); +#define local_irq_save(x) x = __local_irq_save() +#define local_irq_restore(x) __local_irq_restore(x) +#define local_save_flags(x) x = __local_save_flags() +#define local_irq_disable() __local_irq_disable() +#define local_irq_enable() __local_irq_enable() +#endif /* This is a barrier for the compiler only, NOT the processor! */ #define barrier() __asm__ __volatile__("": : :"memory")