aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/Kconfig3
-rw-r--r--mm/memblock.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/mm/Kconfig b/mm/Kconfig
index 1b5a95f0fa01..28cec518f4d4 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -134,6 +134,9 @@ config HAVE_MEMBLOCK
134config HAVE_MEMBLOCK_NODE_MAP 134config HAVE_MEMBLOCK_NODE_MAP
135 boolean 135 boolean
136 136
137config HAVE_MEMBLOCK_PHYS_MAP
138 boolean
139
137config ARCH_DISCARD_MEMBLOCK 140config ARCH_DISCARD_MEMBLOCK
138 boolean 141 boolean
139 142
diff --git a/mm/memblock.c b/mm/memblock.c
index 9edd0928daab..a810ba923cdd 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -27,6 +27,9 @@
27 27
28static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; 28static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;
29static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; 29static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;
30#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
31static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock;
32#endif
30 33
31struct memblock memblock __initdata_memblock = { 34struct memblock memblock __initdata_memblock = {
32 .memory.regions = memblock_memory_init_regions, 35 .memory.regions = memblock_memory_init_regions,
@@ -37,6 +40,12 @@ struct memblock memblock __initdata_memblock = {
37 .reserved.cnt = 1, /* empty dummy entry */ 40 .reserved.cnt = 1, /* empty dummy entry */
38 .reserved.max = INIT_MEMBLOCK_REGIONS, 41 .reserved.max = INIT_MEMBLOCK_REGIONS,
39 42
43#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
44 .physmem.regions = memblock_physmem_init_regions,
45 .physmem.cnt = 1, /* empty dummy entry */
46 .physmem.max = INIT_PHYSMEM_REGIONS,
47#endif
48
40 .bottom_up = false, 49 .bottom_up = false,
41 .current_limit = MEMBLOCK_ALLOC_ANYWHERE, 50 .current_limit = MEMBLOCK_ALLOC_ANYWHERE,
42}; 51};
@@ -1553,6 +1562,9 @@ static int __init memblock_init_debugfs(void)
1553 return -ENXIO; 1562 return -ENXIO;
1554 debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops); 1563 debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
1555 debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops); 1564 debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);
1565#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
1566 debugfs_create_file("physmem", S_IRUGO, root, &memblock.physmem, &memblock_debug_fops);
1567#endif
1556 1568
1557 return 0; 1569 return 0;
1558} 1570}