summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-08 22:17:26 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-08 22:17:26 +0000
commit984760dbf5e48f6224dfe9e26e03536b3d38b6cd (patch)
treea99674322e524c4c90009b3bdae5fab0eebf2094 /arch/mips
parenta7ce7d5e94c98ef5b867f61b2ebecd563f4b6ec9 (diff)
Merge with Linux 2.4.0-test6-pre8.
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/arc/memory.c4
-rw-r--r--arch/mips/dec/prom/memory.c4
-rw-r--r--arch/mips/mm/init.c21
-rw-r--r--arch/mips/mm/umap.c6
4 files changed, 18 insertions, 17 deletions
diff --git a/arch/mips/arc/memory.c b/arch/mips/arc/memory.c
index 49de2ffa9..7988cfc39 100644
--- a/arch/mips/arc/memory.c
+++ b/arch/mips/arc/memory.c
@@ -228,8 +228,8 @@ prom_free_prom_memory (void)
addr = PAGE_OFFSET + p->base;
while (addr < p->base + p->size) {
- ClearPageReserved(mem_map + MAP_NR(addr));
- set_page_count(mem_map + MAP_NR(addr), 1);
+ ClearPageReserved(virt_to_page(addr));
+ set_page_count(virt_to_page(addr), 1);
free_page(addr);
addr += PAGE_SIZE;
freed += PAGE_SIZE;
diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c
index 1025104ce..e54e78a25 100644
--- a/arch/mips/dec/prom/memory.c
+++ b/arch/mips/dec/prom/memory.c
@@ -149,8 +149,8 @@ void prom_free_prom_memory (void)
addr = PAGE_SIZE;
while (addr < end) {
- ClearPageReserved(mem_map + MAP_NR(addr));
- set_page_count(mem_map + MAP_NR(addr), 1);
+ ClearPageReserved(virt_to_page(addr));
+ set_page_count(virt_to_page(addr), 1);
free_page(addr);
addr += PAGE_SIZE;
}
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index b1fde5108..a6f448e05 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -120,7 +120,8 @@ unsigned long empty_zero_page, zero_page_mask;
static inline unsigned long setup_zero_pages(void)
{
- unsigned long order, size, pg;
+ unsigned long order, size;
+ struct page *page;
switch (mips_cputype) {
case CPU_R4000SC:
@@ -137,11 +138,11 @@ static inline unsigned long setup_zero_pages(void)
if (!empty_zero_page)
panic("Oh boy, that early out of memory?");
- pg = MAP_NR(empty_zero_page);
- while (pg < MAP_NR(empty_zero_page) + (1 << order)) {
- set_bit(PG_reserved, &mem_map[pg].flags);
- set_page_count(mem_map + pg, 0);
- pg++;
+ page = virt_to_page(empty_zero_page);
+ while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) {
+ set_bit(PG_reserved, &page->flags);
+ set_page_count(page, 0);
+ page++;
}
size = PAGE_SIZE << order;
@@ -309,8 +310,8 @@ void __init mem_init(void)
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);
+ ClearPageReserved(virt_to_page(start));
+ set_page_count(virt_to_page(start), 1);
free_page(start);
totalram_pages++;
}
@@ -329,8 +330,8 @@ void free_initmem(void)
addr = (unsigned long) &__init_begin;
while (addr < (unsigned long) &__init_end) {
- ClearPageReserved(mem_map + MAP_NR(addr));
- set_page_count(mem_map + MAP_NR(addr), 1);
+ ClearPageReserved(virt_to_page(addr));
+ set_page_count(virt_to_page(addr), 1);
free_page(addr);
totalram_pages++;
addr += PAGE_SIZE;
diff --git a/arch/mips/mm/umap.c b/arch/mips/mm/umap.c
index 003866ac4..465bec37b 100644
--- a/arch/mips/mm/umap.c
+++ b/arch/mips/mm/umap.c
@@ -115,10 +115,10 @@ void *vmalloc_uncached (unsigned long size)
static inline void free_pte(pte_t page)
{
if (pte_present(page)) {
- unsigned long nr = pte_pagenr(page);
- if (nr >= max_mapnr || PageReserved(mem_map+nr))
+ struct page *ptpage = pte_page(page);
+ if ((!VALID_PAGE(ptpage)) || PageReserved(ptpage))
return;
- __free_page(pte_page(page));
+ __free_page(ptpage);
if (current->mm->rss <= 0)
return;
current->mm->rss--;