[PATCH] w1: kconfig/Makefile fix.
[linux-2.6/verdex.git] / arch / xtensa / mm / pgtable.c
blobe5e119c820e4713d5badfd650c0a9792aca99e72
1 /*
2 * arch/xtensa/mm/fault.c
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 * Chris Zankel <chris@zankel.net>
13 #if (DCACHE_SIZE > PAGE_SIZE)
15 pte_t* pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
17 pte_t *pte, p;
18 int color = ADDR_COLOR(address);
19 int i;
21 p = (pte_t*) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, COLOR_ORDER);
23 if (likely(p)) {
24 struct page *page;
26 for (i = 0; i < COLOR_SIZE; i++, p++) {
27 page = virt_to_page(pte);
29 set_page_count(page, 1);
30 ClearPageCompound(page);
32 if (ADDR_COLOR(p) == color)
33 pte = p;
34 else
35 free_page(p);
37 clear_page(pte);
39 return pte;
42 #ifdef PROFILING
44 int mask;
45 int hit;
46 int flush;
48 #endif
50 struct page* pte_alloc_one(struct mm_struct *mm, unsigned long address)
52 struct page *page, p;
53 int color = ADDR_COLOR(address);
55 p = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER);
57 if (likely(p)) {
58 for (i = 0; i < PAGE_ORDER; i++) {
59 set_page_count(p, 1);
60 ClearPageCompound(p);
62 if (PADDR_COLOR(page_address(pg)) == color)
63 page = p;
64 else
65 free_page(p);
67 clear_highpage(page);
70 return page;
73 #endif