ia64/xen-unstable

changeset 10387:75f791c710df

[IA64] reset_system

Cleanup: EFI_RESET_SYSTEM now always calls domain_shutdown.
machine_restart and machine_halt calls efi reset_system to do their job.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Thu Jun 15 09:51:58 2006 -0600 (2006-06-15)
parents 0f3bd7d23737
children 7f67c15e2c91
files xen/arch/ia64/linux-xen/head.S xen/arch/ia64/linux-xen/smpboot.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/fw_emul.c xen/arch/ia64/xen/regionreg.c xen/arch/ia64/xen/xenmisc.c xen/include/asm-ia64/config.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/head.S	Thu Jun 15 09:47:19 2006 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/head.S	Thu Jun 15 09:51:58 2006 -0600
     1.3 @@ -1010,6 +1010,7 @@ 1:	br.cloop.sptk.few 1b
     1.4  	br.ret.sptk.many rp
     1.5  END(ia64_delay_loop)
     1.6  
     1.7 +#ifndef XEN
     1.8  /*
     1.9   * Return a CPU-local timestamp in nano-seconds.  This timestamp is
    1.10   * NOT synchronized across CPUs its return value must never be
    1.11 @@ -1062,6 +1063,7 @@ GLOBAL_ENTRY(start_kernel_thread)
    1.12  	br.call.sptk.many rp = sys_exit;;
    1.13  1:	br.sptk.few 1b				// not reached
    1.14  END(start_kernel_thread)
    1.15 +#endif /* XEN */
    1.16  
    1.17  #ifdef CONFIG_IA64_BRL_EMU
    1.18  
     2.1 --- a/xen/arch/ia64/linux-xen/smpboot.c	Thu Jun 15 09:47:19 2006 -0600
     2.2 +++ b/xen/arch/ia64/linux-xen/smpboot.c	Thu Jun 15 09:51:58 2006 -0600
     2.3 @@ -64,7 +64,6 @@
     2.4  #ifdef XEN
     2.5  #include <xen/domain.h>
     2.6  #include <asm/hw_irq.h>
     2.7 -int ht_per_core = 1;
     2.8  #ifndef CONFIG_SMP
     2.9  cpumask_t cpu_online_map = CPU_MASK_CPU0;
    2.10  EXPORT_SYMBOL(cpu_online_map);
     3.1 --- a/xen/arch/ia64/xen/domain.c	Thu Jun 15 09:47:19 2006 -0600
     3.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Jun 15 09:51:58 2006 -0600
     3.3 @@ -891,22 +891,19 @@ int construct_dom0(struct domain *d,
     3.4  
     3.5  void machine_restart(char * __unused)
     3.6  {
     3.7 -	if (running_on_sim) dummy();
     3.8 -	printf("machine_restart called: spinning....\n");
     3.9 +	if (running_on_sim)
    3.10 +		printf ("machine_restart called.  spinning...\n");
    3.11 +	else
    3.12 +		(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
    3.13  	while(1);
    3.14  }
    3.15  
    3.16  void machine_halt(void)
    3.17  {
    3.18 -	if (running_on_sim) dummy();
    3.19 -	printf("machine_halt called: spinning....\n");
    3.20 -	while(1);
    3.21 -}
    3.22 -
    3.23 -void dummy_called(char *function)
    3.24 -{
    3.25 -	if (running_on_sim) asm("break 0;;");
    3.26 -	printf("dummy called in %s: spinning....\n", function);
    3.27 +	if (running_on_sim)
    3.28 +		printf ("machine_halt called.  spinning...\n");
    3.29 +	else
    3.30 +		(*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL);
    3.31  	while(1);
    3.32  }
    3.33  
     4.1 --- a/xen/arch/ia64/xen/fw_emul.c	Thu Jun 15 09:47:19 2006 -0600
     4.2 +++ b/xen/arch/ia64/xen/fw_emul.c	Thu Jun 15 09:51:58 2006 -0600
     4.3 @@ -475,13 +475,21 @@ efi_emulator (struct pt_regs *regs, IA64
     4.4  
     4.5  	switch (regs->r2) {
     4.6  	    case FW_HYPERCALL_EFI_RESET_SYSTEM:
     4.7 -		printf("efi.reset_system called ");
     4.8 -		if (current->domain == dom0) {
     4.9 -			printf("(by dom0)\n ");
    4.10 -			(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
    4.11 -		} else {
    4.12 -			printf("\n");
    4.13 -			domain_shutdown (current->domain, SHUTDOWN_reboot);
    4.14 +	        {
    4.15 +		    u8 reason;
    4.16 +		    unsigned long val = vcpu_get_gr(v,32);
    4.17 +		    switch (val)
    4.18 +		    {
    4.19 +		    case EFI_RESET_SHUTDOWN:
    4.20 +			    reason = SHUTDOWN_poweroff;
    4.21 +			    break;
    4.22 +		    case EFI_RESET_COLD:
    4.23 +		    case EFI_RESET_WARM:
    4.24 +		    default:
    4.25 +			    reason = SHUTDOWN_reboot;
    4.26 +			    break;
    4.27 +		    }
    4.28 +		    domain_shutdown (current->domain, reason);
    4.29  		}
    4.30  		status = EFI_UNSUPPORTED;
    4.31  		break;
     5.1 --- a/xen/arch/ia64/xen/regionreg.c	Thu Jun 15 09:47:19 2006 -0600
     5.2 +++ b/xen/arch/ia64/xen/regionreg.c	Thu Jun 15 09:51:58 2006 -0600
     5.3 @@ -287,7 +287,7 @@ void init_all_rr(struct vcpu *v)
     5.4  	//rrv.rrval = v->domain->arch.metaphysical_rr0;
     5.5  	rrv.ps = PAGE_SHIFT;
     5.6  	rrv.ve = 1;
     5.7 -if (!v->vcpu_info) { printf("Stopping in init_all_rr\n"); dummy(); }
     5.8 +if (!v->vcpu_info) { panic("Stopping in init_all_rr\n"); }
     5.9  	VCPU(v,rrs[0]) = -1;
    5.10  	VCPU(v,rrs[1]) = rrv.rrval;
    5.11  	VCPU(v,rrs[2]) = rrv.rrval;
     6.1 --- a/xen/arch/ia64/xen/xenmisc.c	Thu Jun 15 09:47:19 2006 -0600
     6.2 +++ b/xen/arch/ia64/xen/xenmisc.c	Thu Jun 15 09:51:58 2006 -0600
     6.3 @@ -94,18 +94,6 @@ void console_print(char *msg)
     6.4  	printk("console_print called, how did start_kernel return???\n");
     6.5  }
     6.6  
     6.7 -void kernel_thread_helper(void)
     6.8 -{
     6.9 -	printk("kernel_thread_helper not implemented\n");
    6.10 -	dummy();
    6.11 -}
    6.12 -
    6.13 -void sys_exit(void)
    6.14 -{
    6.15 -	printk("sys_exit not implemented\n");
    6.16 -	dummy();
    6.17 -}
    6.18 -
    6.19  ////////////////////////////////////
    6.20  // called from unaligned.c
    6.21  ////////////////////////////////////
     7.1 --- a/xen/include/asm-ia64/config.h	Thu Jun 15 09:47:19 2006 -0600
     7.2 +++ b/xen/include/asm-ia64/config.h	Thu Jun 15 09:51:58 2006 -0600
     7.3 @@ -235,12 +235,6 @@ struct screen_info { };
     7.4  #define seq_printf(a,b...) printf(b)
     7.5  //#define CONFIG_BLK_DEV_INITRD // needed to reserve memory for domain0
     7.6  
     7.7 -void dummy_called(char *function);
     7.8 -#define dummy()	dummy_called((char *) __FUNCTION__)
     7.9 -
    7.10 -// these declarations got moved at some point, find a better place for them
    7.11 -extern int ht_per_core;
    7.12 -
    7.13  #ifdef CONFIG_XEN_IA64_DOM0_VP
    7.14  #define CONFIG_SHADOW	1
    7.15  #endif