]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/asm-powerpc/pgtable-64k.h
[POWERPC] Remove arch/powerpc's dependence on asm-ppc/pg{alloc,table}.h
[karo-tx-linux.git] / include / asm-powerpc / pgtable-64k.h
index 4b7126c53f37b4cbc7a4c07f19fc38c9bf5805d2..16ef4978520dd276b15d2775bc89ef54261c3178 100644 (file)
@@ -1,6 +1,5 @@
 #ifndef _ASM_POWERPC_PGTABLE_64K_H
 #define _ASM_POWERPC_PGTABLE_64K_H
-#ifdef __KERNEL__
 
 #include <asm-generic/pgtable-nopud.h>
 
@@ -35,6 +34,7 @@
 #define _PAGE_HPTE_SUB 0x0ffff000 /* combo only: sub pages HPTE bits */
 #define _PAGE_HPTE_SUB0        0x08000000 /* combo only: first sub page */
 #define _PAGE_COMBO    0x10000000 /* this is a combo 4k page */
+#define _PAGE_4K_PFN   0x20000000 /* PFN is for a single 4k page */
 #define _PAGE_F_SECOND  0x00008000 /* full page: hidx bits */
 #define _PAGE_F_GIX     0x00007000 /* full page: hidx bits */
 
@@ -64,8 +64,6 @@
 /* Bits to mask out from a PGD/PUD to get to the PMD page */
 #define PUD_MASKED_BITS                0x1ff
 
-#ifndef __ASSEMBLY__
-
 /* Manipulate "rpte" values */
 #define __real_pte(e,p)        ((real_pte_t) { \
        (e), pte_val(*((p) + PTRS_PER_PTE)) })
@@ -93,6 +91,8 @@
 #define pte_pagesize_index(pte)        \
        (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K)
 
-#endif /*  __ASSEMBLY__ */
-#endif /* __KERNEL__ */
+#define remap_4k_pfn(vma, addr, pfn, prot)                             \
+       remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE,                \
+                       __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN))
+
 #endif /* _ASM_POWERPC_PGTABLE_64K_H */