PERFORCE change 126437 for review

Kip Macy kmacy at FreeBSD.org
Sat Sep 15 12:41:50 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=126437

Change 126437 by kmacy at kmacy_home:ethng on 2007/09/15 19:41:10

	switch x86_64 over to allocating kva for contigmalloc out of the direct map

Affected files ...

.. //depot/projects/ethng/src/sys/amd64/amd64/vm_machdep.c#2 edit
.. //depot/projects/ethng/src/sys/amd64/include/vmparam.h#2 edit

Differences ...

==== //depot/projects/ethng/src/sys/amd64/amd64/vm_machdep.c#2 (text+ko) ====

@@ -566,3 +566,23 @@
 
 	return 1;
 }
+
+void *
+contigmalloc2(vm_page_t m, vm_pindex_t npages, int flags)
+{
+        return (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m));
+}
+
+void
+contigfree(void *addr, unsigned long size, struct malloc_type *type)
+{
+	vm_pindex_t npgs;
+	vm_page_t m;
+	int i;
+	
+	npgs = round_page(size) >> PAGE_SHIFT;
+	m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)addr));
+	for (i = 0; i < npgs; i++, m++) 
+		vm_page_free(m);
+	malloc_type_freed(type, npgs << PAGE_SHIFT);
+}

==== //depot/projects/ethng/src/sys/amd64/include/vmparam.h#2 (text+ko) ====

@@ -185,4 +185,10 @@
 #define	VM_INITIAL_PAGEIN	16
 #endif
 
+/*
+ * We provide a machine specific contiguous mapping function
+ * which uses the direct map
+ */
+#define VM_MD_CONTIG
+
 #endif /* _MACHINE_VMPARAM_H_ */


More information about the p4-projects mailing list