10 #include <linux/module.h>
11 #include <linux/signal.h>
12 #include <linux/sched.h>
13 #include <linux/kernel.h>
14 #include <linux/errno.h>
15 #include <linux/string.h>
16 #include <linux/types.h>
17 #include <linux/ptrace.h>
18 #include <linux/mman.h>
26 #include <linux/poison.h>
29 #include <asm/sections.h>
31 #include <asm/pgtable.h>
33 #include <asm/pgalloc.h>
59 printk(
"Free swap: %6ldkB\n",
61 printk(
"%ld pages of RAM\n", totalram_pages);
62 printk(
"%ld free pages\n", nr_free_pages());
74 for (i = 0;
sp_banks[
i].num_bytes != 0; i++) {
84 nr += end_pfn - start_pfn;
90 static unsigned long calc_max_low_pfn(
void)
94 unsigned long curr_pfn, last_pfn;
97 for (i = 1;
sp_banks[
i].num_bytes != 0; i++) {
100 if (curr_pfn >= tmp) {
114 unsigned long bootmap_size, start_pfn;
115 unsigned long end_of_phys_memory = 0
UL;
116 unsigned long bootmap_pfn, bytes_avail,
size;
120 for (i = 0;
sp_banks[
i].num_bytes != 0; i++) {
121 end_of_phys_memory =
sp_banks[
i].base_addr +
128 bytes_avail -= slack;
129 end_of_phys_memory -= slack;
136 sp_banks[i+1].base_addr = 0xdeadbeef;
151 bootmap_pfn = start_pfn;
165 #ifdef CONFIG_BLK_DEV_INITRD
174 "(0x%016lx > 0x%016lx)\ndisabling initrd\n",
193 for (i = 0;
sp_banks[
i].num_bytes != 0; i++) {
194 unsigned long curr_pfn, last_pfn;
208 if (last_pfn <= curr_pfn)
211 size = (last_pfn - curr_pfn) << PAGE_SHIFT;
212 *pages_avail += last_pfn - curr_pfn;
217 #ifdef CONFIG_BLK_DEV_INITRD
260 static void __init taint_real_pages(
void)
264 for (i = 0;
sp_banks[
i].num_bytes; i++) {
270 while (start < end) {
277 static void map_high_region(
unsigned long start_pfn,
unsigned long end_pfn)
281 #ifdef CONFIG_DEBUG_HIGHMEM
282 printk(
"mapping high region %08lx - %08lx\n", start_pfn, end_pfn);
285 for (tmp = start_pfn; tmp < end_pfn; tmp++) {
288 ClearPageReserved(page);
289 init_page_count(page);
300 int reservedpages = 0;
304 prom_printf(
"BUG: fixmap and pkmap areas overlap\n");
305 prom_printf(
"pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n",
323 prom_printf(
"mem_init: Cannot alloc valid_addr_bitmap.\n");
335 for (i = 0;
sp_banks[
i].num_bytes != 0; i++) {
347 map_high_region(start_pfn, end_pfn);
365 printk(
KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n",
388 ClearPageReserved(p);
398 #ifdef CONFIG_BLK_DEV_INITRD
403 (end - start) >> 10);
410 ClearPageReserved(p);