@@ -360,12 +360,6 @@ int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
return 0;
}
-int destroy_xen_mappings(unsigned long s, unsigned long e)
-{
- BUG_ON("unimplemented");
- return -1;
-}
-
void share_xen_page_with_guest(struct page_info *page, struct domain *d,
enum XENSHARE_flags flags)
{
@@ -421,6 +421,14 @@ int map_pages_to_xen(unsigned long virt,
return pt_update(virt, mfn, nr_mfns, flags);
}
+int destroy_xen_mappings(unsigned long s, unsigned long e)
+{
+ ASSERT(IS_ALIGNED(s, PAGE_SIZE));
+ ASSERT(IS_ALIGNED(e, PAGE_SIZE));
+
+ return ( s < e ) ? pt_update(s, INVALID_MFN, PFN_DOWN(e - s), 0) : -EINVAL;
+}
+
int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns)
{
return pt_update(virt, INVALID_MFN, nr_mfns, PTE_POPULATE);