ia64/xen-unstable

changeset 15871:a657ebf8e418

x86: Use halt() macro instead of direct HLT asm.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Sep 11 11:21:44 2007 +0100 (2007-09-11)
parents 2635119a1766
children 5ccf8bbf8628
files xen/arch/x86/crash.c xen/arch/x86/setup.c xen/arch/x86/shutdown.c xen/arch/x86/smp.c
line diff
     1.1 --- a/xen/arch/x86/crash.c	Tue Sep 11 08:34:04 2007 +0100
     1.2 +++ b/xen/arch/x86/crash.c	Tue Sep 11 11:21:44 2007 +0100
     1.3 @@ -46,7 +46,7 @@ static int crash_nmi_callback(struct cpu
     1.4      hvm_cpu_down();
     1.5  
     1.6      for ( ; ; )
     1.7 -        __asm__ __volatile__ ( "hlt" );
     1.8 +        halt();
     1.9  
    1.10      return 1;
    1.11  }
     2.1 --- a/xen/arch/x86/setup.c	Tue Sep 11 08:34:04 2007 +0100
     2.2 +++ b/xen/arch/x86/setup.c	Tue Sep 11 11:21:44 2007 +0100
     2.3 @@ -168,7 +168,7 @@ static void __init do_initcalls(void)
     2.4  
     2.5  #define EARLY_FAIL(f, a...) do {                \
     2.6      printk( f , ## a );                         \
     2.7 -    for ( ; ; ) __asm__ __volatile__ ( "hlt" ); \
     2.8 +    for ( ; ; ) halt();                         \
     2.9  } while (0)
    2.10  
    2.11  static unsigned long __initdata initial_images_start, initial_images_end;
     3.1 --- a/xen/arch/x86/shutdown.c	Tue Sep 11 08:34:04 2007 +0100
     3.2 +++ b/xen/arch/x86/shutdown.c	Tue Sep 11 11:21:44 2007 +0100
     3.3 @@ -38,10 +38,11 @@ static inline void kb_wait(void)
     3.4              break;
     3.5  }
     3.6  
     3.7 -static void  __attribute__((noreturn)) __machine_halt(void *unused)
     3.8 +static void __attribute__((noreturn)) __machine_halt(void *unused)
     3.9  {
    3.10 +    local_irq_disable();
    3.11      for ( ; ; )
    3.12 -        __asm__ __volatile__ ( "hlt" );
    3.13 +        halt();
    3.14  }
    3.15  
    3.16  void machine_halt(void)
    3.17 @@ -213,7 +214,7 @@ void machine_restart(void)
    3.18          on_selected_cpus(cpumask_of_cpu(0), (void *)machine_restart,
    3.19                           NULL, 1, 0);
    3.20          for ( ; ; )
    3.21 -            safe_halt();
    3.22 +            halt();
    3.23      }
    3.24  
    3.25      smp_send_stop();
     4.1 --- a/xen/arch/x86/smp.c	Tue Sep 11 08:34:04 2007 +0100
     4.2 +++ b/xen/arch/x86/smp.c	Tue Sep 11 11:21:44 2007 +0100
     4.3 @@ -319,13 +319,15 @@ int on_selected_cpus(
     4.4  
     4.5  static void stop_this_cpu (void *dummy)
     4.6  {
     4.7 +    ASSERT(!local_irq_is_enabled());
     4.8 +
     4.9      disable_local_APIC();
    4.10      hvm_cpu_down();
    4.11  
    4.12      cpu_clear(smp_processor_id(), cpu_online_map);
    4.13  
    4.14      for ( ; ; )
    4.15 -        __asm__ __volatile__ ( "hlt" );
    4.16 +        halt();
    4.17  }
    4.18  
    4.19  /*