string: factorize skip_spaces and export it to be generally available
[safe/jmp/linux-2.6] / arch / x86 / xen / suspend.c
index 251669a..987267f 100644 (file)
@@ -1,4 +1,5 @@
 #include <linux/types.h>
+#include <linux/clockchips.h>
 
 #include <xen/interface/xen.h>
 #include <xen/grant_table.h>
@@ -6,6 +7,7 @@
 
 #include <asm/xen/hypercall.h>
 #include <asm/xen/page.h>
+#include <asm/fixmap.h>
 
 #include "xen-ops.h"
 #include "mmu.h"
@@ -26,6 +28,8 @@ void xen_pre_suspend(void)
 
 void xen_post_suspend(int suspend_cancelled)
 {
+       xen_build_mfn_list_list();
+
        xen_setup_shared_info();
 
        if (suspend_cancelled) {
@@ -35,11 +39,27 @@ void xen_post_suspend(int suspend_cancelled)
                        pfn_to_mfn(xen_start_info->console.domU.mfn);
        } else {
 #ifdef CONFIG_SMP
-               xen_cpu_initialized_map = cpu_online_map;
+               BUG_ON(xen_cpu_initialized_map == NULL);
+               cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
 #endif
                xen_vcpu_restore();
-               xen_timer_resume();
        }
 
 }
 
+static void xen_vcpu_notify_restore(void *data)
+{
+       unsigned long reason = (unsigned long)data;
+
+       /* Boot processor notified via generic timekeeping_resume() */
+       if ( smp_processor_id() == 0)
+               return;
+
+       clockevents_notify(reason, NULL);
+}
+
+void xen_arch_resume(void)
+{
+       smp_call_function(xen_vcpu_notify_restore,
+                              (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
+}