]> err.no Git - linux-2.6/blobdiff - arch/parisc/mm/init.c
Merge branch 'upstream-jeff' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
[linux-2.6] / arch / parisc / mm / init.c
index d9e4ab545b38d11fa14243f04db27014a3a956a7..aa875fa43488b8a835e2b6d079871832bc0c308f 100644 (file)
@@ -6,7 +6,7 @@
  *    changed by Philipp Rumpf
  *  Copyright 1999 Philipp Rumpf (prumpf@tux.org)
  *  Copyright 2004 Randolph Chung (tausq@debian.org)
- *  Copyright 2006 Helge Deller (deller@gmx.de)
+ *  Copyright 2006-2007 Helge Deller (deller@gmx.de)
  *
  */
 
@@ -66,11 +66,11 @@ static struct resource sysram_resources[MAX_PHYSMEM_RANGES] __read_mostly;
 physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES] __read_mostly;
 int npmem_ranges __read_mostly;
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
 #define MAX_MEM         (~0UL)
-#else /* !__LP64__ */
+#else /* !CONFIG_64BIT */
 #define MAX_MEM         (3584U*1024U*1024U)
-#endif /* !__LP64__ */
+#endif /* !CONFIG_64BIT */
 
 static unsigned long mem_limit __read_mostly = MAX_MEM;
 
@@ -78,12 +78,11 @@ static void __init mem_limit_func(void)
 {
        char *cp, *end;
        unsigned long limit;
-       extern char saved_command_line[];
 
        /* We need this before __setup() functions are called */
 
        limit = MAX_MEM;
-       for (cp = saved_command_line; *cp; ) {
+       for (cp = boot_command_line; *cp; ) {
                if (memcmp(cp, "mem=", 4) == 0) {
                        cp += 4;
                        limit = memparse(cp, &end);
@@ -455,7 +454,6 @@ unsigned long pcxl_dma_start __read_mostly;
 void __init mem_init(void)
 {
        int codesize, reservedpages, datasize, initsize;
-       int tmp;
 
        high_memory = __va((max_pfn << PAGE_SHIFT));
 
@@ -470,17 +468,33 @@ void __init mem_init(void)
                        totalram_pages += free_all_bootmem_node(NODE_DATA(i));
        }
 #endif
-       codesize =  (unsigned long) &_etext - (unsigned long) &_text;
-       datasize =  (unsigned long) &_edata - (unsigned long) &_etext;
-       initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
+
+       codesize = (unsigned long)_etext - (unsigned long)_text;
+       datasize = (unsigned long)_edata - (unsigned long)_etext;
+       initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
 
        reservedpages = 0;
-       for (tmp = 0; tmp < max_low_pfn; tmp++)
+{
+       unsigned long pfn;
+#ifdef CONFIG_DISCONTIGMEM
+       int i;
+
+       for (i = 0; i < npmem_ranges; i++) {
+               for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
+                       if (PageReserved(pfn_to_page(pfn)))
+                               reservedpages++;
+               }
+       }
+#else /* !CONFIG_DISCONTIGMEM */
+       for (pfn = 0; pfn < max_pfn; pfn++) {
                /*
                 * Only count reserved RAM pages
                 */
-               if (PageReserved(pfn_to_page(tmp)))
+               if (PageReserved(pfn_to_page(pfn)))
                        reservedpages++;
+       }
+#endif
+}
 
 #ifdef CONFIG_PA11
        if (hppa_dma_ops == &pcxl_dma_ops) {
@@ -494,20 +508,19 @@ void __init mem_init(void)
        vmalloc_start = SET_MAP_OFFSET(MAP_START);
 #endif
 
-       printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n",
-               (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
+       printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
+               (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
                num_physpages << (PAGE_SHIFT-10),
                codesize >> 10,
                reservedpages << (PAGE_SHIFT-10),
                datasize >> 10,
-               initsize >> 10,
-               (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))
-              );
+               initsize >> 10
+       );
 
 #ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
        printk("virtual kernel memory layout:\n"
               "    vmalloc : 0x%p - 0x%p   (%4ld MB)\n"
-              "    lowmem  : 0x%p - 0x%p   (%4ld MB)\n"
+              "    memory  : 0x%p - 0x%p   (%4ld MB)\n"
               "      .init : 0x%p - 0x%p   (%4ld kB)\n"
               "      .data : 0x%p - 0x%p   (%4ld kB)\n"
               "      .text : 0x%p - 0x%p   (%4ld kB)\n",
@@ -518,14 +531,14 @@ void __init mem_init(void)
               __va(0), high_memory,
               ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20,
 
-              &__init_begin, &__init_end,
-              ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10,
+              __init_begin, __init_end,
+              ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10,
 
-              &_etext, &_edata,
-              ((unsigned long)&_edata - (unsigned long)&_etext) >> 10,
+              _etext, _edata,
+              ((unsigned long)_edata - (unsigned long)_etext) >> 10,
 
-              &_text, &_etext,
-              ((unsigned long)&_etext - (unsigned long)&_text) >> 10);
+              _text, _etext,
+              ((unsigned long)_etext - (unsigned long)_text) >> 10);
 #endif
 }
 
@@ -854,9 +867,7 @@ void __init paging_init(void)
        for (i = 0; i < npmem_ranges; i++) {
                unsigned long zones_size[MAX_NR_ZONES] = { 0, };
 
-               /* We have an IOMMU, so all memory can go into a single
-                  ZONE_DMA zone. */
-               zones_size[ZONE_DMA] = pmem_ranges[i].pages;
+               zones_size[ZONE_NORMAL] = pmem_ranges[i].pages;
 
 #ifdef CONFIG_DISCONTIGMEM
                /* Need to initialize the pfnnid_map before we can initialize
@@ -879,7 +890,7 @@ void __init paging_init(void)
 #ifdef CONFIG_PA20
 
 /*
- * Currently, all PA20 chips have 18 bit protection id's, which is the
+ * Currently, all PA20 chips have 18 bit protection IDs, which is the
  * limiting factor (space ids are 32 bits).
  */
 
@@ -888,10 +899,10 @@ void __init paging_init(void)
 #else
 
 /*
- * Currently we have a one-to-one relationship between space id's and
- * protection id's. Older parisc chips (PCXS, PCXT, PCXL, PCXL2) only
- * support 15 bit protection id's, so that is the limiting factor.
- * PCXT' has 18 bit protection id's, but only 16 bit spaceids, so it's
+ * Currently we have a one-to-one relationship between space IDs and
+ * protection IDs. Older parisc chips (PCXS, PCXT, PCXL, PCXL2) only
+ * support 15 bit protection IDs, so that is the limiting factor.
+ * PCXT' has 18 bit protection IDs, but only 16 bit spaceids, so it's
  * probably not worth the effort for a special case here.
  */