[parisc-linux-cvs] linux-2.5 tausq

Randolph Chung Randolph Chung <randolph@tausq.org>
Mon, 22 Jul 2002 00:28:07 -0700


the tree almost compiles now.... kbd_* stuff needs some work still

i tried to fill in some of the missing vm functions, but someone
should probably cross check these... 

> include/asm-parisc/cacheflush.h
> some new cache flushing primitives (check me!)

> include/asm-parisc/pgtable.h include/asm-parisc/tlbflush.h
> define some new primitives (check me!)

diff -u -p -r1.1 cacheflush.h
--- include/asm-parisc/cacheflush.h	20 Jul 2002 21:40:12 -0000	1.1
+++ include/asm-parisc/cacheflush.h	22 Jul 2002 07:14:15 -0000
@@ -86,5 +86,9 @@ static inline void flush_dcache_page(str
 #define flush_icache_user_range(vma, page, addr, len) \
 	flush_icache_page((vma), (page))
 
+#define flush_cache_range(vma,s,e) do { flush_kernel_dcache_range(s,e); flush_icache_range(s,e); } while (0)
+
+#define flush_cache_page(vma,addr) do { flush_kernel_dcache_page(addr); flush_kernel_icache_page(addr); } while (0)
+
 #endif
 
--- include/asm-parisc/page.h	21 Jul 2002 13:51:57 -0000	1.6
+++ include/asm-parisc/page.h	22 Jul 2002 07:14:15 -0000
@@ -116,6 +116,7 @@ extern int npmem_ranges;
 #define pfn_to_page(pfn)	(mem_map + (pfn))
 #define page_to_pfn(page)	((unsigned long)((page) - mem_map))
 #define pfn_valid(pfn)		((pfn) < max_mapnr)
+#define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
 
 #ifndef CONFIG_DISCONTIGMEM
 #define virt_to_page(kaddr)     (mem_map + (__pa(kaddr) >> PAGE_SHIFT))

--- include/asm-parisc/pgtable.h	21 Jul 2002 14:15:14 -0000	1.5
+++ include/asm-parisc/pgtable.h	22 Jul 2002 07:14:15 -0000
@@ -299,12 +299,15 @@ extern inline pte_t pte_modify(pte_t pte
 
 /* Permanent address of a page.  On parisc we don't have highmem. */
 
+#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
+
 #ifdef CONFIG_DISCONTIGMEM
 #define pte_page(x) (phys_to_page(pte_val(x)))
 #else
 #define pte_page(x) (mem_map+(pte_val(x) >> PAGE_SHIFT))
 #endif
 
+#define pmd_page_kernel(pmd)	((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
 
 #define __pmd_page(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
 #define pmd_page(pmd)	virt_to_page((void *)__pmd_page(pmd))
@@ -328,8 +331,16 @@ extern inline pte_t pte_modify(pte_t pte
 #endif
 
 /* Find an entry in the third-level page table.. */ 
-#define pte_offset_map(pmd, address) \
-((pte_t *) pmd_page(*(pmd)) + (((address)>>PAGE_SHIFT) & (PTRS_PER_PTE-1)))
+#define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
+#define pte_offset_kernel(pmd, address) \
+	((pte_t *) pmd_page_kernel(*(pmd)) + __pte_offset(address))
+#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
+#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#define pte_unmap(pte)			do { } while (0)
+#define pte_unmap_nested(pte)		do { } while (0)
 
 extern void paging_init (void);
 
--- include/asm-parisc/tlbflush.h	21 Jul 2002 16:07:28 -0000	1.2
+++ include/asm-parisc/tlbflush.h	22 Jul 2002 07:14:15 -0000
@@ -81,4 +81,6 @@ static inline void flush_tlb_range(struc
 	}
 }
 
+#define flush_tlb_kernel_range(start, end) flush_tlb_range(&init_mm, start, end)
+
 #endif


--  
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/