]> xenbits.xensource.com Git - mini-os.git/commitdiff
mini-os: provide irq on/off/save/restore functions for Mini-OS apps
authorJuergen Gross <jgross@suse.com>
Tue, 30 Aug 2016 11:51:22 +0000 (13:51 +0200)
committerWei Liu <wei.liu2@citrix.com>
Fri, 2 Sep 2016 08:24:53 +0000 (09:24 +0100)
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>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
arch/x86/sched.c
include/x86/os.h

index ec1369480dc5d8322a9340256cccf7cd46747d75..e7b6954e0e131b821b1727819b2f7540187e2db3 100644 (file)
@@ -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();
+}
index e118b91f602b2b48ad25368df8f7dba580a1039e..90ab6e6324e4cbfe01b979be5a1adbfcd0490be3 100644 (file)
@@ -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")