Date: Sat, 15 Sep 2007 19:40:47 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 126436 for review Message-ID: <200709151940.l8FJelcx097554@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126436 Change 126436 by kmacy@kmacy_home:ethng on 2007/09/15 19:40:01 Allow architectures to define their own contigmalloc2 variant - this makes it possible for them to simply use the direct map rather than mapping each page on allocate and unmapping on free Affected files ... .. //depot/projects/ethng/src/sys/vm/vm_contig.c#2 edit .. //depot/projects/ethng/src/sys/vm/vm_extern.h#2 edit Differences ... ==== //depot/projects/ethng/src/sys/vm/vm_contig.c#2 (text+ko) ==== @@ -183,7 +183,8 @@ vm_page_unlock_queues(); } -static void * +#ifndef VM_MD_CONTIG +void * contigmalloc2(vm_page_t m, vm_pindex_t npages, int flags) { vm_object_t object = kernel_object; @@ -220,6 +221,17 @@ return ((void *)addr); } +void +contigfree(void *addr, unsigned long size, struct malloc_type *type) +{ + vm_pindex_t npgs; + + npgs = round_page(size) >> PAGE_SHIFT; + kmem_free(kernel_map, (vm_offset_t)addr, size); + malloc_type_freed(type, npgs << PAGE_SHIFT); +} +#endif + void * contigmalloc( unsigned long size, /* should be size_t here and for malloc() */ @@ -280,12 +292,3 @@ return (ret); } -void -contigfree(void *addr, unsigned long size, struct malloc_type *type) -{ - vm_pindex_t npgs; - - npgs = round_page(size) >> PAGE_SHIFT; - kmem_free(kernel_map, (vm_offset_t)addr, size); - malloc_type_freed(type, npgs << PAGE_SHIFT); -} ==== //depot/projects/ethng/src/sys/vm/vm_extern.h#2 (text+ko) ==== @@ -96,5 +96,7 @@ void vm_thread_new_altkstack(struct thread *td, int pages); void vm_thread_swapin(struct thread *td); void vm_thread_swapout(struct thread *td); + +void *contigmalloc2(vm_page_t m, vm_pindex_t npages, int flags); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709151940.l8FJelcx097554>