[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-merge] [PATCH 12/23] pgalloc subarch headers
--- linux-2.6.12-xen0-arch.orig/include/asm-i386/pgalloc.h +++ linux-2.6.12-xen0-arch/include/asm-i386/pgalloc.h @@ -6,13 +6,13 @@ #include <linux/threads.h> #include <linux/mm.h> /* for struct page */ +#include <mach_pgalloc.h> + #define pmd_populate_kernel(mm, pmd, pte) \ set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) -#define pmd_populate(mm, pmd, pte) \ - set_pmd(pmd, __pmd(_PAGE_TABLE + \ - ((unsigned long long)page_to_pfn(pte) << \ - (unsigned long long) PAGE_SHIFT))) +#define pmd_populate(mm, pmd, pte) mach_pmd_populate(mm, pmd, pte) + /* * Allocate and free page tables. */ @@ -24,12 +24,12 @@ extern struct page *pte_alloc_one(struct static inline void pte_free_kernel(pte_t *pte) { - free_page((unsigned long)pte); + mach_pte_free_kernel(pte); } static inline void pte_free(struct page *pte) { - __free_page(pte); + mach_pte_free(pte); } --- /dev/null +++ linux-2.6.12-xen0-arch/include/asm-i386/mach-default/mach_pgalloc.h @@ -0,0 +1,15 @@ +#ifndef _ASM_MACH_PGALLOC_H +#define _ASM_MACH_PGALLOC_H + +#define mach_pmd_populate(mm, pmd, pte) \ + set_pmd(pmd, __pmd(_PAGE_TABLE + \ + ((unsigned long long)page_to_pfn(pte) << \ + (unsigned long long) PAGE_SHIFT))) +/* + * free page tables + */ +#define mach_pte_free_kernel(_pte) free_page((unsigned long)_pte) + +#define mach_pte_free(_pte) __free_page(_pte) + +#endif --- linux-2.6.12-xen0/include/asm-i386/mach-xen/mach_pgalloc.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.12-xen0-arch/include/asm-i386/mach-xen/mach_pgalloc.h 2005-08-02 21:26:41.000000000 -0700 @@ -0,0 +1,31 @@ +#ifndef _ASM_MACH_PGALLOC_H +#define _ASM_MACH_PGALLOC_H + +#define mach_pmd_populate(mm, pmd, pte) \ +do { \ + if (unlikely((mm)->context.pinned)) { \ + if (!PageHighMem(pte)) \ + HYPERVISOR_update_va_mapping( \ + (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT),\ + pfn_pte(page_to_pfn(pte), PAGE_KERNEL_RO), 0);\ + set_pmd(pmd, __pmd(_PAGE_TABLE + \ + ((unsigned long long)page_to_pfn(pte) << \ + (unsigned long long) PAGE_SHIFT))); \ + } else { \ + *(pmd) = __pmd(_PAGE_TABLE + \ + ((unsigned long long)page_to_pfn(pte) << \ + (unsigned long long) PAGE_SHIFT)); \ + } \ +} while (0) + +/* + * free page tables + */ +#define mach_pte_free_kernel(_pte) \ + free_page((unsigned long)_pte); \ + make_page_writable(_pte) + +void _pte_free(struct page *pte); +#define mach_pte_free(_pte) _pte_free(_pte) + +#endif -- _______________________________________________ Xen-merge mailing list Xen-merge@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-merge
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |