ia64/xen-unstable

view xen/include/asm-ia64/domain.h @ 9770:ced37bea0647

[IA64] FPH enabling + cleanup

Move contents of switch_to macro from xensystem.h to context_switch function.
Initialize FPU on all processors. FPH is always enabled in Xen.
Speed up context-switch (a little bit!) by not enabling/disabling FPH.
Cleanup (unused function/variablesi/fields, debug printf...)
vmx_ia64_switch_to removed (was unused).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Tue Apr 25 22:35:41 2006 -0600 (2006-04-25)
parents 7c7bcf173f8b
children 3ab5ab4d6d75
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 TR_ENTRY itrs[NITRS];
67 TR_ENTRY dtrs[NDTRS];
68 TR_ENTRY itlb;
69 TR_ENTRY dtlb;
70 unsigned int itr_regions;
71 unsigned int dtr_regions;
72 unsigned long itlb_pte;
73 unsigned long dtlb_pte;
74 unsigned long irr[4];
75 unsigned long insvc[4];
76 unsigned long tc_regions;
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;
84 mapped_regs_t *privregs; /* save the state of vcpu */
86 /* These fields are copied from arch_domain to make access easier/faster
87 in assembly code. */
88 unsigned long metaphysical_rr0; // from arch_domain (so is pinned)
89 unsigned long metaphysical_rr4; // from arch_domain (so is pinned)
90 unsigned long metaphysical_saved_rr0; // from arch_domain (so is pinned)
91 unsigned long metaphysical_saved_rr4; // from arch_domain (so is pinned)
92 int breakimm; // from arch_domain (so is pinned)
93 int starting_rid; /* first RID assigned to domain */
94 int ending_rid; /* one beyond highest RID assigned to domain */
96 struct thread_struct _thread; // this must be last
98 thash_cb_t vtlb;
99 thash_cb_t vhpt;
100 char irq_new_pending;
101 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
102 char hypercall_continuation;
103 //for phycial emulation
104 unsigned long old_rsc;
105 int mode_flags;
106 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
107 };
109 //#define thread arch._thread
111 // FOLLOWING FROM linux-2.6.7/include/sched.h
113 struct mm_struct {
114 pgd_t * pgd;
115 // atomic_t mm_users; /* How many users with user space? */
116 struct list_head pt_list; /* List of pagetable */
117 };
119 extern struct mm_struct init_mm;
121 struct page_info * assign_new_domain_page(struct domain *d, unsigned long mpaddr);
122 void assign_new_domain0_page(struct domain *d, unsigned long mpaddr);
123 void assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr);
124 void assign_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long flags);
125 #ifdef CONFIG_XEN_IA64_DOM0_VP
126 unsigned long assign_domain_mmio_page(struct domain *d, unsigned long mpaddr, unsigned long size);
127 unsigned long assign_domain_mach_page(struct domain *d, unsigned long mpaddr, unsigned long size);
128 unsigned long do_dom0vp_op(unsigned long cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3);
129 unsigned long dom0vp_populate_physmap(struct domain *d, unsigned long gpfn, unsigned int extent_order, unsigned int address_bits);
130 unsigned long dom0vp_zap_physmap(struct domain *d, unsigned long gpfn, unsigned int extent_order);
131 unsigned long dom0vp_add_physmap(struct domain* d, unsigned long gpfn, unsigned long mfn, unsigned int flags, domid_t domid);
132 #endif
134 #include <asm/uaccess.h> /* for KERNEL_DS */
135 #include <asm/pgtable.h>
137 #endif /* __ASM_DOMAIN_H__ */
139 /*
140 * Local variables:
141 * mode: C
142 * c-set-style: "BSD"
143 * c-basic-offset: 4
144 * tab-width: 4
145 * indent-tabs-mode: nil
146 * End:
147 */