~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/tile/mm/init.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
#include "migrate.h"
55
55
 
56
 
/*
57
 
 * We could set FORCE_MAX_ZONEORDER to "(HPAGE_SHIFT - PAGE_SHIFT + 1)"
58
 
 * in the Tile Kconfig, but this generates configure warnings.
59
 
 * Do it here and force people to get it right to compile this file.
60
 
 * The problem is that with 4KB small pages and 16MB huge pages,
61
 
 * the default value doesn't allow us to group enough small pages
62
 
 * together to make up a huge page.
63
 
 */
64
 
#if CONFIG_FORCE_MAX_ZONEORDER < HPAGE_SHIFT - PAGE_SHIFT + 1
65
 
# error "Change FORCE_MAX_ZONEORDER in arch/tile/Kconfig to match page size"
66
 
#endif
67
 
 
68
56
#define clear_pgd(pmdptr) (*(pmdptr) = hv_pte(0))
69
57
 
70
58
#ifndef __tilegx__
71
59
unsigned long VMALLOC_RESERVE = CONFIG_VMALLOC_RESERVE;
 
60
EXPORT_SYMBOL(VMALLOC_RESERVE);
72
61
#endif
73
62
 
74
 
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
75
 
 
76
63
/* Create an L2 page table */
77
64
static pte_t * __init alloc_pte(void)
78
65
{
445
432
 
446
433
/* Temporary page table we use for staging. */
447
434
static pgd_t pgtables[PTRS_PER_PGD]
448
 
 __attribute__((section(".init.page")));
 
435
 __attribute__((aligned(HV_PAGE_TABLE_ALIGN)));
449
436
 
450
437
/*
451
438
 * This maps the physical memory to kernel virtual address space, a total
653
640
        memcpy(pgd_base, pgtables, sizeof(pgtables));
654
641
        __install_page_table(pgd_base, __get_cpu_var(current_asid),
655
642
                             swapper_pgprot);
 
643
 
 
644
        /*
 
645
         * We just read swapper_pgprot and thus brought it into the cache,
 
646
         * with its new home & caching mode.  When we start the other CPUs,
 
647
         * they're going to reference swapper_pgprot via their initial fake
 
648
         * VA-is-PA mappings, which cache everything locally.  At that
 
649
         * time, if it's in our cache with a conflicting home, the
 
650
         * simulator's coherence checker will complain.  So, flush it out
 
651
         * of our cache; we're not going to ever use it again anyway.
 
652
         */
 
653
        __insn_finv(&swapper_pgprot);
656
654
}
657
655
 
658
656
/*
950
948
 
951
949
void __init pgtable_cache_init(void)
952
950
{
953
 
        pgd_cache = kmem_cache_create("pgd",
954
 
                                PTRS_PER_PGD*sizeof(pgd_t),
955
 
                                PTRS_PER_PGD*sizeof(pgd_t),
956
 
                                0,
957
 
                                NULL);
 
951
        pgd_cache = kmem_cache_create("pgd", SIZEOF_PGD, SIZEOF_PGD, 0, NULL);
958
952
        if (!pgd_cache)
959
953
                panic("pgtable_cache_init(): Cannot create pgd cache");
960
954
}
989
983
static int __init set_initfree(char *str)
990
984
{
991
985
        long val;
992
 
        if (strict_strtol(str, 0, &val)) {
 
986
        if (strict_strtol(str, 0, &val) == 0) {
993
987
                initfree = val;
994
988
                pr_info("initfree: %s free init pages\n",
995
989
                        initfree ? "will" : "won't");