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

[Xen-changelog] [mini-os master] mini-os: provide irq on/off/save/restore functions for Mini-OS apps



commit 95555a3cf934295b840ae51e6d6cf3d661ccbb72
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue Aug 30 13:51:22 2016 +0200
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri Sep 2 09:24:53 2016 +0100

    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>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 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")
--
generated by git-patchbot for /home/xen/git/mini-os.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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