ia64/xen-unstable

changeset 3844:0698ed077bc2

bitkeeper revision 1.1212 (42136b4bPyYaGldMQjQcAZc9eqgGww)

Clean up serial-line code. Pull out arch-dep to asm header file.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@scramble.cl.cam.ac.uk
date Wed Feb 16 15:48:27 2005 +0000 (2005-02-16)
parents 184c3ab84dc7
children 46c3f40cba0b
files .rootkeys xen/arch/ia64/xenmisc.c xen/arch/ia64/xensetup.c xen/drivers/char/serial.c xen/include/asm-ia64/config.h xen/include/asm-ia64/xenserial.h xen/include/asm-x86/serial.h xen/include/xen/serial.h
line diff
     1.1 --- a/.rootkeys	Wed Feb 16 14:59:21 2005 +0000
     1.2 +++ b/.rootkeys	Wed Feb 16 15:48:27 2005 +0000
     1.3 @@ -1131,6 +1131,7 @@ 3ddb79c3ysKUbxZuwKBRK3WXU2TlEg xen/inclu
     1.4  3ddb79c2QF5-pZGzuX4QukPCDAl59A xen/include/asm-x86/processor.h
     1.5  40cf1596bim9F9DNdV75klgRSZ6Y2A xen/include/asm-x86/regs.h
     1.6  3ddb79c2plf7ciNgoNjU-RsbUzawsw xen/include/asm-x86/rwlock.h
     1.7 +42136b49h6MkeayfuOaTPcJQWKga2g xen/include/asm-x86/serial.h
     1.8  405b8599BsDsDwKEJLS0XipaiQW3TA xen/include/asm-x86/shadow.h
     1.9  3ddb79c3Hgbb2g8CyWLMCK-6_ZVQSQ xen/include/asm-x86/smp.h
    1.10  3ddb79c3jn8ALV_S9W5aeTYUQRKBpg xen/include/asm-x86/smpboot.h
     2.1 --- a/xen/arch/ia64/xenmisc.c	Wed Feb 16 14:59:21 2005 +0000
     2.2 +++ b/xen/arch/ia64/xenmisc.c	Wed Feb 16 15:48:27 2005 +0000
     2.3 @@ -204,27 +204,6 @@ void dump_pageframe_info(struct domain *
     2.4  }
     2.5  
     2.6  ///////////////////////////////
     2.7 -// from drivers/char/serial.c
     2.8 -///////////////////////////////
     2.9 -
    2.10 -#include <asm/hpsim_ssc.h>
    2.11 -
    2.12 -int
    2.13 -ia64_serial_putc(unsigned char c)
    2.14 -{
    2.15 -	if (platform_is_hp_ski()) {
    2.16 -		ia64_ssc(c, 0, 0, 0, SSC_PUTCHAR);
    2.17 -	}
    2.18 -	else {
    2.19 -// this is tested on HP Longs Peak platform... it
    2.20 -// will probably work on other Itanium platforms as
    2.21 -// well, but undoubtedly needs work
    2.22 -		longs_peak_putc(c);
    2.23 -	}
    2.24 -	return 1;
    2.25 -}
    2.26 -
    2.27 -///////////////////////////////
    2.28  // from common/physdev.c
    2.29  ///////////////////////////////
    2.30  void
     3.1 --- a/xen/arch/ia64/xensetup.c	Wed Feb 16 14:59:21 2005 +0000
     3.2 +++ b/xen/arch/ia64/xensetup.c	Wed Feb 16 15:48:27 2005 +0000
     3.3 @@ -142,23 +142,12 @@ void cmain(multiboot_info_t *mbi)
     3.4      /* Must do this early -- e.g., spinlocks rely on get_current(). */
     3.5      set_current(&idle0_exec_domain);
     3.6  
     3.7 +    early_setup_arch();
     3.8 +
     3.9      /* We initialise the serial devices very early so we can get debugging. */
    3.10      serial_init_stage1();
    3.11  
    3.12 -    init_console();
    3.13 -#if 0
    3.14 -    /* HELLO WORLD --- start-of-day banner text. */
    3.15 -    printk(XEN_BANNER);
    3.16 -    printk(" http://www.cl.cam.ac.uk/netos/xen\n");
    3.17 -    printk(" University of Cambridge Computer Laboratory\n\n");
    3.18 -    printk(" Xen version %d.%d%s (%s@%s) (%s) %s\n",
    3.19 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
    3.20 -           XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
    3.21 -           XEN_COMPILER, XEN_COMPILE_DATE);
    3.22 -#endif
    3.23 -#ifndef IA64
    3.24 -    printk(" Latest ChangeSet: %s\n\n", XEN_CHANGESET);
    3.25 -#endif
    3.26 +    init_console(); 
    3.27      set_printk_prefix("(XEN) ");
    3.28  
    3.29  #ifdef IA64
     4.1 --- a/xen/drivers/char/serial.c	Wed Feb 16 14:59:21 2005 +0000
     4.2 +++ b/xen/drivers/char/serial.c	Wed Feb 16 15:48:27 2005 +0000
     4.3 @@ -6,7 +6,7 @@
     4.4   * it permits debugging of seriously-toasted machines (e.g., in situations
     4.5   * where a device driver within a guest OS would be inaccessible).
     4.6   * 
     4.7 - * Copyright (c) 2003-2004, K A Fraser
     4.8 + * Copyright (c) 2003-2005, K A Fraser
     4.9   */
    4.10  
    4.11  #include <xen/config.h>
    4.12 @@ -18,11 +18,6 @@
    4.13  #include <xen/serial.h>
    4.14  #include <asm/io.h>
    4.15  
    4.16 -/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
    4.17 -static unsigned char opt_com1[30] = "", opt_com2[30] = "";
    4.18 -string_param("com1", opt_com1);
    4.19 -string_param("com2", opt_com2);
    4.20 -
    4.21  /* Register offsets */
    4.22  #define RBR             0x00    /* receive buffer       */
    4.23  #define THR             0x00    /* transmit holding     */
    4.24 @@ -100,15 +95,13 @@ static uart_t com[2] = {
    4.25  #define UART_ENABLED(_u) ((_u)->baud != 0)
    4.26  #define DISABLE_UART(_u) ((_u)->baud = 0)
    4.27  
    4.28 -#ifdef CONFIG_X86
    4.29 -static inline int arch_serial_putc(uart_t *uart, unsigned char c)
    4.30 -{
    4.31 -    int space;
    4.32 -    if ( (space = (inb(uart->io_base + LSR) & LSR_THRE)) )
    4.33 -        outb(c, uart->io_base + THR);
    4.34 -    return space;
    4.35 -}
    4.36 -#endif
    4.37 +/* Architecture-specific private definitions. */
    4.38 +#include <asm/serial.h>
    4.39 +
    4.40 +/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
    4.41 +static unsigned char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR;
    4.42 +string_param("com1", opt_com1);
    4.43 +string_param("com2", opt_com2);
    4.44  
    4.45  
    4.46  /***********************
     5.1 --- a/xen/include/asm-ia64/config.h	Wed Feb 16 14:59:21 2005 +0000
     5.2 +++ b/xen/include/asm-ia64/config.h	Wed Feb 16 15:48:27 2005 +0000
     5.3 @@ -2,6 +2,7 @@
     5.4  // manufactured from component pieces
     5.5  
     5.6  // defined in linux/arch/ia64/defconfig
     5.7 +//#define	CONFIG_IA64_GENERIC
     5.8  #define	CONFIG_IA64_HP_SIM
     5.9  #define	CONFIG_IA64_L1_CACHE_SHIFT 7
    5.10  // needed by include/asm-ia64/page.h
    5.11 @@ -184,8 +185,6 @@ struct pci_bus_region {
    5.12      (likely(sizeof(count) <= 4) /* disallow 64-bit counts */ &&  \
    5.13       access_ok(type,addr,count*size))
    5.14  
    5.15 -// see drivers/char/serial.c
    5.16 -#define arch_serial_putc(uart,c)	ia64_serial_putc(c)
    5.17  // without this, uart_config_stageX does outb's which are non-portable
    5.18  #define NO_UART_CONFIG_OK
    5.19  
    5.20 @@ -203,10 +202,6 @@ struct pci_bus_region {
    5.21  // x86 typedef still used in sched.h, may go away later
    5.22  //typedef unsigned long l1_pgentry_t;
    5.23  
    5.24 -// removed from include/xen/types.h (why?)
    5.25 -typedef unsigned long uint64_t;
    5.26 -typedef unsigned int uint32_t;
    5.27 -
    5.28  // see include/asm-ia64/mm.h, handle remaining pfn_info uses until gone
    5.29  #define pfn_info page
    5.30  
     6.1 --- a/xen/include/asm-ia64/xenserial.h	Wed Feb 16 14:59:21 2005 +0000
     6.2 +++ b/xen/include/asm-ia64/xenserial.h	Wed Feb 16 15:48:27 2005 +0000
     6.3 @@ -1,17 +0,0 @@
     6.4 -// this file is now obsolete and can be removed
     6.5 -#include <asm/hpsim_ssc.h>
     6.6 -
     6.7 -static inline int arch_serial_putc(unsigned char c)
     6.8 -{
     6.9 -	if (platform_is_hp_ski()) {
    6.10 -		ia64_ssc(c, 0, 0, 0, SSC_PUTCHAR);
    6.11 -	}
    6.12 -	else {
    6.13 -// this is tested on HP Longs Peak platform... it
    6.14 -// will probably work on other Itanium platforms as
    6.15 -// well, but undoubtedly needs work
    6.16 -		longs_peak_putc(c);
    6.17 -	}
    6.18 -	return 1;
    6.19 -}
    6.20 -
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/xen/include/asm-x86/serial.h	Wed Feb 16 15:48:27 2005 +0000
     7.3 @@ -0,0 +1,22 @@
     7.4 +/* -*-  Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
     7.5 +/******************************************************************************
     7.6 + * asm-x86/serial.h
     7.7 + * 
     7.8 + * Architecture-specific private serial definitions.
     7.9 + */
    7.10 +
    7.11 +#ifndef __ASM_X86_SERIAL_H__
    7.12 +#define __ASM_X86_SERIAL_H__
    7.13 +
    7.14 +#define OPT_COM1_STR ""
    7.15 +#define OPT_COM2_STR ""
    7.16 +
    7.17 +static inline int arch_serial_putc(uart_t *uart, unsigned char c)
    7.18 +{
    7.19 +    int space;
    7.20 +    if ( (space = (inb(uart->io_base + LSR) & LSR_THRE)) )
    7.21 +        outb(c, uart->io_base + THR);
    7.22 +    return space;
    7.23 +}
    7.24 +
    7.25 +#endif /* __ASM_X86_SERIAL_H__ */
     8.1 --- a/xen/include/xen/serial.h	Wed Feb 16 14:59:21 2005 +0000
     8.2 +++ b/xen/include/xen/serial.h	Wed Feb 16 15:48:27 2005 +0000
     8.3 @@ -1,3 +1,4 @@
     8.4 +/* -*-  Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
     8.5  /******************************************************************************
     8.6   * serial.h
     8.7   * 
     8.8 @@ -5,7 +6,10 @@
     8.9   * it permits debugging of seriously-toasted machines (e.g., in situations
    8.10   * where a device driver within a guest OS would be inaccessible).
    8.11   * 
    8.12 - * Copyright (c) 2003-2004, K A Fraser
    8.13 + * This file contains public definitions. The arch-specific header
    8.14 + * contains only private hooks, and is not included from this file.
    8.15 + * 
    8.16 + * Copyright (c) 2003-2005, K A Fraser
    8.17   */
    8.18  
    8.19  #ifndef __XEN_SERIAL_H__