[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/3] mini-os: provide irq on/off/save/restore functions for Mini-OS apps



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@xxxxxxxx>
---
 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.