xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	samuel.thibault@ens-lyon.org, wei.liu2@citrix.com
Subject: [PATCH 2/3] mini-os: provide irq on/off/save/restore functions for Mini-OS apps
Date: Tue, 30 Aug 2016 13:51:22 +0200	[thread overview]
Message-ID: <1472557883-21300-3-git-send-email-jgross@suse.com> (raw)
In-Reply-To: <1472557883-21300-1-git-send-email-jgross@suse.com>

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 <jgross@suse.com>
---
 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")
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-08-30 11:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 11:51 [PATCH 0/3] repair stubdoms Juergen Gross
2016-08-30 11:51 ` [PATCH 1/3] mini-os: support newer xen interface Juergen Gross
2016-08-30 13:53   ` Wei Liu
2016-08-30 21:30     ` Samuel Thibault
2016-08-30 11:51 ` Juergen Gross [this message]
2016-08-30 13:54   ` [Minios-devel] [PATCH 2/3] mini-os: provide irq on/off/save/restore functions for Mini-OS apps Wei Liu
2016-08-30 14:08     ` Juergen Gross
2016-08-30 21:34       ` Samuel Thibault
2016-08-30 11:51 ` [PATCH 3/3] mini-os: support "make config" for out-of-tree users Juergen Gross
2016-08-30 13:57   ` [Minios-devel] " Wei Liu
2016-09-02  1:22     ` Samuel Thibault
2016-08-30 21:38   ` Samuel Thibault
2016-09-01  6:21     ` Juergen Gross
2016-09-02  1:21       ` Samuel Thibault
2016-09-02  5:42         ` Juergen Gross
2016-09-02  7:02           ` Samuel Thibault
2016-09-02  8:26 ` [Minios-devel] [PATCH 0/3] repair stubdoms Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472557883-21300-3-git-send-email-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).