ia64/xen-unstable

view xen/include/asm-powerpc/domain.h @ 13943:4ce0b332b572

[POWERPC][XEN] Move shared page location to public header to share with libxc.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Tue Feb 06 13:42:19 2007 -0600 (2007-02-06)
parents a510c94ceaa3
children 6b42b8c08731
line source
1 /*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright (C) IBM Corp. 2005
17 *
18 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 */
21 #ifndef _ASM_DOMAIN_H_
22 #define _ASM_DOMAIN_H_
24 #include <xen/cache.h>
25 #include <xen/sched.h>
26 #include <xen/list.h>
27 #include <xen/errno.h>
28 #include <xen/mm.h>
29 #include <public/arch-powerpc.h>
30 #include <asm/htab.h>
31 #include <asm/powerpc64/ppc970.h>
33 struct arch_domain {
34 struct domain_htab htab;
36 /* The Real Mode area is fixed to the domain and is accessible while the
37 * processor is in real mode */
38 struct page_info *rma_page;
39 uint rma_order;
41 /* list of extents beyond RMA */
42 struct list_head extent_list;
44 uint foreign_mfn_count;
45 uint *foreign_mfns;
47 /* I/O-port access bitmap mask. */
48 u8 *iobmp_mask; /* Address of IO bitmap mask, or NULL. */
50 uint large_page_sizes;
51 uint large_page_order[4];
52 } __cacheline_aligned;
54 struct slb_entry {
55 ulong slb_vsid;
56 ulong slb_esid;
57 };
58 #define SLB_ESID_VALID (1ULL << (63 - 36))
59 #define SLB_ESID_CLASS (1ULL << (63 - 56))
60 #define SLB_ESID_MASK (~0ULL << (63 - 35))
61 #define SLBIE_CLASS_LOG (63-36)
62 #define SLBMTE_ENTRY_MASK ((0x1UL << (63 - 52 + 1)) - 1)
64 struct xencomm;
66 typedef struct {
67 u32 u[4];
68 } __attribute__((aligned(16))) vector128;
70 struct arch_vcpu {
71 cpu_user_regs_t ctxt; /* User-level CPU registers */
73 #ifdef HAS_FLOAT
74 double fprs[NUM_FPRS];
75 #endif
76 #ifdef HAS_VMX
77 vector128 vrs[32];
78 vector128 vscr;
79 u32 vrsave;
80 #endif
82 /* Special-Purpose Registers */
83 ulong sprg[4];
84 ulong timebase;
85 ulong dar;
86 ulong dsisr;
88 /* Segment Lookaside Buffer */
89 struct slb_entry slb_entries[NUM_SLB_ENTRIES];
91 /* I/O-port access bitmap. */
92 XEN_GUEST_HANDLE(uint8_t) iobmp; /* Guest kernel virtual address of the bitmap. */
93 int iobmp_limit; /* Number of ports represented in the bitmap. */
94 int iopl; /* Current IOPL for this VCPU. */
96 u32 dec;
97 struct cpu_vcpu cpu; /* CPU-specific bits */
98 struct xencomm *xencomm;
99 } __cacheline_aligned;
101 extern void full_resume(void);
103 extern void save_sprs(struct vcpu *);
104 extern void load_sprs(struct vcpu *);
105 extern void save_segments(struct vcpu *);
106 extern void load_segments(struct vcpu *);
107 extern void save_float(struct vcpu *);
108 extern void load_float(struct vcpu *);
110 #define rma_size(rma_order) (1UL << ((rma_order) + PAGE_SHIFT))
112 static inline ulong rma_addr(struct arch_domain *ad, int type)
113 {
114 return rma_size(ad->rma_order) - (type * PAGE_SIZE);
115 }
117 #endif