aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2008-10-16 22:18:10 -0400
committerTony Luck <tony.luck@intel.com>2008-10-17 13:09:25 -0400
commit91834e685d2059b69c4e8e3d707f35d94438de94 (patch)
treec97e5d8c2b8fe8de49b9cd32c592ecec4eb3c47a /arch/ia64
parenta0df655ccd0669bd3efc85346dc816833dd1197f (diff)
ia64/xen: preliminary support for save/restore.
preliminary support for save/restore. Although Save/restore isn't fully working yet, this patch is necessary to compile. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/xen/Makefile2
-rw-r--r--arch/ia64/xen/suspend.c64
-rw-r--r--arch/ia64/xen/time.c33
-rw-r--r--arch/ia64/xen/time.h1
4 files changed, 99 insertions, 1 deletions
diff --git a/arch/ia64/xen/Makefile b/arch/ia64/xen/Makefile
index 972d085567d9..0ad0224693d9 100644
--- a/arch/ia64/xen/Makefile
+++ b/arch/ia64/xen/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := hypercall.o xenivt.o xensetup.o xen_pv_ops.o irq_xen.o \ 5obj-y := hypercall.o xenivt.o xensetup.o xen_pv_ops.o irq_xen.o \
6 hypervisor.o xencomm.o xcom_hcall.o grant-table.o time.o 6 hypervisor.o xencomm.o xcom_hcall.o grant-table.o time.o suspend.o
7 7
8obj-$(CONFIG_IA64_GENERIC) += machvec.o 8obj-$(CONFIG_IA64_GENERIC) += machvec.o
9 9
diff --git a/arch/ia64/xen/suspend.c b/arch/ia64/xen/suspend.c
new file mode 100644
index 000000000000..fd66b048c6fa
--- /dev/null
+++ b/arch/ia64/xen/suspend.c
@@ -0,0 +1,64 @@
1/******************************************************************************
2 * arch/ia64/xen/suspend.c
3 *
4 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * suspend/resume
22 */
23
24#include <xen/xen-ops.h>
25#include <asm/xen/hypervisor.h>
26#include "time.h"
27
28void
29xen_mm_pin_all(void)
30{
31 /* nothing */
32}
33
34void
35xen_mm_unpin_all(void)
36{
37 /* nothing */
38}
39
40void xen_pre_device_suspend(void)
41{
42 /* nothing */
43}
44
45void
46xen_pre_suspend()
47{
48 /* nothing */
49}
50
51void
52xen_post_suspend(int suspend_cancelled)
53{
54 if (suspend_cancelled)
55 return;
56
57 xen_ia64_enable_opt_feature();
58 /* add more if necessary */
59}
60
61void xen_arch_resume(void)
62{
63 xen_timer_resume_on_aps();
64}
diff --git a/arch/ia64/xen/time.c b/arch/ia64/xen/time.c
index ec168ec754b2..d15a94c330fb 100644
--- a/arch/ia64/xen/time.c
+++ b/arch/ia64/xen/time.c
@@ -26,6 +26,8 @@
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/clocksource.h> 27#include <linux/clocksource.h>
28 28
29#include <asm/timex.h>
30
29#include <asm/xen/hypervisor.h> 31#include <asm/xen/hypervisor.h>
30 32
31#include <xen/interface/vcpu.h> 33#include <xen/interface/vcpu.h>
@@ -178,3 +180,34 @@ struct pv_time_ops xen_time_ops __initdata = {
178 .do_steal_accounting = xen_do_steal_accounting, 180 .do_steal_accounting = xen_do_steal_accounting,
179 .clocksource_resume = xen_itc_jitter_data_reset, 181 .clocksource_resume = xen_itc_jitter_data_reset,
180}; 182};
183
184/* Called after suspend, to resume time. */
185static void xen_local_tick_resume(void)
186{
187 /* Just trigger a tick. */
188 ia64_cpu_local_tick();
189 touch_softlockup_watchdog();
190}
191
192void
193xen_timer_resume(void)
194{
195 unsigned int cpu;
196
197 xen_local_tick_resume();
198
199 for_each_online_cpu(cpu)
200 xen_init_missing_ticks_accounting(cpu);
201}
202
203static void ia64_cpu_local_tick_fn(void *unused)
204{
205 xen_local_tick_resume();
206 xen_init_missing_ticks_accounting(smp_processor_id());
207}
208
209void
210xen_timer_resume_on_aps(void)
211{
212 smp_call_function(&ia64_cpu_local_tick_fn, NULL, 1);
213}
diff --git a/arch/ia64/xen/time.h b/arch/ia64/xen/time.h
index b9c7ec5f9cfa..f98d7e1a42f0 100644
--- a/arch/ia64/xen/time.h
+++ b/arch/ia64/xen/time.h
@@ -21,3 +21,4 @@
21 */ 21 */
22 22
23extern struct pv_time_ops xen_time_ops __initdata; 23extern struct pv_time_ops xen_time_ops __initdata;
24void xen_timer_resume_on_aps(void);