ia64/xen-unstable

changeset 15314:35e38c9048c8

Add suspend/resume to devices owned by Xen.

Signed-off-by: Ke Yu <ke.yu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jun 11 15:44:48 2007 +0100 (2007-06-11)
parents bd94f75fe469
children de47ca8be7fe
files xen/arch/x86/apic.c xen/arch/x86/i8259.c xen/arch/x86/io_apic.c xen/arch/x86/time.c xen/drivers/char/console.c xen/drivers/char/serial.c xen/include/asm-x86/apic.h xen/include/asm-x86/io_apic.h xen/include/asm-x86/irq.h xen/include/asm-x86/time.h xen/include/xen/console.h xen/include/xen/serial.h xen/include/xen/time.h
line diff
     1.1 --- a/xen/arch/x86/apic.c	Mon Jun 11 15:10:23 2007 +0100
     1.2 +++ b/xen/arch/x86/apic.c	Mon Jun 11 15:44:48 2007 +0100
     1.3 @@ -579,6 +579,95 @@ void __devinit setup_local_APIC(void)
     1.4      apic_pm_activate();
     1.5  }
     1.6  
     1.7 +static struct {
     1.8 +    int active;
     1.9 +    /* r/w apic fields */
    1.10 +    unsigned int apic_id;
    1.11 +    unsigned int apic_taskpri;
    1.12 +    unsigned int apic_ldr;
    1.13 +    unsigned int apic_dfr;
    1.14 +    unsigned int apic_spiv;
    1.15 +    unsigned int apic_lvtt;
    1.16 +    unsigned int apic_lvtpc;
    1.17 +    unsigned int apic_lvt0;
    1.18 +    unsigned int apic_lvt1;
    1.19 +    unsigned int apic_lvterr;
    1.20 +    unsigned int apic_tmict;
    1.21 +    unsigned int apic_tdcr;
    1.22 +    unsigned int apic_thmr;
    1.23 +} apic_pm_state;
    1.24 +
    1.25 +int lapic_suspend(void)
    1.26 +{
    1.27 +    unsigned long flags;
    1.28 +
    1.29 +    if (!apic_pm_state.active)
    1.30 +        return 0;
    1.31 +
    1.32 +    apic_pm_state.apic_id = apic_read(APIC_ID);
    1.33 +    apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI);
    1.34 +    apic_pm_state.apic_ldr = apic_read(APIC_LDR);
    1.35 +    apic_pm_state.apic_dfr = apic_read(APIC_DFR);
    1.36 +    apic_pm_state.apic_spiv = apic_read(APIC_SPIV);
    1.37 +    apic_pm_state.apic_lvtt = apic_read(APIC_LVTT);
    1.38 +    apic_pm_state.apic_lvtpc = apic_read(APIC_LVTPC);
    1.39 +    apic_pm_state.apic_lvt0 = apic_read(APIC_LVT0);
    1.40 +    apic_pm_state.apic_lvt1 = apic_read(APIC_LVT1);
    1.41 +    apic_pm_state.apic_lvterr = apic_read(APIC_LVTERR);
    1.42 +    apic_pm_state.apic_tmict = apic_read(APIC_TMICT);
    1.43 +    apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
    1.44 +    apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
    1.45 +    
    1.46 +    local_irq_save(flags);
    1.47 +    disable_local_APIC();
    1.48 +    local_irq_restore(flags);
    1.49 +    return 0;
    1.50 +}
    1.51 +
    1.52 +int lapic_resume(void)
    1.53 +{
    1.54 +    unsigned int l, h;
    1.55 +    unsigned long flags;
    1.56 +
    1.57 +    if (!apic_pm_state.active)
    1.58 +        return 0;
    1.59 +
    1.60 +    local_irq_save(flags);
    1.61 +
    1.62 +    /*
    1.63 +     * Make sure the APICBASE points to the right address
    1.64 +     *
    1.65 +     * FIXME! This will be wrong if we ever support suspend on
    1.66 +     * SMP! We'll need to do this as part of the CPU restore!
    1.67 +     */
    1.68 +    rdmsr(MSR_IA32_APICBASE, l, h);
    1.69 +    l &= ~MSR_IA32_APICBASE_BASE;
    1.70 +    l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
    1.71 +    wrmsr(MSR_IA32_APICBASE, l, h);
    1.72 +
    1.73 +    apic_write(APIC_LVTERR, ERROR_APIC_VECTOR | APIC_LVT_MASKED);
    1.74 +    apic_write(APIC_ID, apic_pm_state.apic_id);
    1.75 +    apic_write(APIC_DFR, apic_pm_state.apic_dfr);
    1.76 +    apic_write(APIC_LDR, apic_pm_state.apic_ldr);
    1.77 +    apic_write(APIC_TASKPRI, apic_pm_state.apic_taskpri);
    1.78 +    apic_write(APIC_SPIV, apic_pm_state.apic_spiv);
    1.79 +    apic_write(APIC_LVT0, apic_pm_state.apic_lvt0);
    1.80 +    apic_write(APIC_LVT1, apic_pm_state.apic_lvt1);
    1.81 +    apic_write(APIC_LVTTHMR, apic_pm_state.apic_thmr);
    1.82 +    apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc);
    1.83 +    apic_write(APIC_LVTT, apic_pm_state.apic_lvtt);
    1.84 +    apic_write(APIC_TDCR, apic_pm_state.apic_tdcr);
    1.85 +    apic_write(APIC_TMICT, apic_pm_state.apic_tmict);
    1.86 +    apic_write(APIC_ESR, 0);
    1.87 +    apic_read(APIC_ESR);
    1.88 +    apic_write(APIC_LVTERR, apic_pm_state.apic_lvterr);
    1.89 +    apic_write(APIC_ESR, 0);
    1.90 +    apic_read(APIC_ESR);
    1.91 +    local_irq_restore(flags);
    1.92 +    return 0;
    1.93 +}
    1.94 +
    1.95 +
    1.96  /*
    1.97   * If Linux enabled the LAPIC against the BIOS default
    1.98   * disable it down before re-entering the BIOS on shutdown.
    1.99 @@ -602,7 +691,10 @@ void lapic_shutdown(void)
   1.100      local_irq_restore(flags);
   1.101  }
   1.102  
   1.103 -static void apic_pm_activate(void) { }
   1.104 +static void apic_pm_activate(void)
   1.105 +{
   1.106 +    apic_pm_state.active = 1;
   1.107 +}
   1.108  
   1.109  /*
   1.110   * Detect and enable local APICs on non-SMP boards.
     2.1 --- a/xen/arch/x86/i8259.c	Mon Jun 11 15:10:23 2007 +0100
     2.2 +++ b/xen/arch/x86/i8259.c	Mon Jun 11 15:44:48 2007 +0100
     2.3 @@ -306,6 +306,36 @@ static void mask_and_ack_8259A_vector(un
     2.4      }
     2.5  }
     2.6  
     2.7 +static char irq_trigger[2];
     2.8 +/**
     2.9 + * ELCR registers (0x4d0, 0x4d1) control edge/level of IRQ
    2.10 + */
    2.11 +static void restore_ELCR(char *trigger)
    2.12 +{
    2.13 +    outb(trigger[0], 0x4d0);
    2.14 +    outb(trigger[1], 0x4d1);
    2.15 +}
    2.16 +
    2.17 +static void save_ELCR(char *trigger)
    2.18 +{
    2.19 +    /* IRQ 0,1,2,8,13 are marked as reserved */
    2.20 +    trigger[0] = inb(0x4d0) & 0xF8;
    2.21 +    trigger[1] = inb(0x4d1) & 0xDE;
    2.22 +}
    2.23 +
    2.24 +int i8259A_resume(void)
    2.25 +{
    2.26 +    init_8259A(0);
    2.27 +    restore_ELCR(irq_trigger);
    2.28 +    return 0;
    2.29 +}
    2.30 +
    2.31 +int i8259A_suspend(void)
    2.32 +{
    2.33 +    save_ELCR(irq_trigger);
    2.34 +    return 0;
    2.35 +}
    2.36 +
    2.37  void __init init_8259A(int auto_eoi)
    2.38  {
    2.39      unsigned long flags;
     3.1 --- a/xen/arch/x86/io_apic.c	Mon Jun 11 15:10:23 2007 +0100
     3.2 +++ b/xen/arch/x86/io_apic.c	Mon Jun 11 15:44:48 2007 +0100
     3.3 @@ -1793,6 +1793,80 @@ void __init setup_IO_APIC(void)
     3.4      register_keyhandler('z', print_IO_APIC_keyhandler, "print ioapic info");
     3.5  }
     3.6  
     3.7 +struct IO_APIC_route_entry *ioapic_pm_state=NULL;
     3.8 +
     3.9 +void ioapic_pm_state_alloc(void)
    3.10 +{
    3.11 +    int i, nr_entry = 0;
    3.12 +
    3.13 +    if (ioapic_pm_state != NULL)
    3.14 +        return;
    3.15 +
    3.16 +    for (i = 0; i < nr_ioapics; i++)
    3.17 +        nr_entry += nr_ioapic_registers[i];
    3.18 +
    3.19 +    ioapic_pm_state = _xmalloc(sizeof(struct IO_APIC_route_entry)*nr_entry,
    3.20 +                               sizeof(struct IO_APIC_route_entry));
    3.21 +}
    3.22 +
    3.23 +int ioapic_suspend(void)
    3.24 +{
    3.25 +    struct IO_APIC_route_entry *entry;
    3.26 +    unsigned long flags;
    3.27 +    int apic,i;
    3.28 +
    3.29 +    ioapic_pm_state_alloc();
    3.30 +
    3.31 +    if (ioapic_pm_state == NULL) {
    3.32 +        printk("Cannot suspend ioapic due to lack of memory\n");
    3.33 +        return 1;
    3.34 +    }
    3.35 +
    3.36 +    entry = ioapic_pm_state;
    3.37 +
    3.38 +    spin_lock_irqsave(&ioapic_lock, flags);
    3.39 +    for (apic = 0; apic < nr_ioapics; apic++) {
    3.40 +        for (i = 0; i < nr_ioapic_registers[apic]; i ++, entry ++ ) {
    3.41 +            *(((int *)entry) + 1) = io_apic_read(apic, 0x11 + 2 * i);
    3.42 +            *(((int *)entry) + 0) = io_apic_read(apic, 0x10 + 2 * i);
    3.43 +        }
    3.44 +    }
    3.45 +    spin_unlock_irqrestore(&ioapic_lock, flags);
    3.46 +
    3.47 +    return 0;
    3.48 +}
    3.49 +
    3.50 +int ioapic_resume(void)
    3.51 +{
    3.52 +    struct IO_APIC_route_entry *entry;
    3.53 +    unsigned long flags;
    3.54 +    union IO_APIC_reg_00 reg_00;
    3.55 +    int i,apic;
    3.56 +    
    3.57 +    if (ioapic_pm_state == NULL){
    3.58 +        printk("Cannot resume ioapic due to lack of memory\n");
    3.59 +        return 1;
    3.60 +    }
    3.61 +    
    3.62 +    entry = ioapic_pm_state;
    3.63 +
    3.64 +    spin_lock_irqsave(&ioapic_lock, flags);
    3.65 +    for (apic = 0; apic < nr_ioapics; apic++){
    3.66 +        reg_00.raw = io_apic_read(apic, 0);
    3.67 +        if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid) {
    3.68 +            reg_00.bits.ID = mp_ioapics[apic].mpc_apicid;
    3.69 +            io_apic_write(apic, 0, reg_00.raw);
    3.70 +        }
    3.71 +        for (i = 0; i < nr_ioapic_registers[apic]; i++, entry++) {
    3.72 +            io_apic_write(apic, 0x11+2*i, *(((int *)entry)+1));
    3.73 +            io_apic_write(apic, 0x10+2*i, *(((int *)entry)+0));
    3.74 +        }
    3.75 +    }
    3.76 +    spin_unlock_irqrestore(&ioapic_lock, flags);
    3.77 +
    3.78 +    return 0;
    3.79 +}
    3.80 +
    3.81  /* --------------------------------------------------------------------------
    3.82                            ACPI-based IOAPIC Configuration
    3.83     -------------------------------------------------------------------------- */
     4.1 --- a/xen/arch/x86/time.c	Mon Jun 11 15:10:23 2007 +0100
     4.2 +++ b/xen/arch/x86/time.c	Mon Jun 11 15:44:48 2007 +0100
     4.3 @@ -171,11 +171,18 @@ static struct irqaction irq0 = { timer_i
     4.4  #define CALIBRATE_FRAC  20      /* calibrate over 50ms */
     4.5  #define CALIBRATE_LATCH ((CLOCK_TICK_RATE+(CALIBRATE_FRAC/2))/CALIBRATE_FRAC)
     4.6  
     4.7 -static u64 calibrate_boot_tsc(void)
     4.8 +static u64 init_pit_and_calibrate_tsc(void)
     4.9  {
    4.10      u64 start, end;
    4.11      unsigned long count;
    4.12  
    4.13 +    /* Set PIT channel 0 to HZ Hz. */
    4.14 +#define CLOCK_TICK_RATE 1193180 /* crystal freq (Hz) */
    4.15 +#define LATCH (((CLOCK_TICK_RATE)+(HZ/2))/HZ)
    4.16 +    outb_p(0x34, PIT_MODE);        /* binary, mode 2, LSB/MSB, ch 0 */
    4.17 +    outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
    4.18 +    outb(LATCH >> 8, PIT_CH0);     /* MSB */
    4.19 +
    4.20      /* Set the Gate high, disable speaker */
    4.21      outb((inb(0x61) & ~0x02) | 0x01, 0x61);
    4.22  
    4.23 @@ -489,11 +496,12 @@ static s_time_t read_platform_stime(void
    4.24  {
    4.25      u64 count;
    4.26      s_time_t stime;
    4.27 +    unsigned long flags;
    4.28  
    4.29 -    spin_lock_irq(&platform_timer_lock);
    4.30 +    spin_lock_irqsave(&platform_timer_lock, flags);
    4.31      count = plt_count64 + ((plt_src.read_counter() - plt_count) & plt_mask);
    4.32      stime = __read_platform_stime(count);
    4.33 -    spin_unlock_irq(&platform_timer_lock);
    4.34 +    spin_unlock_irqrestore(&platform_timer_lock, flags);
    4.35  
    4.36      return stime;
    4.37  }
    4.38 @@ -502,13 +510,21 @@ static void platform_time_calibration(vo
    4.39  {
    4.40      u64 count;
    4.41      s_time_t stamp;
    4.42 +    unsigned long flags;
    4.43  
    4.44 -    spin_lock_irq(&platform_timer_lock);
    4.45 +    spin_lock_irqsave(&platform_timer_lock, flags);
    4.46      count = plt_count64 + ((plt_src.read_counter() - plt_count) & plt_mask);
    4.47      stamp = __read_platform_stime(count);
    4.48      stime_platform_stamp = stamp;
    4.49      platform_timer_stamp = count;
    4.50 -    spin_unlock_irq(&platform_timer_lock);
    4.51 +    spin_unlock_irqrestore(&platform_timer_lock, flags);
    4.52 +}
    4.53 +
    4.54 +static void resume_platform_timer(void)
    4.55 +{
    4.56 +    /* No change in platform_stime across suspend/resume. */
    4.57 +    platform_timer_stamp = plt_count64;
    4.58 +    plt_count = plt_src.read_counter();
    4.59  }
    4.60  
    4.61  static void init_platform_timer(void)
    4.62 @@ -875,7 +891,7 @@ void init_percpu_time(void)
    4.63  
    4.64      local_irq_save(flags);
    4.65      rdtscll(t->local_tsc_stamp);
    4.66 -    now = (smp_processor_id() == 0) ? 0 : read_platform_stime();
    4.67 +    now = !plt_src.read_counter ? 0 : read_platform_stime();
    4.68      local_irq_restore(flags);
    4.69  
    4.70      t->stime_master_stamp = now;
    4.71 @@ -907,9 +923,9 @@ int __init init_xen_time(void)
    4.72  /* Early init function. */
    4.73  void __init early_time_init(void)
    4.74  {
    4.75 -    u64 tmp = calibrate_boot_tsc();
    4.76 +    u64 tmp = init_pit_and_calibrate_tsc();
    4.77  
    4.78 -    set_time_scale(&per_cpu(cpu_time, 0).tsc_scale, tmp);
    4.79 +    set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
    4.80  
    4.81      do_div(tmp, 1000);
    4.82      cpu_khz = (unsigned long)tmp;
    4.83 @@ -931,6 +947,33 @@ unsigned long get_localtime(struct domai
    4.84          + d->time_offset_seconds;
    4.85  }
    4.86  
    4.87 +int time_suspend(void)
    4.88 +{
    4.89 +    /* Better to cancel calibration timer for accuracy. */
    4.90 +    kill_timer(&this_cpu(cpu_time).calibration_timer);
    4.91 +
    4.92 +    return 0;
    4.93 +}
    4.94 +
    4.95 +int time_resume(void)
    4.96 +{
    4.97 +    u64 now_sec, tmp = init_pit_and_calibrate_tsc();
    4.98 +
    4.99 +    set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
   4.100 +
   4.101 +    resume_platform_timer();
   4.102 +    now_sec = read_platform_stime();
   4.103 +    do_div(now_sec, SECONDS(1));
   4.104 +    wc_sec = get_cmos_time() - now_sec;
   4.105 +
   4.106 +    init_percpu_time();
   4.107 +
   4.108 +    if ( !is_idle_vcpu(current) )
   4.109 +        update_vcpu_system_time(current);
   4.110 +
   4.111 +    return 0;
   4.112 +}
   4.113 +
   4.114  /*
   4.115   * Local variables:
   4.116   * mode: C
     5.1 --- a/xen/drivers/char/console.c	Mon Jun 11 15:10:23 2007 +0100
     5.2 +++ b/xen/drivers/char/console.c	Mon Jun 11 15:44:48 2007 +0100
     5.3 @@ -848,7 +848,6 @@ static int __init debugtrace_init(void)
     5.4  #endif /* !NDEBUG */
     5.5  
     5.6  
     5.7 -
     5.8  /*
     5.9   * **************************************************************
    5.10   * *************** Debugging/tracing/error-report ***************
    5.11 @@ -914,6 +913,30 @@ void __warn(char *file, int line)
    5.12      dump_execution_state();
    5.13  }
    5.14  
    5.15 +
    5.16 +/*
    5.17 + * **************************************************************
    5.18 + * ****************** Console suspend/resume ********************
    5.19 + * **************************************************************
    5.20 + */
    5.21 +
    5.22 +static void suspend_steal_fn(const char *str) { }
    5.23 +static int suspend_steal_id;
    5.24 +
    5.25 +int console_suspend(void)
    5.26 +{
    5.27 +    suspend_steal_id = console_steal(sercon_handle, suspend_steal_fn);
    5.28 +    serial_suspend();
    5.29 +    return 0;
    5.30 +}
    5.31 +
    5.32 +int console_resume(void)
    5.33 +{
    5.34 +    serial_resume();
    5.35 +    console_giveback(suspend_steal_id);
    5.36 +    return 0;
    5.37 +}
    5.38 +
    5.39  /*
    5.40   * Local variables:
    5.41   * mode: C
     6.1 --- a/xen/drivers/char/serial.c	Mon Jun 11 15:10:23 2007 +0100
     6.2 +++ b/xen/drivers/char/serial.c	Mon Jun 11 15:44:48 2007 +0100
     6.3 @@ -381,6 +381,20 @@ int serial_irq(int idx)
     6.4      return -1;
     6.5  }
     6.6  
     6.7 +void serial_suspend(void)
     6.8 +{
     6.9 +    int i, irq;
    6.10 +    for ( i = 0; i < ARRAY_SIZE(com); i++ )
    6.11 +        if ( (irq = serial_irq(i)) >= 0 )
    6.12 +            free_irq(irq);
    6.13 +}
    6.14 +
    6.15 +void serial_resume(void)
    6.16 +{
    6.17 +    serial_init_preirq();
    6.18 +    serial_init_postirq();
    6.19 +}
    6.20 +
    6.21  void serial_register_uart(int idx, struct uart_driver *driver, void *uart)
    6.22  {
    6.23      /* Store UART-specific info. */
     7.1 --- a/xen/include/asm-x86/apic.h	Mon Jun 11 15:10:23 2007 +0100
     7.2 +++ b/xen/include/asm-x86/apic.h	Mon Jun 11 15:44:48 2007 +0100
     7.3 @@ -108,6 +108,8 @@ extern void nmi_watchdog_tick (struct cp
     7.4  extern int APIC_init_uniprocessor (void);
     7.5  extern void disable_APIC_timer(void);
     7.6  extern void enable_APIC_timer(void);
     7.7 +extern int lapic_suspend(void);
     7.8 +extern int lapic_resume(void);
     7.9  
    7.10  extern int check_nmi_watchdog (void);
    7.11  extern void enable_NMI_through_LVT0 (void * dummy);
    7.12 @@ -123,6 +125,8 @@ extern unsigned int nmi_watchdog;
    7.13  
    7.14  #else /* !CONFIG_X86_LOCAL_APIC */
    7.15  static inline void lapic_shutdown(void) { }
    7.16 +static inline int lapic_suspend(void) {return 0;}
    7.17 +static inline int lapic_resume(void) {return 0;}
    7.18  
    7.19  #endif /* !CONFIG_X86_LOCAL_APIC */
    7.20  
     8.1 --- a/xen/include/asm-x86/io_apic.h	Mon Jun 11 15:10:23 2007 +0100
     8.2 +++ b/xen/include/asm-x86/io_apic.h	Mon Jun 11 15:44:48 2007 +0100
     8.3 @@ -169,9 +169,13 @@ extern int timer_uses_ioapic_pin_0;
     8.4  #endif /*CONFIG_ACPI_BOOT*/
     8.5  
     8.6  extern int (*ioapic_renumber_irq)(int ioapic, int irq);
     8.7 +extern int ioapic_suspend(void);
     8.8 +extern int ioapic_resume(void);
     8.9  
    8.10  #else  /* !CONFIG_X86_IO_APIC */
    8.11  #define io_apic_assign_pci_irqs 0
    8.12 +static inline int ioapic_suspend(void) {return 0};
    8.13 +static inline int ioapic_resume(void) {return 0};
    8.14  #endif
    8.15  
    8.16  extern int assign_irq_vector(int irq);
     9.1 --- a/xen/include/asm-x86/irq.h	Mon Jun 11 15:10:23 2007 +0100
     9.2 +++ b/xen/include/asm-x86/irq.h	Mon Jun 11 15:44:48 2007 +0100
     9.3 @@ -35,6 +35,8 @@ void disable_8259A_irq(unsigned int irq)
     9.4  void enable_8259A_irq(unsigned int irq);
     9.5  int i8259A_irq_pending(unsigned int irq);
     9.6  void init_8259A(int aeoi);
     9.7 +int i8259A_suspend(void);
     9.8 +int i8259A_resume(void);
     9.9  
    9.10  void setup_IO_APIC(void);
    9.11  void disable_IO_APIC(void);
    10.1 --- a/xen/include/asm-x86/time.h	Mon Jun 11 15:10:23 2007 +0100
    10.2 +++ b/xen/include/asm-x86/time.h	Mon Jun 11 15:44:48 2007 +0100
    10.3 @@ -21,4 +21,9 @@ mktime (unsigned int year, unsigned int 
    10.4          unsigned int day, unsigned int hour,
    10.5          unsigned int min, unsigned int sec);
    10.6  
    10.7 +extern int time_suspend(void);
    10.8 +extern int time_resume(void);
    10.9 +
   10.10 +extern void init_percpu_time(void);
   10.11 +
   10.12  #endif /* __X86_TIME_H__ */
    11.1 --- a/xen/include/xen/console.h	Mon Jun 11 15:10:23 2007 +0100
    11.2 +++ b/xen/include/xen/console.h	Mon Jun 11 15:44:48 2007 +0100
    11.3 @@ -38,4 +38,7 @@ int console_steal(int handle, void (*fn)
    11.4  /* Give back stolen console. Takes the identifier returned by console_steal. */
    11.5  void console_giveback(int id);
    11.6  
    11.7 +int console_suspend(void);
    11.8 +int console_resume(void);
    11.9 +
   11.10  #endif /* __CONSOLE_H__ */
    12.1 --- a/xen/include/xen/serial.h	Mon Jun 11 15:10:23 2007 +0100
    12.2 +++ b/xen/include/xen/serial.h	Mon Jun 11 15:44:48 2007 +0100
    12.3 @@ -104,6 +104,10 @@ int serial_tx_space(int handle);
    12.4  /* Return irq number for specified serial port (identified by index). */
    12.5  int serial_irq(int idx);
    12.6  
    12.7 +/* Serial suspend/resume. */
    12.8 +void serial_suspend(void);
    12.9 +void serial_resume(void);
   12.10 +
   12.11  /*
   12.12   * Initialisation and helper functions for uart drivers.
   12.13   */
    13.1 --- a/xen/include/xen/time.h	Mon Jun 11 15:10:23 2007 +0100
    13.2 +++ b/xen/include/xen/time.h	Mon Jun 11 15:44:48 2007 +0100
    13.3 @@ -31,7 +31,6 @@
    13.4  #include <asm/time.h>
    13.5  
    13.6  extern int init_xen_time(void);
    13.7 -extern void init_percpu_time(void);
    13.8  
    13.9  extern unsigned long cpu_khz;
   13.10