1 /******************************************************************************
4 * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
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.
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.
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
23 #ifndef __XEN_PUBLIC_HVM_SAVE_IA64_H__
24 #define __XEN_PUBLIC_HVM_SAVE_IA64_H__
26 #include <public/hvm/save.h>
27 #include <public/arch-ia64.h>
30 * Save/restore header: general info about the save file.
33 /* x86 uses 0x54381286 */
34 #define HVM_FILE_MAGIC 0x343641492f6e6558UL /* "Xen/IA64" */
35 #define HVM_FILE_VERSION 0x0000000000000001UL
37 struct hvm_save_header
{
38 uint64_t magic
; /* Must be HVM_FILE_MAGIC */
39 uint64_t version
; /* File format version */
40 uint64_t changeset
; /* Version of Xen that saved this file */
41 uint64_t cpuid
[5]; /* CPUID[0x01][%eax] on the saving machine */
44 DECLARE_HVM_SAVE_TYPE(HEADER
, 1, struct hvm_save_header
);
49 struct hvm_hw_ia64_cpu
{
52 DECLARE_HVM_SAVE_TYPE(CPU
, 2, struct hvm_hw_ia64_cpu
);
57 struct hvm_hw_ia64_vpd
{
60 DECLARE_HVM_SAVE_TYPE(VPD
, 3, struct hvm_hw_ia64_vpd
);
64 * vacpi => viosapic => vlsapic
69 struct hvm_hw_ia64_vlsapic
{
71 uint64_t vhpi
; // ??? should this be saved in vpd
73 uint8_t pal_init_pending
;
76 DECLARE_HVM_SAVE_TYPE(VLSAPIC
, 4, struct hvm_hw_ia64_vlsapic
);
78 * unconditionaly set v->arch.irq_new_peding = 1
79 * unconditionaly set v->arch.irq_new_condition = 0
85 /* itc, itm, itv are saved by arch vcpu context */
86 struct hvm_hw_ia64_vtime
{
93 DECLARE_HVM_SAVE_TYPE(VTIME
, 5, struct hvm_hw_ia64_vtime
);
95 * calculate v->vtm.vtm_offset
96 * ??? Or should vtm_offset be set by leave_hypervisor_tail()?
97 * start vtm_timer if necessary by vtm_set_itm().
98 * ??? Or should vtm_timer be set by leave_hypervisor_tail()?
100 * ??? or should be done by schedule_tail()
101 * => schedule_tail() should do.
107 #define VIOSAPIC_NUM_PINS 48
115 uint8_t delivery_mode
: 3;
116 uint8_t reserve1
: 1;
117 uint8_t delivery_status
: 1;
118 uint8_t polarity
: 1;
119 uint8_t reserve2
: 1;
120 uint8_t trig_mode
: 1;
123 uint8_t reserve3
: 7;
130 struct hvm_hw_ia64_viosapic
{
135 uint64_t lowest_vcpu_id
;
136 uint64_t base_address
;
137 union viosapic_rte redirtbl
[VIOSAPIC_NUM_PINS
];
139 DECLARE_HVM_SAVE_TYPE(VIOSAPIC
, 6, struct hvm_hw_ia64_viosapic
);
148 uint32_t pm1a_sts
:16;/* PM1a_EVT_BLK.PM1a_STS: status register */
149 uint32_t pm1a_en
:16; /* PM1a_EVT_BLK.PM1a_EN: enable register */
153 uint32_t tmr_val
; /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
156 struct hvm_hw_ia64_vacpi
{
157 struct vacpi_regs regs
;
159 DECLARE_HVM_SAVE_TYPE(VACPI
, 7, struct hvm_hw_ia64_vacpi
);
160 /* update last_gtime and setup timer of struct vacpi */
163 * opt_feature: identity mapping of region 4, 5 and 7.
164 * With the c/s 16396:d2935f9c217f of xen-ia64-devel.hg,
165 * opt_feature hypercall supports only region 4,5,7 identity mappings.
166 * structure hvm_hw_ia64_identity_mappings only supports them.
167 * The new structure, struct hvm_hw_ia64_identity_mappings, is created to
168 * avoid to keep up with change of the xen/ia64 internal structure, struct
171 * If it is enhanced in the future, new structure will be created.
173 struct hvm_hw_ia64_identity_mapping
{
174 uint64_t on
; /* on/off */
175 uint64_t pgprot
; /* The page protection bit mask of the pte. */
176 uint64_t key
; /* A protection key. */
179 struct hvm_hw_ia64_identity_mappings
{
180 struct hvm_hw_ia64_identity_mapping im_reg4
;/* Region 4 identity mapping */
181 struct hvm_hw_ia64_identity_mapping im_reg5
;/* Region 5 identity mapping */
182 struct hvm_hw_ia64_identity_mapping im_reg7
;/* Region 7 identity mapping */
184 DECLARE_HVM_SAVE_TYPE(OPT_FEATURE_IDENTITY_MAPPINGS
, 8, struct hvm_hw_ia64_identity_mappings
);
187 * Largest type-code in use
189 #define HVM_SAVE_CODE_MAX 8
191 #endif /* __XEN_PUBLIC_HVM_SAVE_IA64_H__ */
199 * indent-tabs-mode: nil