ia64/xen-unstable

view xen/include/asm-ia64/domain.h @ 10685:8ad37880564d

[IA64] emulate PAL_HALT_LIGHT on domU

This patch emulates Guest PAL_HALT_LIGHT on domU by using do_block and timer.
It also adds the function of the timer interrupt to domU at the vcpu woke up.

Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
[warning fixes and static inlining]
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Mon Jul 10 13:12:41 2006 -0600 (2006-07-10)
parents 37c8b562a8f1
children b2abc70be89e
line source
1 #ifndef __ASM_DOMAIN_H__
2 #define __ASM_DOMAIN_H__
4 #include <linux/thread_info.h>
5 #include <asm/tlb.h>
6 #include <asm/vmx_vpd.h>
7 #include <asm/vmmu.h>
8 #include <asm/regionreg.h>
9 #include <public/arch-ia64.h>
10 #include <asm/vmx_platform.h>
11 #include <xen/list.h>
12 #include <xen/cpumask.h>
13 #include <asm/fpswa.h>
15 struct p2m_entry {
16 volatile pte_t* pte;
17 pte_t used;
18 };
20 static inline void
21 p2m_entry_set(struct p2m_entry* entry, volatile pte_t* pte, pte_t used)
22 {
23 entry->pte = pte;
24 entry->used = used;
25 }
27 static inline int
28 p2m_entry_retry(struct p2m_entry* entry)
29 {
30 //XXX see lookup_domain_pte().
31 // NULL is set for invalid gpaddr for the time being.
32 if (entry->pte == NULL)
33 return 0;
35 return (pte_val(*entry->pte) != pte_val(entry->used));
36 }
38 extern void domain_relinquish_resources(struct domain *);
40 /* given a current domain metaphysical address, return the physical address */
41 extern unsigned long translate_domain_mpaddr(unsigned long mpaddr,
42 struct p2m_entry* entry);
44 /* Set shared_info virtual address. */
45 extern unsigned long domain_set_shared_info_va (unsigned long va);
47 /* Flush cache of domain d.
48 If sync_only is true, only synchronize I&D caches,
49 if false, flush and invalidate caches. */
50 extern void domain_cache_flush (struct domain *d, int sync_only);
52 /* Cleanly crash the current domain with a message. */
53 extern void panic_domain(struct pt_regs *, const char *, ...)
54 __attribute__ ((noreturn, format (printf, 2, 3)));
56 struct mm_struct {
57 pgd_t * pgd;
58 // atomic_t mm_users; /* How many users with user space? */
59 };
61 struct last_vcpu {
62 #define INVALID_VCPU_ID INT_MAX
63 int vcpu_id;
64 } ____cacheline_aligned_in_smp;
66 /* These are data in domain memory for SAL emulator. */
67 struct xen_sal_data {
68 /* OS boot rendez vous. */
69 unsigned long boot_rdv_ip;
70 unsigned long boot_rdv_r1;
72 /* There are these for EFI_SET_VIRTUAL_ADDRESS_MAP emulation. */
73 int efi_virt_mode; /* phys : 0 , virt : 1 */
74 };
76 struct arch_domain {
77 struct mm_struct mm;
79 /* Flags. */
80 union {
81 unsigned long flags;
82 struct {
83 unsigned int is_vti : 1;
84 };
85 };
87 /* There are two ranges of RID for a domain:
88 one big range, used to virtualize domain RID,
89 one small range for internal Xen use (metaphysical). */
90 /* Big range. */
91 int starting_rid; /* first RID assigned to domain */
92 int ending_rid; /* one beyond highest RID assigned to domain */
93 /* Metaphysical range. */
94 int starting_mp_rid;
95 int ending_mp_rid;
96 /* RID for metaphysical mode. */
97 unsigned long metaphysical_rr0;
98 unsigned long metaphysical_rr4;
100 int rid_bits; /* number of virtual rid bits (default: 18) */
101 int breakimm; /* The imm value for hypercalls. */
103 struct virtual_platform_def vmx_platform;
104 #define hvm_domain vmx_platform /* platform defs are not vmx specific */
106 u64 xen_vastart;
107 u64 xen_vaend;
108 u64 shared_info_va;
110 /* Address of SAL emulator data */
111 struct xen_sal_data *sal_data;
112 /* SAL return point. */
113 unsigned long sal_return_addr;
115 /* Address of efi_runtime_services_t (placed in domain memory) */
116 void *efi_runtime;
117 /* Address of fpswa_interface_t (placed in domain memory) */
118 void *fpswa_inf;
120 struct last_vcpu last_vcpu[NR_CPUS];
121 };
122 #define INT_ENABLE_OFFSET(v) \
123 (sizeof(vcpu_info_t) * (v)->vcpu_id + \
124 offsetof(vcpu_info_t, evtchn_upcall_mask))
126 struct arch_vcpu {
127 /* Save the state of vcpu.
128 This is the first entry to speed up accesses. */
129 mapped_regs_t *privregs;
131 /* TR and TC. */
132 TR_ENTRY itrs[NITRS];
133 TR_ENTRY dtrs[NDTRS];
134 TR_ENTRY itlb;
135 TR_ENTRY dtlb;
137 /* Bit is set if there is a tr/tc for the region. */
138 unsigned char itr_regions;
139 unsigned char dtr_regions;
140 unsigned char tc_regions;
142 unsigned long irr[4]; /* Interrupt request register. */
143 unsigned long insvc[4]; /* Interrupt in service. */
144 unsigned long iva;
145 unsigned long dcr;
146 unsigned long domain_itm;
147 unsigned long domain_itm_last;
149 unsigned long event_callback_ip; // event callback handler
150 unsigned long failsafe_callback_ip; // Do we need it?
152 /* These fields are copied from arch_domain to make access easier/faster
153 in assembly code. */
154 unsigned long metaphysical_rr0; // from arch_domain (so is pinned)
155 unsigned long metaphysical_rr4; // from arch_domain (so is pinned)
156 unsigned long metaphysical_saved_rr0; // from arch_domain (so is pinned)
157 unsigned long metaphysical_saved_rr4; // from arch_domain (so is pinned)
158 int breakimm; // from arch_domain (so is pinned)
159 int starting_rid; /* first RID assigned to domain */
160 int ending_rid; /* one beyond highest RID assigned to domain */
162 struct thread_struct _thread; // this must be last
164 thash_cb_t vtlb;
165 thash_cb_t vhpt;
166 char irq_new_pending;
167 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
168 char hypercall_continuation;
169 //for phycial emulation
170 unsigned long old_rsc;
171 int mode_flags;
172 fpswa_ret_t fpswa_ret; /* save return values of FPSWA emulation */
173 struct timer hlt_timer;
174 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
176 #define INVALID_PROCESSOR INT_MAX
177 int last_processor;
178 };
180 #include <asm/uaccess.h> /* for KERNEL_DS */
181 #include <asm/pgtable.h>
183 #endif /* __ASM_DOMAIN_H__ */
185 /*
186 * Local variables:
187 * mode: C
188 * c-set-style: "BSD"
189 * c-basic-offset: 4
190 * tab-width: 4
191 * indent-tabs-mode: nil
192 * End:
193 */