From: Jan-Benedict G. <jb...@us...> - 2005-04-25 14:20:57
|
Update of /cvsroot/linux-vax/kernel-2.5/include/asm-vax/mm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21003 Modified Files: pgtable.h Log Message: - remap_page_range() -> remap_pfn_range() Index: pgtable.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/mm/pgtable.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- pgtable.h 20 Apr 2005 19:02:02 -0000 1.13 +++ pgtable.h 25 Apr 2005 14:20:48 -0000 1.14 @@ -1,14 +1,14 @@ /* (c) 2001 Vax Porting Project, atp, kenn, airlied */ /* FIXME: this is a mess its confusing and badly documented - * - needs cleaning up atp jul 2001 */ + * - needs cleaning up atp jul 2001 */ #ifndef _VAX_MM_PGTABLE_H #define _VAX_MM_PGTABLE_H #ifndef __ASSEMBLY__ #include <linux/config.h> #include <linux/types.h> -#include <asm/mm/virtmap.h> +#include <asm/mm/virtmap.h> #endif /* !__ASSEMBLY__ */ #include <asm/mtpr.h> @@ -22,7 +22,7 @@ /* TASK address space sizing, for sizing SPT and so forth */ #include <asm/mm/task.h> -/* +/* * See Documentation/vax/memory.txt * for up to date memory layout */ @@ -33,11 +33,11 @@ /* * How many extra entries in the system page table for I/O space * and vmalloc mappings? The SPT_MAX_xxx macros define the max - * space (in kB) that we'll allocate for each purpose. The + * space (in kB) that we'll allocate for each purpose. The * SPT_ENTRIES_xxx macros are then calculated accordingly. * * The IOMAP limit isn't necessarily a hard limit. Once we run out - * of IOMAP entries in the SPT, we could use get_free_page() to + * of IOMAP entries in the SPT, we could use get_free_page() to * alloc a real page of RAM and hijack its SPTE. */ @@ -47,7 +47,7 @@ #define SPT_HWPTES_IOMAP (SPT_MAX_IOMAP<<1) #define SPT_PTES_IOMAP (SPT_MAX_IOMAP >> 2) /*/>> (PAGE_SHIFT-10)) */ -/* FIXME: (PAGE_SHIFT-10) is hardwired here to 2. asm bug in head.S */ +/* FIXME: (PAGE_SHIFT-10) is hardwired here to 2. asm bug in head.S */ #define SPT_HWPTES_VMALLOC (SPT_MAX_VMALLOC << 1) #define SPT_PTES_VMALLOC (SPT_MAX_VMALLOC >> 2) @@ -59,53 +59,53 @@ /* * Macros to get page table addresses + offsets. - * + * * if they are 4k ptes then set_pte needs to be used on the results, */ /* macro to get linear page table entry for a physical address */ #define GET_HWSPTE_PHYS(x) ((hwpte_t *)(SPT_BASE + ( ((x) >> PAGELET_SHIFT) << SIZEOF_PTR_LOG2) )) -/* this is like it is for a reason - we need to wipe out the lower bits, the old +/* this is like it is for a reason - we need to wipe out the lower bits, the old * calculation using page_shift-sizeof_pte_log2 gave the wrong answer sometimes */ #define GET_SPTE_PHYS(x) ((pte_t *)(SPT_BASE + ( ((x) >> PAGE_SHIFT) << SIZEOF_PTE_LOG2))) -/* macro to get linear page table entry for a virtual address +/* macro to get linear page table entry for a virtual address (only works for addresses in S0 space) */ #define GET_HWSPTE_VIRT(x) GET_HWSPTE_PHYS(((unsigned long)x) - PAGE_OFFSET) #define GET_SPTE_VIRT(x) GET_SPTE_PHYS(((unsigned long)x) - PAGE_OFFSET) /* macro to get the virtual address represented by an SPTE, given the address of the SPTE */ #define SPTE_TO_VIRT(p) (void *)((((unsigned long)p - (unsigned long)swapper_pg_dir[2].br) << (PAGE_SHIFT-SIZEOF_PTE_LOG2)) + PAGE_OFFSET) - + #ifndef __ASSEMBLY__ /* Other architectures put a virtual hole between the end of mapped physical memory and lowest address that vmalloc() will hand out. This isn't really practical on the VAX, since the system page table must be contiguous, so virtual holes in S0 - space waste precious SPTEs. + space waste precious SPTEs. */ /* the previous definition of VMALLOC START relied on the - * VAX phy memory being an exact 4k multiple, + * VAX phy memory being an exact 4k multiple, * my VAX has 7f1f hw-pages so isn't aligned on 4K * workout the VMALLOC_START from the vmallocmap_base and the - * system base register.- + * system base register.- */ -/* VMALLOC_OFFSET is the gap between the end of mapping of physical +/* VMALLOC_OFFSET is the gap between the end of mapping of physical * ram and the start of VMALLOC ?? */ #define VMALLOC_OFFSET (SPT_MAX_IOMAP * 1024) #define VMALLOC_START (PAGE_OFFSET+((vmallocmap_base-swapper_pg_dir[2].br)<<(PAGELET_SHIFT-2))) #define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (VMALLOC_START + (SPT_MAX_VMALLOC * 1024)) -/* Start of task page table area - the variables this is based on +/* Start of task page table area - the variables this is based on * are defined in asm-vax/mm/task.h */ /* address in S0 space of where the process page table area starts and ends.*/ -#define TASKPTE_START PTE_TASK_ALIGN(VMALLOC_END) -#define TASKPTE_END (TASKPTE_START+(PTE_TASK_SLOTSIZE * TASK_MAXUPRC)) +#define TASKPTE_START PTE_TASK_ALIGN(VMALLOC_END) +#define TASKPTE_END (TASKPTE_START+(PTE_TASK_SLOTSIZE * TASK_MAXUPRC)) /* the number of hwptes to map this space */ #define SPT_HWPTES_TASKPTE (((PTE_TASK_SLOTSIZE)>>PAGELET_SHIFT)*TASK_MAXUPRC) #define SPT_PTES_TASKPTE (SPT_HWPTES_TASKPTE >> 3) @@ -115,7 +115,7 @@ /* page table for 0-4MB for everybody */ -/* This is a c reference to the start of the system page table +/* This is a c reference to the start of the system page table * (see arch/vax/boot/head.S). The spt is initialised to cover physical * memory by early boot code, based on VMB supplied information. Further * expansion happens later in the boot sequence in paging_init */ @@ -172,10 +172,10 @@ #endif /*! assembly */ -/* Needs to be defined here and not in linux/mm.h, as it is arch dependent +/* Needs to be defined here and not in linux/mm.h, as it is arch dependent * This is used on sparc processors to implement memory holes */ -#define PageSkip(page) (0) -#define kern_addr_valid(addr) (1) +#define PageSkip(page) 0 +#define kern_addr_valid(addr) 1 /* * No page table caches to initialise or prune @@ -183,6 +183,7 @@ #define pgtable_cache_init() do { } while (0) #define check_pgt_cache() do { } while (0) -#define io_remap_page_range remap_page_range +#define io_remap_page_range(vma, vaddr, paddr, size, prot) \ + remap_pfn_range (vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) #endif |