|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] Introduce a p2m class.
>>> On 26.01.15 at 23:57, <edmund.h.white@xxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/p2m.h
> +++ b/xen/include/asm-x86/p2m.h
> @@ -172,6 +172,11 @@ typedef unsigned int p2m_query_t;
> (P2M_RAM_TYPES | P2M_GRANT_TYPES | \
> p2m_to_mask(p2m_map_foreign)))
>
> +typedef enum {
> + p2m_host = 0,
> + p2m_nested = 1,
> +} p2m_class_t;
No explicit numbers here please - you don't really have a need to
override the language defined default behavior.
> @@ -297,7 +304,15 @@ struct p2m_domain *p2m_get_nestedp2m(struct vcpu *v,
> uint64_t np2m_base);
> */
> struct p2m_domain *p2m_get_p2m(struct vcpu *v);
>
> -#define p2m_is_nestedp2m(p2m) ((p2m) != p2m_get_hostp2m((p2m->domain)))
> +static inline bool_t p2m_is_hostp2m(struct p2m_domain *p2m)
> +{
> + return p2m->p2m_class == p2m_host;
> +}
> +
> +static inline bool_t p2m_is_nestedp2m(struct p2m_domain *p2m)
> +{
> + return p2m->p2m_class == p2m_nested;
> +}
Please properly constify the function parameters.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |