ia64/xen-unstable

changeset 4574:76a627cb3006

bitkeeper revision 1.1323.1.1 (426520de5_4ELPPMz4K8LGEZrgN-Hg)

Implement save/restore (not migration) for unstable.
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@freefall.cl.cam.ac.uk
date Tue Apr 19 15:16:46 2005 +0000 (2005-04-19)
parents 5fd95a1db011
children 41e1779574b4
files linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c	Mon Apr 18 23:25:40 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c	Tue Apr 19 15:16:46 2005 +0000
     1.3 @@ -319,7 +319,8 @@ static int grant_write(struct file *file
     1.4      return -ENOSYS;
     1.5  }
     1.6  
     1.7 -static int __init gnttab_init(void)
     1.8 +
     1.9 +int gnttab_resume(void)
    1.10  {
    1.11      gnttab_setup_table_t setup;
    1.12      unsigned long        frames[NR_GRANT_FRAMES];
    1.13 @@ -341,6 +342,21 @@ static int __init gnttab_init(void)
    1.14  
    1.15      for ( i = 0; i < NR_GRANT_ENTRIES; i++ )
    1.16          gnttab_free_list[i] = i + 1;
    1.17 +    
    1.18 +    return 0;
    1.19 +}
    1.20 +
    1.21 +int gnttab_suspend(void)
    1.22 +{
    1.23 +    int i;
    1.24 +    for ( i = 0; i < NR_GRANT_FRAMES; i++ )
    1.25 +	clear_fixmap(FIX_GNTTAB_END - i);
    1.26 +    return 0;
    1.27 +}
    1.28 +
    1.29 +static int __init gnttab_init(void)
    1.30 +{
    1.31 +    BUG_ON(gnttab_resume());
    1.32  
    1.33      /*
    1.34       *  /proc/xen/grant : used by libxc to access grant tables
     2.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Mon Apr 18 23:25:40 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Tue Apr 19 15:16:46 2005 +0000
     2.3 @@ -84,6 +84,9 @@ static void __do_suspend(void)
     2.4  #define usbif_resume() do{}while(0)
     2.5  #endif
     2.6  
     2.7 +    extern int gnttab_suspend(void);
     2.8 +    extern int gnttab_resume(void);
     2.9 +
    2.10      extern void time_suspend(void);
    2.11      extern void time_resume(void);
    2.12      extern unsigned long max_pfn;
    2.13 @@ -107,6 +110,8 @@ static void __do_suspend(void)
    2.14  
    2.15      irq_suspend();
    2.16  
    2.17 +    gnttab_suspend();
    2.18 +
    2.19      HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
    2.20      clear_fixmap(FIX_SHARED_INFO);
    2.21  
    2.22 @@ -138,6 +143,7 @@ static void __do_suspend(void)
    2.23      HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
    2.24          virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
    2.25  
    2.26 +    gnttab_resume();
    2.27  
    2.28      irq_resume();
    2.29