[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] arm: Implement get_page_from_gfn()
# HG changeset patch # User Tim Deegan <tim@xxxxxxx> # Date 1337246694 -3600 # Node ID f460709523fc075f398b4c2ff3002054df60f200 # Parent 94f50850e650895f794b21eac7d8c01b8f336fbc arm: Implement get_page_from_gfn() We will be calling this from common code, so add a basic implementation to arch/arm. After 4.2 we should reshuffle some of the p2m interface out of arch/x86 into common headers; for now duplicate a little bit of it. Signed-off-by: Tim Deegan <tim@xxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- diff -r 94f50850e650 -r f460709523fc xen/include/asm-arm/p2m.h --- a/xen/include/asm-arm/p2m.h Thu May 17 10:24:54 2012 +0100 +++ b/xen/include/asm-arm/p2m.h Thu May 17 10:24:54 2012 +0100 @@ -53,6 +53,28 @@ p2m_pod_decrease_reservation(struct doma xen_pfn_t gpfn, unsigned int order); +/* Look up a GFN and take a reference count on the backing page. */ +typedef int p2m_type_t; +typedef unsigned int p2m_query_t; +#define P2M_ALLOC (1u<<0) /* Populate PoD and paged-out entries */ +#define P2M_UNSHARE (1u<<1) /* Break CoW sharing */ + +static inline struct page_info *get_page_from_gfn( + struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q) +{ + struct page_info *page; + unsigned long mfn = gmfn_to_mfn(d, gfn); + + ASSERT(t == NULL); + + if (!mfn_valid(mfn)) + return NULL; + page = mfn_to_page(mfn); + if ( !get_page(page, d) ) + return NULL; + return page; +} + /* Compatibility function exporting the old untyped interface */ static inline unsigned long get_gfn_untyped(struct domain *d, unsigned long gpfn) { _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |