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

[Xen-changelog] [xen-unstable] [POWERPC][XEN] move idle_loop and add a "power save" hook



# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 0e02ac68b01bdda0b24c75985a81f6416b6488c5
# Parent  62196a0f3791b0ef4882b303aad86db5fdebf947
[POWERPC][XEN] move idle_loop and add a "power save" hook

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/arch/powerpc/domain.c |   32 +++++++++++++++++++++++++++++---
 xen/arch/powerpc/setup.c  |   18 ++----------------
 2 files changed, 31 insertions(+), 19 deletions(-)

diff -r 62196a0f3791 -r 0e02ac68b01b xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Fri Sep 01 12:19:41 2006 -0400
+++ b/xen/arch/powerpc/domain.c Fri Sep 01 12:31:56 2006 -0400
@@ -29,11 +29,10 @@
 #include <xen/shutdown.h>
 #include <xen/shadow.h>
 #include <xen/mm.h>
+#include <xen/softirq.h>
 #include <asm/htab.h>
 #include <asm/current.h>
 #include <asm/hcalls.h>
-
-extern void idle_loop(void);
 
 #define next_arg(fmt, args) ({                                              \
     unsigned long __arg;                                                    \
@@ -47,6 +46,7 @@ extern void idle_loop(void);
     }                                                                       \
     __arg;                                                                  \
 })
+extern void idle_loop(void);
 
 unsigned long hypercall_create_continuation(unsigned int op,
         const char *format, ...)
@@ -179,7 +179,6 @@ void dump_pageframe_info(struct domain *
     }
 }
 
-
 void context_switch(struct vcpu *prev, struct vcpu *next)
 {
     struct cpu_user_regs *stack_regs = guest_cpu_user_regs();
@@ -253,3 +252,30 @@ void arch_dump_domain_info(struct domain
 void arch_dump_domain_info(struct domain *d)
 {
 }
+
+extern void sleep(void);
+static void safe_halt(void)
+{
+    int cpu = smp_processor_id();
+
+    while (!softirq_pending(cpu))
+        sleep();
+}
+
+static void default_idle(void)
+{
+    local_irq_disable();
+    if ( !softirq_pending(smp_processor_id()) )
+        safe_halt();
+    else
+        local_irq_enable();
+}
+
+void idle_loop(void)
+{
+    for ( ; ; ) {
+        page_scrub_schedule_work();
+        default_idle();
+        do_softirq();
+    }
+}
diff -r 62196a0f3791 -r 0e02ac68b01b xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Fri Sep 01 12:19:41 2006 -0400
+++ b/xen/arch/powerpc/setup.c  Fri Sep 01 12:31:56 2006 -0400
@@ -82,7 +82,6 @@ struct ns16550_defaults ns16550;
 struct ns16550_defaults ns16550;
 
 extern char __per_cpu_start[], __per_cpu_data_end[], __per_cpu_end[];
-extern void idle_loop(void);
 
 /* move us to a header file */
 extern void initialize_keytable(void);
@@ -100,21 +99,6 @@ unsigned long kernel_text_end(void)
 unsigned long kernel_text_end(void)
 {
     return (unsigned long) &_etext;
-}
-
-void idle_loop(void)
-{
-    int cpu = smp_processor_id();
-
-    for ( ; ; )
-    {
-        while (!softirq_pending(cpu)) {
-            void sleep(void);
-            page_scrub_schedule_work();
-            sleep();
-        }
-        do_softirq();
-    }
 }
 
 static void __init do_initcalls(void)
@@ -209,6 +193,8 @@ static void __init start_of_day(void)
     do_initcalls();
     schedulers_start();
 }
+
+extern void idle_loop(void);
 
 void startup_cpu_idle_loop(void)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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