ia64/xen-unstable

view xen/include/asm-x86/hap.h @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents 43833a6d50a5
children
line source
1 /******************************************************************************
2 * include/asm-x86/hap.h
3 *
4 * hardware-assisted paging
5 * Copyright (c) 2007 Advanced Micro Devices (Wei Huang)
6 *
7 * Parts of this code are Copyright (c) 2006 by XenSource Inc.
8 * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
9 * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
26 #ifndef _XEN_HAP_H
27 #define _XEN_HAP_H
29 #define HAP_PRINTK(_f, _a...) \
30 debugtrace_printk("hap: %s(): " _f, __func__, ##_a)
31 #define HAP_ERROR(_f, _a...) \
32 printk("hap error: %s(): " _f, __func__, ##_a)
34 /************************************************/
35 /* hap domain page mapping */
36 /************************************************/
37 static inline void *
38 hap_map_domain_page(mfn_t mfn)
39 {
40 return map_domain_page(mfn_x(mfn));
41 }
43 static inline void
44 hap_unmap_domain_page(void *p)
45 {
46 unmap_domain_page(p);
47 }
49 /************************************************/
50 /* locking for hap code */
51 /************************************************/
52 #define hap_lock_init(_d) \
53 do { \
54 spin_lock_init(&(_d)->arch.paging.hap.lock); \
55 (_d)->arch.paging.hap.locker = -1; \
56 (_d)->arch.paging.hap.locker_function = "nobody"; \
57 } while (0)
59 #define hap_locked_by_me(_d) \
60 (current->processor == (_d)->arch.paging.hap.locker)
62 #define hap_lock(_d) \
63 do { \
64 if ( unlikely((_d)->arch.paging.hap.locker == current->processor) )\
65 { \
66 printk("Error: hap lock held by %s\n", \
67 (_d)->arch.paging.hap.locker_function); \
68 BUG(); \
69 } \
70 spin_lock(&(_d)->arch.paging.hap.lock); \
71 ASSERT((_d)->arch.paging.hap.locker == -1); \
72 (_d)->arch.paging.hap.locker = current->processor; \
73 (_d)->arch.paging.hap.locker_function = __func__; \
74 } while (0)
76 #define hap_unlock(_d) \
77 do { \
78 ASSERT((_d)->arch.paging.hap.locker == current->processor); \
79 (_d)->arch.paging.hap.locker = -1; \
80 (_d)->arch.paging.hap.locker_function = "nobody"; \
81 spin_unlock(&(_d)->arch.paging.hap.lock); \
82 } while (0)
84 /************************************************/
85 /* hap domain level functions */
86 /************************************************/
87 void hap_domain_init(struct domain *d);
88 int hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
89 XEN_GUEST_HANDLE(void) u_domctl);
90 int hap_enable(struct domain *d, u32 mode);
91 void hap_final_teardown(struct domain *d);
92 void hap_teardown(struct domain *d);
93 void hap_vcpu_init(struct vcpu *v);
94 void hap_logdirty_init(struct domain *d);
95 int hap_track_dirty_vram(struct domain *d,
96 unsigned long begin_pfn,
97 unsigned long nr,
98 XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
100 extern struct paging_mode hap_paging_real_mode;
101 extern struct paging_mode hap_paging_protected_mode;
102 extern struct paging_mode hap_paging_pae_mode;
103 extern struct paging_mode hap_paging_long_mode;
105 #endif /* XEN_HAP_H */
107 /*
108 * Local variables:
109 * mode: C
110 * c-set-style: "BSD"
111 * c-basic-offset: 4
112 * indent-tabs-mode: nil
113 * End:
114 */