summaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/generic.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-05 06:47:02 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-05 06:47:02 +0000
commit99a7e12f34b3661a0d1354eef83a0eef4df5e34c (patch)
tree3560aca9ca86792f9ab7bd87861ea143a1b3c7a3 /arch/sparc/mm/generic.c
parente73a04659c0b8cdee4dd40e58630e2cf63afb316 (diff)
Merge with Linux 2.3.38.
Diffstat (limited to 'arch/sparc/mm/generic.c')
-rw-r--r--arch/sparc/mm/generic.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c
index 9669f5111..9e599fd9d 100644
--- a/arch/sparc/mm/generic.c
+++ b/arch/sparc/mm/generic.c
@@ -1,4 +1,4 @@
-/* $Id: generic.c,v 1.6 1998/10/27 23:28:00 davem Exp $
+/* $Id: generic.c,v 1.9 1999/12/27 06:30:03 anton Exp $
* generic.c: Generic Sparc mm routines that are not dependent upon
* MMU type but are Sparc specific.
*
@@ -9,46 +9,26 @@
#include <linux/mm.h>
#include <linux/swap.h>
+#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-
-/* Allocate a block of RAM which is aligned to its size.
- * This procedure can be used until the call to mem_init().
- */
-void *sparc_init_alloc(unsigned long *kbrk, unsigned long size)
-{
- unsigned long mask = size - 1;
- unsigned long ret;
-
- if(!size)
- return 0x0;
- if(size & mask) {
- prom_printf("panic: sparc_init_alloc botch\n");
- prom_halt();
- }
- ret = (*kbrk + mask) & ~mask;
- *kbrk = ret + size;
- memset((void*) ret, 0, size);
- return (void*) ret;
-}
-
static inline void forget_pte(pte_t page)
{
if (pte_none(page))
return;
if (pte_present(page)) {
- unsigned long addr = pte_page(page);
- if (MAP_NR(addr) >= max_mapnr || PageReserved(mem_map+MAP_NR(addr)))
+ unsigned long nr = pte_pagenr(page);
+ if (nr >= max_mapnr || PageReserved(mem_map+nr))
return;
/*
* free_page() used to be able to clear swap cache
* entries. We may now have to do it manually.
*/
- free_page_and_swap_cache(addr);
+ free_page_and_swap_cache(mem_map+nr);
return;
}
- swap_free(pte_val(page));
+ swap_free(pte_to_swp_entry(page));
}
/* Remap IO memory, the same way as remap_page_range(), but use