Path: blob/master/arch/um/include/asm/pgtable-2level.h
10820 views
/*1* Copyright (C) 2000, 2001, 2002 Jeff Dike ([email protected])2* Copyright 2003 PathScale, Inc.3* Derived from include/asm-i386/pgtable.h4* Licensed under the GPL5*/67#ifndef __UM_PGTABLE_2LEVEL_H8#define __UM_PGTABLE_2LEVEL_H910#include <asm-generic/pgtable-nopmd.h>1112/* PGDIR_SHIFT determines what a third-level page table entry can map */1314#define PGDIR_SHIFT 2215#define PGDIR_SIZE (1UL << PGDIR_SHIFT)16#define PGDIR_MASK (~(PGDIR_SIZE-1))1718/*19* entries per page directory level: the i386 is two-level, so20* we don't really have any PMD directory physically.21*/22#define PTRS_PER_PTE 102423#define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)24#define PTRS_PER_PGD 102425#define FIRST_USER_ADDRESS 02627#define pte_ERROR(e) \28printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \29pte_val(e))30#define pgd_ERROR(e) \31printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), \32pgd_val(e))3334static inline int pgd_newpage(pgd_t pgd) { return 0; }35static inline void pgd_mkuptodate(pgd_t pgd) { }3637#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))3839#define pte_pfn(x) phys_to_pfn(pte_val(x))40#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot))41#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot))4243/*44* Bits 0 through 4 are taken45*/46#define PTE_FILE_MAX_BITS 274748#define pte_to_pgoff(pte) (pte_val(pte) >> 5)4950#define pgoff_to_pte(off) ((pte_t) { ((off) << 5) + _PAGE_FILE })5152#endif535455