]> xenbits.xensource.com Git - qemu-xen-3.4-testing.git/commitdiff
Transplant {set,unset}_mm_mapping from xen-unstable.
authorIan Jackson <iwj@mariner.uk.xensource.com>
Mon, 2 Jun 2008 14:51:27 +0000 (15:51 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 2 Jun 2008 14:51:27 +0000 (15:51 +0100)
These were in vl.c, introduced in the giant qemu 0.8.1 commit
which is xen c/s 10673:b450f21472a0574fbc382f2f84ea0a8295aa6423.

They versions transplanted here were from xen-unstable tip
as of 17737:c93a913c221f.

hw/cirrus_vga.c

index c23fc8923e1df00914c6c934a079e94547d3216e..2a37b0b9efbe4d92c47003bd7e6a19c7d6fd7be2 100644 (file)
@@ -2639,6 +2639,38 @@ static CPUWriteMemoryFunc *cirrus_linear_bitblt_write[3] = {
     cirrus_linear_bitblt_writel,
 };
 
+
+/* FIXME Flush the shadow page */
+static int unset_mm_mapping(int xc_handle, uint32_t domid,
+                     unsigned long nr_pages, unsigned int address_bits,
+                     xen_pfn_t *extent_start)
+{
+    int err = 0;
+
+    err = xc_domain_memory_decrease_reservation(xc_handle, domid,
+                                                nr_pages, 0, extent_start);
+    if (err)
+        fprintf(stderr, "Failed to decrease physmap\n");
+
+    return err;
+}
+
+static int set_mm_mapping(int xc_handle, uint32_t domid,
+                   unsigned long nr_pages, unsigned int address_bits,
+                   xen_pfn_t *extent_start)
+{
+    int err = 0;
+
+    err = xc_domain_memory_populate_physmap(xc_handle, domid, nr_pages, 0,
+                                            address_bits, extent_start);
+    if (err) {
+        fprintf(stderr, "Failed to populate physmap\n");
+        return -1;
+    }
+
+    return 0;
+}
+
 static void *set_vram_mapping(unsigned long begin, unsigned long end)
 {
     xen_pfn_t *extent_start = NULL;