15 #include <linux/export.h>
16 #include <linux/screen_info.h>
26 #include <asm/addrspace.h>
27 #include <asm/bootinfo.h>
29 #include <asm/cache.h>
31 #include <asm/sections.h>
32 #include <asm/setup.h>
33 #include <asm/smp-ops.h>
65 #ifdef CONFIG_CMDLINE_BOOL
76 static struct resource code_resource = { .name =
"Kernel code", };
77 static struct resource data_resource = { .name =
"Kernel data", };
85 if (start + size < start) {
86 pr_warning(
"Trying to add an invalid memory region, skipped\n");
97 if (entry->type != type)
100 if (start + size < entry->
addr)
103 if (entry->addr + entry->size < start)
106 top =
max(entry->addr + entry->size, start + size);
107 entry->addr =
min(entry->addr, start);
108 entry->size = top - entry->addr;
114 pr_err(
"Ooops! Too many entries in the memory map!\n");
124 static void __init print_memory_map(
void)
127 const int field = 2 *
sizeof(
unsigned long);
157 #ifdef CONFIG_BLK_DEV_INITRD
159 static int __init rd_start_early(
char *
p)
174 static int __init rd_size_early(
char *p)
182 static unsigned long __init init_initrd(
void)
195 pr_err(
"initrd start must be page aligned\n");
199 pr_err(
"initrd start < PAGE_OFFSET\n");
238 pr_info(
"Initial ramdisk at: 0x%lx (%lu bytes)\n",
249 static unsigned long __init init_initrd(
void)
254 #define finalize_initrd() do {} while (0)
262 #ifdef CONFIG_SGI_IP27
274 unsigned long reserved_end;
275 unsigned long mapstart = ~0
UL;
276 unsigned long bootmap_size;
284 reserved_end =
max(init_initrd(),
311 if (end <= reserved_end)
313 if (start >= mapstart)
315 mapstart =
max(reserved_end, start);
319 panic(
"Incorrect memory mapping !!!");
321 pr_info(
"Wasting %lu bytes for tracking %lu unused pages\n",
325 pr_info(
"%lu free pages won't be used\n",
335 #ifdef CONFIG_HIGHMEM
361 #ifndef CONFIG_HIGHMEM
405 if (start < reserved_end)
406 start = reserved_end;
459 static int __init early_parse_mem(
char *p)
482 static void __init arch_mem_init(
char **cmdline_p)
493 init_size = init_end - init_mem;
511 pr_info(
"Determined physical RAM map:\n");
514 #ifdef CONFIG_CMDLINE_BOOL
515 #ifdef CONFIG_CMDLINE_OVERRIDE
518 if (builtin_cmdline[0]) {
534 pr_info(
"User-defined physical RAM map:\n");
545 static void __init resource_init(
void)
576 res->
name =
"System RAM";
580 res->
name =
"reserved";
604 #ifdef CONFIG_EARLY_PRINTK
610 #if defined(CONFIG_VT)
611 #if defined(CONFIG_VGA_CONSOLE)
613 #elif defined(CONFIG_DUMMY_CONSOLE)
618 arch_mem_init(cmdline_p);
629 #ifdef CONFIG_DEBUG_FS
631 static int __init debugfs_mips(
void)
638 mips_debugfs_dir =
d;