Skip to contentSkip to conversation

minios: fix case when _text is not 0

PATCH New Samuel Thibault 1 participant 1 message Jan 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios: fix case when _text is not 0

fix case when _text is not 0

extras/mini-os/arch/x86/mm.c +5 -5
diff -r b7ba0be77a47 extras/mini-os/arch/x86/mm.c
@@ -564,11 +564,11 @@ static void clear_bootstrap(void)
     int n = sizeof(mfns)/sizeof(*mfns);
     pte_t nullpte = { };
 
-    /* Use page 0 as the CoW zero page */
-    memset(NULL, 0, PAGE_SIZE);
-    mfn_zero = pfn_to_mfn(0);
-    if (HYPERVISOR_update_va_mapping(0, nullpte, UVMF_INVLPG))
-	printk("Unable to unmap page 0\n");
+    /* Use first page as the CoW zero page */
+    memset(&_text, 0, PAGE_SIZE);
+    mfn_zero = pfn_to_mfn((unsigned long) &_text);
+    if (HYPERVISOR_update_va_mapping((unsigned long) &_text, nullpte, UVMF_INVLPG))
+	printk("Unable to unmap first page\n");
 
     set_xen_guest_handle(reservation.extent_start, mfns);
     reservation.nr_extents = n;