aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'extras/mini-os/mm.c')
-rw-r--r--extras/mini-os/mm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/extras/mini-os/mm.c b/extras/mini-os/mm.c
index f204fa66ec..2cc9e9db6d 100644
--- a/extras/mini-os/mm.c
+++ b/extras/mini-os/mm.c
@@ -36,6 +36,7 @@
#include <os.h>
#include <hypervisor.h>
+#include <xen/memory.h>
#include <mm.h>
#include <types.h>
#include <lib.h>
@@ -360,6 +361,17 @@ void free_pages(void *pointer, int order)
}
+int free_physical_pages(xen_pfn_t *mfns, int n)
+{
+ struct xen_memory_reservation reservation;
+
+ set_xen_guest_handle(reservation.extent_start, mfns);
+ reservation.nr_extents = n;
+ reservation.extent_order = 0;
+ reservation.domid = DOMID_SELF;
+ return HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
+}
+
#ifdef HAVE_LIBC
void *sbrk(ptrdiff_t increment)
{