ia64/xen-unstable

changeset 8185:e13c994bdccb

More console-related cleanups.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Dec 02 16:26:57 2005 +0100 (2005-12-02)
parents 0a81c6edf2b1
children 28bd01c9b596 30eb074a560a 63f9c8dd13d4
files linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c	Fri Dec 02 16:14:20 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c	Fri Dec 02 16:26:57 2005 +0100
     1.3 @@ -28,8 +28,6 @@
     1.4  #endif
     1.5  #include <asm-xen/evtchn.h>
     1.6  
     1.7 -#define xxprint(msg) HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg)
     1.8 -
     1.9  /*
    1.10   *	Some notes on x86 processor bugs affecting SMP operation:
    1.11   *
    1.12 @@ -542,9 +540,7 @@ static void stop_this_cpu (void * dummy)
    1.13  	 */
    1.14  	cpu_clear(smp_processor_id(), cpu_online_map);
    1.15  	local_irq_disable();
    1.16 -#if 1
    1.17 -	xxprint("stop_this_cpu disable_local_APIC\n");
    1.18 -#else
    1.19 +#if 0
    1.20  	disable_local_APIC();
    1.21  #endif
    1.22  	if (cpu_data[smp_processor_id()].hlt_works_ok)
    1.23 @@ -561,9 +557,7 @@ void smp_send_stop(void)
    1.24  	smp_call_function(stop_this_cpu, NULL, 1, 0);
    1.25  
    1.26  	local_irq_disable();
    1.27 -#if 1
    1.28 -	xxprint("smp_send_stop disable_local_APIC\n");
    1.29 -#else
    1.30 +#if 0
    1.31  	disable_local_APIC();
    1.32  #endif
    1.33  	local_irq_enable();
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c	Fri Dec 02 16:14:20 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c	Fri Dec 02 16:26:57 2005 +0100
     2.3 @@ -31,8 +31,6 @@
     2.4  #ifdef CONFIG_XEN
     2.5  #include <asm-xen/evtchn.h>
     2.6  
     2.7 -#define xxprint(msg) HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg)
     2.8 -
     2.9  #else
    2.10  /*
    2.11   *	Smarter SMP flushing macros. 
    2.12 @@ -379,8 +377,6 @@ void smp_stop_cpu(void)
    2.13  	local_irq_disable();
    2.14  #ifndef CONFIG_XEN
    2.15  	disable_local_APIC();
    2.16 -#else
    2.17 -	xxprint("stop_this_cpu disable_local_APIC\n");
    2.18  #endif
    2.19  	local_irq_enable(); 
    2.20  }
    2.21 @@ -409,9 +405,7 @@ void smp_send_stop(void)
    2.22  		spin_unlock(&call_lock);
    2.23  
    2.24  	local_irq_disable();
    2.25 -#ifdef CONFIG_XEN
    2.26 -	xxprint("stop_this_cpu disable_local_APIC\n");
    2.27 -#else
    2.28 +#ifndef CONFIG_XEN
    2.29  	disable_local_APIC();
    2.30  #endif
    2.31  	local_irq_enable();
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Dec 02 16:14:20 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Dec 02 16:26:57 2005 +0100
     3.3 @@ -134,20 +134,22 @@ static struct tty_driver *xencons_driver
     3.4  static void kcons_write(
     3.5  	struct console *c, const char *s, unsigned int count)
     3.6  {
     3.7 -	int           i;
     3.8 +	int           i = 0;
     3.9  	unsigned long flags;
    3.10  
    3.11  	spin_lock_irqsave(&xencons_lock, flags);
    3.12 -    
    3.13 -	for (i = 0; i < count; i++) {
    3.14 -		if ((wp - wc) >= (wbuf_size - 1))
    3.15 -			break;
    3.16 -		if ((wbuf[WBUF_MASK(wp++)] = s[i]) == '\n')
    3.17 -			wbuf[WBUF_MASK(wp++)] = '\r';
    3.18 +
    3.19 +	while (i < count) {
    3.20 +		for (; i < count; i++) {
    3.21 +			if ((wp - wc) >= (wbuf_size - 1))
    3.22 +				break;
    3.23 +			if ((wbuf[WBUF_MASK(wp++)] = s[i]) == '\n')
    3.24 +				wbuf[WBUF_MASK(wp++)] = '\r';
    3.25 +		}
    3.26 +
    3.27 +		__xencons_tx_flush();
    3.28  	}
    3.29  
    3.30 -	__xencons_tx_flush();
    3.31 -
    3.32  	spin_unlock_irqrestore(&xencons_lock, flags);
    3.33  }
    3.34  
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Fri Dec 02 16:14:20 2005 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Fri Dec 02 16:26:57 2005 +0100
     4.3 @@ -15,6 +15,7 @@
     4.4  
     4.5  #include <asm/hypervisor.h>
     4.6  #include <asm-xen/evtchn.h>
     4.7 +#include <asm-xen/xencons.h>
     4.8  #include <linux/wait.h>
     4.9  #include <linux/interrupt.h>
    4.10  #include <linux/sched.h>
    4.11 @@ -96,7 +97,7 @@ int xencons_ring_init(void)
    4.12  		xen_start_info->console_evtchn,
    4.13  		handle_input, 0, "xencons", NULL);
    4.14  	if (err <= 0) {
    4.15 -		xprintk("XEN console request irq failed %i\n", err);
    4.16 +		printk(KERN_ERR "XEN console request irq failed %i\n", err);
    4.17  		return err;
    4.18  	}
    4.19