WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [POWERPC][XEN] move idle_loop and add a "powe

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [POWERPC][XEN] move idle_loop and add a "power save" hook
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 01 Sep 2006 17:30:37 +0000
Delivery-date: Fri, 01 Sep 2006 10:32:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID ec7a1ffd0ade064c8ed79ec3fb2df9d5907866c1
# Parent  ddaaf7ca1c34fadf3741433c33bb676a0376adeb
[POWERPC][XEN] move idle_loop and add a "power save" hook

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

diff -r ddaaf7ca1c34 -r ec7a1ffd0ade 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 ddaaf7ca1c34 -r ec7a1ffd0ade 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
@@ -81,7 +81,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);
@@ -99,21 +98,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)
@@ -208,6 +192,8 @@ static void __init start_of_day(void)
     do_initcalls();
     schedulers_start();
 }
+
+extern void idle_loop(void);
 
 void startup_cpu_idle_loop(void)
 {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [POWERPC][XEN] move idle_loop and add a "power save" hook, Xen patchbot-xenppc-unstable <=