ia64/xen-unstable

view xen/include/asm-x86/shared.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 2f9e1348aa98
children
line source
1 #ifndef __XEN_X86_SHARED_H__
2 #define __XEN_X86_SHARED_H__
4 #ifdef CONFIG_COMPAT
6 #define nmi_reason(d) (!has_32bit_shinfo(d) ? \
7 (u32 *)&(d)->shared_info->native.arch.nmi_reason : \
8 (u32 *)&(d)->shared_info->compat.arch.nmi_reason)
10 #define GET_SET_SHARED(type, field) \
11 static inline type arch_get_##field(const struct domain *d) \
12 { \
13 return !has_32bit_shinfo(d) ? \
14 d->shared_info->native.arch.field : \
15 d->shared_info->compat.arch.field; \
16 } \
17 static inline void arch_set_##field(struct domain *d, \
18 type val) \
19 { \
20 if ( !has_32bit_shinfo(d) ) \
21 d->shared_info->native.arch.field = val; \
22 else \
23 d->shared_info->compat.arch.field = val; \
24 }
26 #define GET_SET_VCPU(type, field) \
27 static inline type arch_get_##field(const struct vcpu *v) \
28 { \
29 if ( unlikely(!v->vcpu_info) ) \
30 return 0; \
31 return !has_32bit_shinfo(v->domain) ? \
32 v->vcpu_info->native.arch.field : \
33 v->vcpu_info->compat.arch.field; \
34 } \
35 static inline void arch_set_##field(struct vcpu *v, \
36 type val) \
37 { \
38 if ( !has_32bit_shinfo(v->domain) ) \
39 v->vcpu_info->native.arch.field = val; \
40 else \
41 v->vcpu_info->compat.arch.field = val; \
42 }
44 #else
46 #define nmi_reason(d) ((u32 *)&(d)->shared_info->arch.nmi_reason)
48 #define GET_SET_SHARED(type, field) \
49 static inline type arch_get_##field(const struct domain *d) \
50 { \
51 return d->shared_info->arch.field; \
52 } \
53 static inline void arch_set_##field(struct domain *d, \
54 type val) \
55 { \
56 d->shared_info->arch.field = val; \
57 }
59 #define GET_SET_VCPU(type, field) \
60 static inline type arch_get_##field(const struct vcpu *v) \
61 { \
62 return v->vcpu_info ? v->vcpu_info->arch.field : 0; \
63 } \
64 static inline void arch_set_##field(struct vcpu *v, \
65 type val) \
66 { \
67 v->vcpu_info->arch.field = val; \
68 }
69 #endif
71 GET_SET_SHARED(unsigned long, max_pfn)
72 GET_SET_SHARED(xen_pfn_t, pfn_to_mfn_frame_list_list)
73 GET_SET_SHARED(unsigned long, nmi_reason)
75 GET_SET_VCPU(unsigned long, cr2)
77 #undef GET_SET_VCPU
78 #undef GET_SET_SHARED
80 #endif /* __XEN_X86_SHARED_H__ */