nmi_backtrace: generate one-line reports for idle cpus
[cascardo/linux.git] / mm / memblock.c
index ff5ff3b..c8dfa43 100644 (file)
@@ -482,7 +482,7 @@ static void __init_memblock memblock_merge_regions(struct memblock_type *type)
  * @flags:     flags of the new region
  *
  * Insert new memblock region [@base,@base+@size) into @type at @idx.
- * @type must already have extra room to accomodate the new region.
+ * @type must already have extra room to accommodate the new region.
  */
 static void __init_memblock memblock_insert_region(struct memblock_type *type,
                                                   int idx, phys_addr_t base,
@@ -544,7 +544,7 @@ repeat:
        /*
         * The following is executed twice.  Once with %false @insert and
         * then with %true.  The first counts the number of regions needed
-        * to accomodate the new area.  The second actually inserts them.
+        * to accommodate the new area.  The second actually inserts them.
         */
        base = obase;
        nr_new = 0;
@@ -994,7 +994,10 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags,
 
        if (*idx == (u64)ULLONG_MAX) {
                idx_a = type_a->cnt - 1;
-               idx_b = type_b->cnt;
+               if (type_b != NULL)
+                       idx_b = type_b->cnt;
+               else
+                       idx_b = 0;
        }
 
        for (; idx_a >= 0; idx_a--) {
@@ -1435,6 +1438,11 @@ phys_addr_t __init_memblock memblock_phys_mem_size(void)
        return memblock.memory.total_size;
 }
 
+phys_addr_t __init_memblock memblock_reserved_size(void)
+{
+       return memblock.reserved.total_size;
+}
+
 phys_addr_t __init memblock_mem_size(unsigned long limit_pfn)
 {
        unsigned long pages = 0;