Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Sep 2007 19:41:49 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 126437 for review
Message-ID:  <200709151941.l8FJfn3Q097756@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126437

Change 126437 by kmacy@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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709151941.l8FJfn3Q097756>