summaryrefslogtreecommitdiffstats
path: root/arch/mips/mm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-04 07:40:19 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-04 07:40:19 +0000
commit33263fc5f9ac8e8cb2b22d06af3ce5ac1dd815e4 (patch)
tree2d1b86a40bef0958a68cf1a2eafbeb0667a70543 /arch/mips/mm
parent216f5f51aa02f8b113aa620ebc14a9631a217a00 (diff)
Merge with Linux 2.3.32.
Diffstat (limited to 'arch/mips/mm')
-rw-r--r--arch/mips/mm/fault.c4
-rw-r--r--arch/mips/mm/init.c33
-rw-r--r--arch/mips/mm/umap.c2
3 files changed, 30 insertions, 9 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index a6416c4ca..cfcfc9c8b 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -1,4 +1,4 @@
-/* $Id: fault.c,v 1.13 1999/10/09 00:00:58 ralf Exp $
+/* $Id: fault.c,v 1.14 1999/12/04 03:59:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -21,7 +21,7 @@
#include <linux/version.h>
#include <asm/hardirq.h>
-#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/softirq.h>
#include <asm/system.h>
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index afd1c6b70..8420085e0 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.23 2000/01/27 23:45:25 ralf Exp $
+/* $Id: init.c,v 1.24 2000/01/29 01:41:59 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -33,6 +33,7 @@
#include <asm/jazzdma.h>
#include <asm/system.h>
#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#ifdef CONFIG_SGI_IP22
#include <asm/sgialib.h>
#endif
@@ -249,15 +250,22 @@ extern char __init_begin, __init_end;
void __init paging_init(void)
{
- unsigned int zones_size[2];
+ unsigned int zones_size[MAX_NR_ZONES] = {0, 0, 0};
+ unsigned long max_dma, low;
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2);
- return free_area_init(max_low_pfn);
- zones_size[0] = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
- zones_size[1] = max_low_pfn - zones_size[0];
+ max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
+ low = max_low_pfn;
+
+ if (low < max_dma)
+ zones_size[ZONE_DMA] = low;
+ else {
+ zones_size[ZONE_DMA] = max_dma;
+ zones_size[ZONE_NORMAL] = low - max_dma;
+ }
free_area_init(zones_size);
}
@@ -287,7 +295,7 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_fdata;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
- printk("Memory: %uk/%luk available (%ldk kernel code, %ldk reserved, "
+ printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, "
"%ldk data, %ldk init)\n",
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
ram << (PAGE_SHIFT-10),
@@ -297,6 +305,19 @@ void __init mem_init(void)
initsize >> 10);
}
+#ifdef CONFIG_BLK_DEV_INITRD
+void free_initrd_mem(unsigned long start, unsigned long end)
+{
+ for (; start < end; start += PAGE_SIZE) {
+ ClearPageReserved(mem_map + MAP_NR(start));
+ set_page_count(mem_map+MAP_NR(start), 1);
+ free_page(start);
+ totalram_pages++;
+ }
+ printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
+}
+#endif
+
extern char __init_begin, __init_end;
extern void prom_free_prom_memory(void);
diff --git a/arch/mips/mm/umap.c b/arch/mips/mm/umap.c
index 3ca4424eb..2024e9dce 100644
--- a/arch/mips/mm/umap.c
+++ b/arch/mips/mm/umap.c
@@ -26,7 +26,7 @@
#include <linux/swap.h>
#include <asm/system.h>
-#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#include <asm/page.h>
static inline void