From: Jan-Benedict G. <jb...@us...> - 2005-04-25 15:59:34
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/mm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10486 Modified Files: pgalloc.c pgtable.c Log Message: - More polishing. Index: pgtable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/mm/pgtable.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- pgtable.c 30 May 2004 20:46:56 -0000 1.5 +++ pgtable.c 25 Apr 2005 15:59:24 -0000 1.6 @@ -1,7 +1,7 @@ -/* +/* * $Id$ * - * handle bits of VAX memory management + * handle bits of VAX memory management * atp 2000 */ Index: pgalloc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/mm/pgalloc.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pgalloc.c 30 May 2004 21:09:21 -0000 1.7 +++ pgalloc.c 25 Apr 2005 15:59:24 -0000 1.8 @@ -1,15 +1,16 @@ -/* $Id$ - * - * pgalloc.c Routines from include/asm-vax/mm/pgalloc.h - * Allocation of page table entries and so forth. - * +/* + * $Id$ + * + * pgalloc.c Routines from include/asm-vax/mm/pgalloc.h + * Allocation of page table entries and so forth. + * * This is the main part of the VAX specific memory layer. - * + * * Copyright atp Jun 2001 - complete rewrite. - * atp aug 2001 - add in stuff for vmalloc to work (pmd_alloc_kernel) - * fix mistake in pte_alloc_kernel. - * atp 21 aug 01 - make TASK_WSMAX what was intended, add in segv stuff. - * + * atp aug 2001 - add in stuff for vmalloc to work (pmd_alloc_kernel) + * fix mistake in pte_alloc_kernel. + * atp 21 aug 01 - make TASK_WSMAX what was intended, add in segv stuff. + * * License: GNU GPL */ @@ -20,7 +21,7 @@ #include <asm/pgalloc.h> #include <asm/mmu_context.h> -extern void vaxpanic(char *reason); +extern void vaxpanic(char *reason); #undef VAX_MM_PGALLOC_DEBUG @@ -45,7 +46,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) { /* - * This is rather wasteful, as only a few longwords are + * This is rather wasteful, as only a few longwords are * used in the entire 4kb page. Perhaps we can do something * smarter here by using the quicklists to pack the pgds into * a single page. @@ -55,7 +56,7 @@ /* Grab a pgd off the cache */ pgd = get_pgd_fast(); - + if (!pgd) { /* Check if we have run out of balance slots */ if (pgd_free_list.slots_used >= TASK_MAXUPRC) @@ -63,7 +64,7 @@ pgd = kmalloc(sizeof(pgd_t) * PTRS_PER_PGD, GFP_KERNEL); if (!pgd) - return NULL; + return NULL; memset(pgd, 0, sizeof(pgd_t) * PTRS_PER_PGD); @@ -73,10 +74,9 @@ pgd[0].pmd = 0; /* These are blank */ pgd[1].pmd = 0; - } else { /* pgd_clear keeps this */ - taskslot=pgd->slot; + taskslot = pgd->slot; } if (pgd) { @@ -84,7 +84,7 @@ /* Set the values of the base + length registers */ pgd[0].br = taskslot + P0PTE_OFFSET; /* skip the PMD */ pgd[0].lr = 0x0; - /* this comes in handy later */ + /* This comes in handy later */ pgd[0].slot = taskslot; /* p1br points at what would be page mapping 0x40000000 (i.e. the _end_ of the slot)*/ pgd[1].br = taskslot+ (P1PTE_OFFSET) - 0x800000 ; @@ -95,10 +95,10 @@ pgd[0].segment = 0; pgd[1].segment = 1; -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM:pgd_alloc: p0: %8lX, %8lX, p1: %8lX, %8lx, slot %ld, taskslot %8lx\n", pgd[0].br, pgd[0].lr, pgd[1].br, pgd[1].lr, pgd_free_list.slots_used-1, pgd[0].slot); #endif - /* set the s0 region, from the master copy in swapper_pg_dir */ + /* Set the s0 region, from the master copy in swapper_pg_dir */ memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); } @@ -108,11 +108,11 @@ void pgd_clear(pgd_t * pgdp) { /* Wipe a pgd structure carefully -- this is probably overkill */ - pgdp->pmd=0; + pgdp->pmd = 0; if (pgdp->segment) { /* p1br points at what would be page mapping 0x40000000 */ - pgdp->br = pgdp->slot+ (P1PTE_OFFSET) - 0x800000 ; + pgdp->br = pgdp->slot+ (P1PTE_OFFSET) - 0x800000; /* This is the unmapped number of PTEs */ pgdp->lr = 0x40000; } else { @@ -121,7 +121,6 @@ } } - /* * Remap a given page to be part of a contiguous page table for p0/1 space. * @@ -155,7 +154,7 @@ /* Locate the S0 pte that describes the page pointed to by s0addr */ s0pte = GET_SPTE_VIRT(s0addr); -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG /* Is it already pointing somewhere? */ if (pte_present(*s0pte)) printk(KERN_DEBUG "VAXMM: S0 pte %8p already valid in " @@ -164,9 +163,9 @@ #endif /* zap the map */ set_pte(s0pte,mk_pte(page, __pgprot(_PAGE_VALID|_PAGE_KW))); - + flush_tlb_all(); -} +} /* * Invalidate the S0 pte that was remapped to point at this page in the @@ -184,7 +183,7 @@ /* Locate the S0 pte that describes the page pointed to by pte_page */ s0pte = GET_SPTE_VIRT(page); -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "unmap_pgtable_page: s0addr %p, s0pte %p\n", page, s0pte); #endif @@ -218,7 +217,7 @@ * Updated atp Mar 2002. pgd_populate, remove PGD_SPECIAL botch. */ unsigned int is_p1 = pgd->segment; - pmd_t *s0addr; + pmd_t *s0addr; #ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM: Calling pgd_populate with (mm=%8p, pgd=%8p, " @@ -251,14 +250,15 @@ clear_page(pmd); remap_pgtable_page(s0addr, virt_to_page(pmd)); -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM: pmd_alloc: pgd %8p, pgd->br %8lx, pgd->lr " - "%8lx, \n\tpgd->pmd %8p\n",pgd,pgd->br, pgd->lr, pgd->pmd); -#endif + "%8lx, \n\tpgd->pmd %8p\n", + pgd,pgd->br, pgd->lr, pgd->pmd); +#endif return; } -/* +/* * pmd_populate is called when the MM core wants to make a page in * a process page table valid. The core has already allocated a * page for this, and it now wants for us to use this page to @@ -273,9 +273,9 @@ * We used to check against WSMAX and STKMAX here, but we now do this * check in pte_alloc_one(), where it's easier to check (since pte_alloc_one() * is handed the user address). - * + * * We make use of the knowledge that the pmd is a single block, to work back - * to the pgd, which is where the base and length register values are held. + * to the pgd, which is where the base and length register values are held. * * FIXMES: page table locking. */ @@ -291,7 +291,7 @@ pgd_t *pgd_entry; /* Find the start of the page middle directory containing this PMD entry */ - pmd_base = (pmd_t *)((unsigned long)pmd & PTE_TASK_MASK); /* base of the pmd */ + pmd_base = (pmd_t *) ((unsigned long)pmd & PTE_TASK_MASK); /* base of the pmd */ /* The process page table page that we want to remap is at offset pmd_index into the relevant page middle directory */ @@ -313,12 +313,12 @@ page in the process page table */ pte_addr = (pte_t *)(pgd_entry->br + (pmd_index << PAGE_SHIFT)); -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM: pmd_populate: mm %p br %08lx lr %04lx " "pmd %p page %p pte_addr %p reg %d index %04lx\n", mm, pgd_entry->br, pgd_entry->lr, pmd, pte_page, pte_addr, pspace, pmd_index); -#endif +#endif /* Double-map the newly-allocated page to this S0 address */ remap_pgtable_page(pte_addr, pte_page); @@ -351,9 +351,9 @@ pgd_entry->lr = page_index; } -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM: pmd_populate: new lr %04lx\n", pgd_entry->lr); -#endif +#endif /* * If all this work is for the current process, then we need to @@ -361,18 +361,18 @@ */ if (pspace == 0) { if (current->thread.pcb.p0br == pgd_entry->br) { -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM: pmd_populate: updating hardware regs\n"); -#endif +#endif current->thread.pcb.p0lr = pgd_entry->lr * 8; set_vaxmm_regs_p0(pgd_entry); } } else { if (current->thread.pcb.p1br == pgd_entry->br) { -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM: pmd_populate: updating hardware regs\n"); -#endif +#endif current->thread.pcb.p1lr = pgd_entry->lr * 8; set_vaxmm_regs_p1(pgd_entry); } @@ -397,7 +397,7 @@ { pte_t *pte; pte = pmd->pte_page + ((address>>PAGE_SHIFT) & (PTRS_PER_PTE-1)); -#ifdef VAX_MM_PGALLOC_DEBUG +#ifdef VAX_MM_PGALLOC_DEBUG printk(KERN_DEBUG "VAXMM:pte_offset: pmd %p, address %8lx, " "pte_pte %p\n", pmd, address, pte); #endif |