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-changelog

[Xen-changelog] [xen-unstable] x86: Use halt() macro instead of direct H

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Use halt() macro instead of direct HLT asm.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Sep 2007 15:30:52 -0700
Delivery-date: Tue, 11 Sep 2007 15:34:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1189506104 -3600
# Node ID a657ebf8e4184a1dd1ec242cf30c53f1a1793a59
# Parent  2635119a1766068b2ab8d2b2d402ce84dcdfcacb
x86: Use halt() macro instead of direct HLT asm.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/crash.c    |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/shutdown.c |    9 +++++----
 xen/arch/x86/smp.c      |    4 +++-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff -r 2635119a1766 -r a657ebf8e418 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c      Tue Sep 11 08:34:04 2007 +0100
+++ b/xen/arch/x86/crash.c      Tue Sep 11 11:21:44 2007 +0100
@@ -46,7 +46,7 @@ static int crash_nmi_callback(struct cpu
     hvm_cpu_down();
 
     for ( ; ; )
-        __asm__ __volatile__ ( "hlt" );
+        halt();
 
     return 1;
 }
diff -r 2635119a1766 -r a657ebf8e418 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Tue Sep 11 08:34:04 2007 +0100
+++ b/xen/arch/x86/setup.c      Tue Sep 11 11:21:44 2007 +0100
@@ -168,7 +168,7 @@ static void __init do_initcalls(void)
 
 #define EARLY_FAIL(f, a...) do {                \
     printk( f , ## a );                         \
-    for ( ; ; ) __asm__ __volatile__ ( "hlt" ); \
+    for ( ; ; ) halt();                         \
 } while (0)
 
 static unsigned long __initdata initial_images_start, initial_images_end;
diff -r 2635119a1766 -r a657ebf8e418 xen/arch/x86/shutdown.c
--- a/xen/arch/x86/shutdown.c   Tue Sep 11 08:34:04 2007 +0100
+++ b/xen/arch/x86/shutdown.c   Tue Sep 11 11:21:44 2007 +0100
@@ -38,10 +38,11 @@ static inline void kb_wait(void)
             break;
 }
 
-static void  __attribute__((noreturn)) __machine_halt(void *unused)
-{
+static void __attribute__((noreturn)) __machine_halt(void *unused)
+{
+    local_irq_disable();
     for ( ; ; )
-        __asm__ __volatile__ ( "hlt" );
+        halt();
 }
 
 void machine_halt(void)
@@ -213,7 +214,7 @@ void machine_restart(void)
         on_selected_cpus(cpumask_of_cpu(0), (void *)machine_restart,
                          NULL, 1, 0);
         for ( ; ; )
-            safe_halt();
+            halt();
     }
 
     smp_send_stop();
diff -r 2635119a1766 -r a657ebf8e418 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c        Tue Sep 11 08:34:04 2007 +0100
+++ b/xen/arch/x86/smp.c        Tue Sep 11 11:21:44 2007 +0100
@@ -319,13 +319,15 @@ int on_selected_cpus(
 
 static void stop_this_cpu (void *dummy)
 {
+    ASSERT(!local_irq_is_enabled());
+
     disable_local_APIC();
     hvm_cpu_down();
 
     cpu_clear(smp_processor_id(), cpu_online_map);
 
     for ( ; ; )
-        __asm__ __volatile__ ( "hlt" );
+        halt();
 }
 
 /*

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Use halt() macro instead of direct HLT asm., Xen patchbot-unstable <=