setup.c (66e6a5a1fcd2f3e05f4d499b539a1f77ceb52d1d) setup.c (15d45cce3a0e0716fa49c768f887c6406dfb91f7)
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995 Linus Torvalds
7 * Copyright (C) 1995 Waldorf Electronics
8 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 03 Ralf Baechle

--- 68 unchanged lines hidden (view full) ---

77const unsigned long mips_io_port_base = -1;
78EXPORT_SYMBOL(mips_io_port_base);
79
80static struct resource code_resource = { .name = "Kernel code", };
81static struct resource data_resource = { .name = "Kernel data", };
82
83static void *detect_magic __initdata = detect_memory_region;
84
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995 Linus Torvalds
7 * Copyright (C) 1995 Waldorf Electronics
8 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 03 Ralf Baechle

--- 68 unchanged lines hidden (view full) ---

77const unsigned long mips_io_port_base = -1;
78EXPORT_SYMBOL(mips_io_port_base);
79
80static struct resource code_resource = { .name = "Kernel code", };
81static struct resource data_resource = { .name = "Kernel data", };
82
83static void *detect_magic __initdata = detect_memory_region;
84
85void __init add_memory_region(phys_t start, phys_t size, long type)
85void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
86{
87 int x = boot_mem_map.nr_map;
88 int i;
89
90 /* Sanity check */
91 if (start + size < start) {
86{
87 int x = boot_mem_map.nr_map;
88 int i;
89
90 /* Sanity check */
91 if (start + size < start) {
92 pr_warning("Trying to add an invalid memory region, skipped\n");
92 pr_warn("Trying to add an invalid memory region, skipped\n");
93 return;
94 }
95
96 /*
97 * Try to merge with existing entry, if any.
98 */
99 for (i = 0; i < boot_mem_map.nr_map; i++) {
100 struct boot_mem_map_entry *entry = boot_mem_map.map + i;

--- 21 unchanged lines hidden (view full) ---

122 }
123
124 boot_mem_map.map[x].addr = start;
125 boot_mem_map.map[x].size = size;
126 boot_mem_map.map[x].type = type;
127 boot_mem_map.nr_map++;
128}
129
93 return;
94 }
95
96 /*
97 * Try to merge with existing entry, if any.
98 */
99 for (i = 0; i < boot_mem_map.nr_map; i++) {
100 struct boot_mem_map_entry *entry = boot_mem_map.map + i;

--- 21 unchanged lines hidden (view full) ---

122 }
123
124 boot_mem_map.map[x].addr = start;
125 boot_mem_map.map[x].size = size;
126 boot_mem_map.map[x].type = type;
127 boot_mem_map.nr_map++;
128}
129
130void __init detect_memory_region(phys_t start, phys_t sz_min, phys_t sz_max)
130void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max)
131{
132 void *dm = &detect_magic;
131{
132 void *dm = &detect_magic;
133 phys_t size;
133 phys_addr_t size;
134
135 for (size = sz_min; size < sz_max; size <<= 1) {
136 if (!memcmp(dm, dm + size, sizeof(detect_magic)))
137 break;
138 }
139
140 pr_debug("Memory: %lluMB of RAM detected at 0x%llx (min: %lluMB, max: %lluMB)\n",
141 ((unsigned long long) size) / SZ_1M,

--- 398 unchanged lines hidden (view full) ---

540 * If we don't find it in the memory map, then we shouldn't
541 * have to worry about it, as the new kernel won't use it.
542 */
543 return 0;
544}
545early_param("elfcorehdr", early_parse_elfcorehdr);
546#endif
547
134
135 for (size = sz_min; size < sz_max; size <<= 1) {
136 if (!memcmp(dm, dm + size, sizeof(detect_magic)))
137 break;
138 }
139
140 pr_debug("Memory: %lluMB of RAM detected at 0x%llx (min: %lluMB, max: %lluMB)\n",
141 ((unsigned long long) size) / SZ_1M,

--- 398 unchanged lines hidden (view full) ---

540 * If we don't find it in the memory map, then we shouldn't
541 * have to worry about it, as the new kernel won't use it.
542 */
543 return 0;
544}
545early_param("elfcorehdr", early_parse_elfcorehdr);
546#endif
547
548static void __init arch_mem_addpart(phys_t mem, phys_t end, int type)
548static void __init arch_mem_addpart(phys_addr_t mem, phys_addr_t end, int type)
549{
549{
550 phys_t size;
550 phys_addr_t size;
551 int i;
552
553 size = end - mem;
554 if (!size)
555 return;
556
557 /* Make sure it is in the boot_mem_map */
558 for (i = 0; i < boot_mem_map.nr_map; i++) {

--- 247 unchanged lines hidden ---
551 int i;
552
553 size = end - mem;
554 if (!size)
555 return;
556
557 /* Make sure it is in the boot_mem_map */
558 for (i = 0; i < boot_mem_map.nr_map; i++) {

--- 247 unchanged lines hidden ---