aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/mm.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-04-16 10:05:57 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-04-16 10:05:57 +0100
commit28baa78877ebda840603774d6a1e3e9da9546a6e (patch)
tree7f3e7943f2838769040a19258e95fa79b8c105bf /extras/mini-os/mm.c
parentf464d312c7b7185b7174434b61d00903949d3a76 (diff)
downloadxen-28baa78877ebda840603774d6a1e3e9da9546a6e.tar.gz
xen-28baa78877ebda840603774d6a1e3e9da9546a6e.tar.bz2
xen-28baa78877ebda840603774d6a1e3e9da9546a6e.zip
stubdom: sparse application's BSS by linking it separately first, put
markers at its beginning and end, and then link with mini-os. That permits to stick a bit more to upstream qemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
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)
{