ia64/xen-unstable

view xen/include/asm-ia64/domain.h @ 9756:14a34d811e81

[IA64] introduce P2M conversion

introduce P2M conversion functions necessary for dom0vp model.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@ldap.hp.com
date Tue Apr 25 13:06:57 2006 -0600 (2006-04-25)
parents 2de95fd92e74
children 7a9a00c51588
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>
14 extern void domain_relinquish_resources(struct domain *);
16 /* Flush cache of domain d.
17 If sync_only is true, only synchronize I&D caches,
18 if false, flush and invalidate caches. */
19 extern void domain_cache_flush (struct domain *d, int sync_only);
21 /* Cleanly crash the current domain with a message. */
22 extern void panic_domain(struct pt_regs *, const char *, ...)
23 __attribute__ ((noreturn, format (printf, 2, 3)));
25 struct arch_domain {
26 struct mm_struct *mm;
27 unsigned long metaphysical_rr0;
28 unsigned long metaphysical_rr4;
30 /* There are two ranges of RID for a domain:
31 one big range, used to virtualize domain RID,
32 one small range for internal Xen use (metaphysical). */
33 /* Big range. */
34 int starting_rid; /* first RID assigned to domain */
35 int ending_rid; /* one beyond highest RID assigned to domain */
36 int rid_bits; /* number of virtual rid bits (default: 18) */
37 /* Metaphysical range. */
38 int starting_mp_rid;
39 int ending_mp_rid;
41 int breakimm; /* The imm value for hypercalls. */
43 int physmap_built; /* Whether is physmap built or not */
44 int imp_va_msb;
45 /* System pages out of guest memory, like for xenstore/console */
46 unsigned long sys_pgnr;
47 unsigned long max_pfn; /* Max pfn including I/O holes */
48 struct virtual_platform_def vmx_platform;
49 #define hvm_domain vmx_platform /* platform defs are not vmx specific */
51 u64 xen_vastart;
52 u64 xen_vaend;
53 u64 shared_info_va;
54 unsigned long initrd_start;
55 unsigned long initrd_len;
56 char *cmdline;
57 };
58 #define xen_vastart arch.xen_vastart
59 #define xen_vaend arch.xen_vaend
60 #define shared_info_va arch.shared_info_va
61 #define INT_ENABLE_OFFSET(v) \
62 (sizeof(vcpu_info_t) * (v)->vcpu_id + \
63 offsetof(vcpu_info_t, evtchn_upcall_mask))
65 struct arch_vcpu {
66 #if 1
67 TR_ENTRY itrs[NITRS];
68 TR_ENTRY dtrs[NDTRS];
69 TR_ENTRY itlb;
70 TR_ENTRY dtlb;
71 unsigned int itr_regions;
72 unsigned int dtr_regions;
73 unsigned long itlb_pte;
74 unsigned long dtlb_pte;
75 unsigned long irr[4];
76 unsigned long insvc[4];
77 unsigned long iva;
78 unsigned long dcr;
79 unsigned long itc;
80 unsigned long domain_itm;
81 unsigned long domain_itm_last;
82 unsigned long xen_itm;
83 #endif
84 mapped_regs_t *privregs; /* save the state of vcpu */
85 unsigned long metaphysical_rr0; // from arch_domain (so is pinned)
86 unsigned long metaphysical_rr4; // from arch_domain (so is pinned)
87 unsigned long metaphysical_saved_rr0; // from arch_domain (so is pinned)
88 unsigned long metaphysical_saved_rr4; // from arch_domain (so is pinned)
89 int breakimm; // from arch_domain (so is pinned)
90 int starting_rid; /* first RID assigned to domain */
91 int ending_rid; /* one beyond highest RID assigned to domain */
92 struct thread_struct _thread; // this must be last
94 thash_cb_t *vtlb;
95 char irq_new_pending;
96 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
97 char hypercall_continuation;
98 //for phycial emulation
99 unsigned long old_rsc;
100 int mode_flags;
101 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
102 };
104 //#define thread arch._thread
106 // FOLLOWING FROM linux-2.6.7/include/sched.h
108 struct mm_struct {
109 struct vm_area_struct * mmap; /* list of VMAs */
110 #ifndef XEN
111 struct rb_root mm_rb;
112 #endif
113 struct vm_area_struct * mmap_cache; /* last find_vma result */
114 unsigned long free_area_cache; /* first hole */
115 pgd_t * pgd;
116 atomic_t mm_users; /* How many users with user space? */
117 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
118 int map_count; /* number of VMAs */
119 #ifndef XEN
120 struct rw_semaphore mmap_sem;
121 #endif
122 spinlock_t page_table_lock; /* Protects task page tables and mm->rss */
124 struct list_head pt_list; /* List of pagetable */
126 struct list_head mmlist; /* List of all active mm's. These are globally strung
127 * together off init_mm.mmlist, and are protected
128 * by mmlist_lock
129 */
131 #ifndef XEN
132 unsigned long start_code, end_code, start_data, end_data;
133 unsigned long start_brk, brk, start_stack;
134 unsigned long arg_start, arg_end, env_start, env_end;
135 unsigned long rss, total_vm, locked_vm;
136 unsigned long def_flags;
138 unsigned long saved_auxv[40]; /* for /proc/PID/auxv */
140 unsigned dumpable:1;
141 #endif
142 #ifdef CONFIG_HUGETLB_PAGE
143 int used_hugetlb;
144 #endif
145 #ifndef XEN
146 cpumask_t cpu_vm_mask;
148 /* Architecture-specific MM context */
149 mm_context_t context;
151 /* coredumping support */
152 int core_waiters;
153 struct completion *core_startup_done, core_done;
155 /* aio bits */
156 rwlock_t ioctx_list_lock;
157 struct kioctx *ioctx_list;
159 struct kioctx default_kioctx;
160 #endif
161 };
163 extern struct mm_struct init_mm;
165 struct page_info * assign_new_domain_page(struct domain *d, unsigned long mpaddr);
166 void assign_new_domain0_page(struct domain *d, unsigned long mpaddr);
167 void assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr);
168 void assign_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long flags);
169 #ifdef CONFIG_XEN_IA64_DOM0_VP
170 unsigned long assign_domain_mmio_page(struct domain *d, unsigned long mpaddr, unsigned long size);
171 unsigned long assign_domain_mach_page(struct domain *d, unsigned long mpaddr, unsigned long size);
172 #endif
174 #include <asm/uaccess.h> /* for KERNEL_DS */
175 #include <asm/pgtable.h>
177 #endif /* __ASM_DOMAIN_H__ */
179 /*
180 * Local variables:
181 * mode: C
182 * c-set-style: "BSD"
183 * c-basic-offset: 4
184 * tab-width: 4
185 * indent-tabs-mode: nil
186 * End:
187 */