patch-2.4.13 linux/arch/s390x/mm/init.c

Next file: linux/arch/sh/Makefile
Previous file: linux/arch/s390x/mm/fault.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/arch/s390x/mm/init.c linux/arch/s390x/mm/init.c
@@ -36,7 +36,7 @@
 #include <asm/dma.h>
 #include <asm/lowcore.h>
 #include <asm/tlb.h>
- 
+
 mmu_gather_t mmu_gathers[NR_CPUS];
 
 static unsigned long totalram_pages;
@@ -44,44 +44,23 @@
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
 char  empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
 
-static int test_access(unsigned long loc)
-{
-	static const int ssm_mask = 0x07000000L;
-	int rc, i;
-
-        rc = 0;
-	for (i=0; i<2; i++) {
-		__asm__ __volatile__(
-                        "    slgr  %0,%0\n"
-			"    ssm   %1\n"
-			"    tprot 0(%2),0\n"
-			"0:  jne   1f\n"
-			"    lghi  %0,1\n"
-			"1:  ssm   %3\n"
-                        ".section __ex_table,\"a\"\n"
-                        "   .align 8\n"
-                        "   .quad  0b,1b\n"
-                        ".previous"
-			: "+&d" (rc) : "i" (0), "a" (loc), "m" (ssm_mask)
-			: "cc");
-		if (rc == 0)
-			break;
-		loc += 0x100000;
-	}
-	return rc;
-}
-
 int do_check_pgt_cache(int low, int high)
 {
         int freed = 0;
         if(pgtable_cache_size > high) {
                 do {
-                        if(pgd_quicklist)
-                                free_pgd_slow(get_pgd_fast()), freed += 4;
-                        if(pmd_quicklist)
-                                pmd_free_slow(pmd_alloc_one_fast(NULL, 0)), freed += 4;
-                        if(pte_quicklist)
-                                pte_free_slow(pte_alloc_one_fast(NULL, 0)), freed++;
+                        if(pgd_quicklist) {
+				free_pgd_slow(get_pgd_fast());
+				freed += 4;
+			}
+                        if(pmd_quicklist) {
+				pmd_free_slow(pmd_alloc_one_fast(NULL, 0));
+				freed += 4;
+			}
+                        if(pte_quicklist) {
+				pte_free_slow(pte_alloc_one_fast(NULL, 0));
+				freed += 4;
+			}
                 } while(pgtable_cache_size > low);
         }
         return freed;
@@ -139,7 +118,7 @@
 	int     i,j,k;
         unsigned long address=0;
         unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) |
-          _REGION_TABLE;
+          _KERN_REGION_TABLE;
 	unsigned long end_mem = (unsigned long) __va(max_low_pfn*PAGE_SIZE);
 	static const int ssm_mask = 0x04000000L;
 
@@ -212,7 +191,6 @@
 void __init mem_init(void)
 {
 	unsigned long codesize, reservedpages, datasize, initsize;
-        unsigned long tmp;
 
         max_mapnr = num_physpages = max_low_pfn;
         high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
@@ -223,25 +201,7 @@
 	/* this will put all low memory onto the freelists */
 	totalram_pages += free_all_bootmem();
 
-        /* mark usable pages in the mem_map[] and count reserved pages */
 	reservedpages = 0;
-	tmp = 0;
-	do {
-		if (tmp && (tmp & 0x1ff) == 0 && 
-                    test_access(tmp * PAGE_SIZE) == 0) {
-                        printk("2M Segment 0x%016lX not available\n",
-                               tmp * PAGE_SIZE);
-			do {
-                                set_bit(PG_reserved, &mem_map[tmp].flags);
-				reservedpages++;
-				tmp++;
-			} while (tmp < max_low_pfn && (tmp & 0x1ff));
-		} else {
-			if (PageReserved(mem_map+tmp))
-				reservedpages++;
-			tmp++;
-		}
-	} while (tmp < max_low_pfn);
 
 	codesize =  (unsigned long) &_etext - (unsigned long) &_text;
 	datasize =  (unsigned long) &_edata - (unsigned long) &_etext;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)