vserver 2.0 rc7
[linux-2.6.git] / include / asm-arm / pgtable.h
index 10d747b..a9892eb 100644 (file)
 #include <asm/proc-fns.h>
 #include <asm/arch/vmalloc.h>
 
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts.  That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ *
+ * Note that platforms may override VMALLOC_START, but they must provide
+ * VMALLOC_END.  VMALLOC_END defines the (exclusive) limit of this space,
+ * which may not overlap IO space.
+ */
+#ifndef VMALLOC_START
+#define VMALLOC_OFFSET         (8*1024*1024)
+#define VMALLOC_START          (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#endif
+
 /*
  * Hardware-wise, we have a two level page table structure, where the first
  * level has 4096 entries, and the second level has 256 entries.  Each entry
@@ -102,9 +119,23 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
 #define PGDIR_SIZE             (1UL << PGDIR_SHIFT)
 #define PGDIR_MASK             (~(PGDIR_SIZE-1))
 
+/*
+ * This is the lowest virtual address we can permit any user space
+ * mapping to be mapped at.  This is particularly important for
+ * non-high vector CPUs.
+ */
+#define FIRST_USER_ADDRESS     PAGE_SIZE
+
 #define FIRST_USER_PGD_NR      1
 #define USER_PTRS_PER_PGD      ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR)
 
+/*
+ * ARMv6 supersection address mask and size definitions.
+ */
+#define SUPERSECTION_SHIFT     24
+#define SUPERSECTION_SIZE      (1UL << SUPERSECTION_SHIFT)
+#define SUPERSECTION_MASK      (~(SUPERSECTION_SIZE-1))
+
 /*
  * Hardware page table definitions.
  *
@@ -129,6 +160,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
 #define PMD_SECT_APX           (1 << 15)       /* v6 */
 #define PMD_SECT_S             (1 << 16)       /* v6 */
 #define PMD_SECT_nG            (1 << 17)       /* v6 */
+#define PMD_SECT_SUPER         (1 << 18)       /* v6 */
 
 #define PMD_SECT_UNCACHED      (0)
 #define PMD_SECT_BUFFERED      (PMD_SECT_BUFFERABLE)
@@ -254,7 +286,7 @@ extern struct page *empty_zero_page;
 #define pfn_pte(pfn,prot)      (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
 
 #define pte_none(pte)          (!pte_val(pte))
-#define pte_clear(ptep)                set_pte((ptep), __pte(0))
+#define pte_clear(mm,addr,ptep)        set_pte_at((mm),(addr),(ptep), __pte(0))
 #define pte_page(pte)          (pfn_to_page(pte_pfn(pte)))
 #define pte_offset_kernel(dir,addr)    (pmd_page_kernel(*(dir)) + __pte_index(addr))
 #define pte_offset_map(dir,addr)       (pmd_page_kernel(*(dir)) + __pte_index(addr))
@@ -263,6 +295,7 @@ extern struct page *empty_zero_page;
 #define pte_unmap_nested(pte)  do { } while (0)
 
 #define set_pte(ptep, pte)     cpu_set_pte(ptep,pte)
+#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
 
 /*
  * The following only work if pte_present() is true.
@@ -308,12 +341,6 @@ PTE_BIT_FUNC(mkyoung,   |= L_PTE_YOUNG);
 #define pmd_present(pmd)       (pmd_val(pmd))
 #define pmd_bad(pmd)           (pmd_val(pmd) & 2)
 
-#define set_pmd(pmdp,pmd)              \
-       do {                            \
-               *(pmdp) = pmd;          \
-               flush_pmd_entry(pmdp);  \
-       } while (0)
-
 #define copy_pmd(pmdpd,pmdps)          \
        do {                            \
                pmdpd[0] = pmdps[0];    \
@@ -416,6 +443,13 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 #define io_remap_page_range(vma,from,phys,size,prot) \
                remap_pfn_range(vma, from, (phys) >> PAGE_SHIFT, size, prot)
 
+#define io_remap_pfn_range(vma,from,pfn,size,prot) \
+               remap_pfn_range(vma, from, pfn, size, prot)
+
+#define MK_IOSPACE_PFN(space, pfn)     (pfn)
+#define GET_IOSPACE(pfn)               0
+#define GET_PFN(pfn)                   (pfn)
+
 #define pgtable_cache_init() do { } while (0)
 
 #endif /* !__ASSEMBLY__ */