ia64/xen-unstable

changeset 1233:01aaaa1d5d17

bitkeeper revision 1.825.4.2 (4063fcebXyP3T4ohTINdoE1EnVdbIA)

time.c, setup.c:
Fix time handling after suspend/resume cycle.
author kaf24@scramble.cl.cam.ac.uk
date Fri Mar 26 09:50:35 2004 +0000 (2004-03-26)
parents b083c9b2e63b
children bf4b11f253d4 d2c1f58f2edd
files xenolinux-2.4.25-sparse/arch/xen/kernel/setup.c xenolinux-2.4.25-sparse/arch/xen/kernel/time.c
line diff
     1.1 --- a/xenolinux-2.4.25-sparse/arch/xen/kernel/setup.c	Fri Mar 26 08:18:38 2004 +0000
     1.2 +++ b/xenolinux-2.4.25-sparse/arch/xen/kernel/setup.c	Fri Mar 26 09:50:35 2004 +0000
     1.3 @@ -1151,6 +1151,9 @@ static void stop_task(void *unused)
     1.4      extern void blkdev_suspend(void);
     1.5      extern void blkdev_resume(void);
     1.6      
     1.7 +    extern void time_suspend(void);
     1.8 +    extern void time_resume(void);
     1.9 +
    1.10      unsigned long *pfn_to_mfn_frame_list = NULL;
    1.11      suspend_record_t *suspend_record     = NULL;
    1.12      struct net_device *dev;
    1.13 @@ -1198,6 +1201,8 @@ static void stop_task(void *unused)
    1.14  
    1.15      __cli();
    1.16  
    1.17 +    time_suspend();
    1.18 +
    1.19      HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
    1.20      clear_fixmap(FIX_SHARED_INFO);
    1.21  
    1.22 @@ -1211,6 +1216,8 @@ static void stop_task(void *unused)
    1.23      HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
    1.24      memset(empty_zero_page, 0, PAGE_SIZE);
    1.25  
    1.26 +    time_resume();
    1.27 +
    1.28      __sti();
    1.29  
    1.30      blkdev_resume();
     2.1 --- a/xenolinux-2.4.25-sparse/arch/xen/kernel/time.c	Fri Mar 26 08:18:38 2004 +0000
     2.2 +++ b/xenolinux-2.4.25-sparse/arch/xen/kernel/time.c	Fri Mar 26 09:50:35 2004 +0000
     2.3 @@ -634,6 +634,24 @@ void __init time_init(void)
     2.4      rdtscll(alarm);
     2.5  }
     2.6  
     2.7 +void time_suspend(void)
     2.8 +{
     2.9 +}
    2.10 +
    2.11 +void time_resume(void)
    2.12 +{
    2.13 +    unsigned long flags;
    2.14 +    write_lock_irqsave(&xtime_lock, flags);
    2.15 +    /* Get timebases for new environment. */ 
    2.16 +    __get_time_values_from_xen();
    2.17 +    /* Reset our own concept of passage of system time. */
    2.18 +    processed_system_time = shadow_system_time;
    2.19 +    /* Accept a warp in UTC (wall-clock) time. */
    2.20 +    last_seen_tv.tv_sec = 0;
    2.21 +    /* Make sure we resync UTC time with Xen on next timer interrupt. */
    2.22 +    last_update_from_xen = 0;
    2.23 +    write_unlock_irqrestore(&xtime_lock, flags);
    2.24 +}
    2.25  
    2.26  /*
    2.27   * /proc/sys/xen: This really belongs in another file. It can stay here for