• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef _I386_PGTABLE_2LEVEL_H
13 #define _I386_PGTABLE_2LEVEL_H
14 
15 #define pte_ERROR(e)   printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low)
16 #define pgd_ERROR(e)   printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
17 
18 #define set_pte(pteptr, pteval) native_set_pte(pteptr, pteval)
19 #define set_pte_at(mm,addr,ptep,pteval) native_set_pte_at(mm, addr, ptep, pteval)
20 #define set_pmd(pmdptr, pmdval) native_set_pmd(pmdptr, pmdval)
21 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
22 #define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval)
23 #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
24 #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
25 #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
26 #define pte_page(x) pfn_to_page(pte_pfn(x))
27 #define pte_none(x) (!(x).pte_low)
28 #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
29 #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
30 #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
31 #define PTE_FILE_MAX_BITS 29
32 #define pte_to_pgoff(pte)   ((((pte).pte_low >> 1) & 0x1f ) + (((pte).pte_low >> 8) << 5 ))
33 #define pgoff_to_pte(off)   ((pte_t) { (((off) & 0x1f) << 1) + (((off) >> 5) << 8) + _PAGE_FILE })
34 #define __swp_type(x) (((x).val >> 1) & 0x1f)
35 #define __swp_offset(x) ((x).val >> 8)
36 #define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
37 #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low })
38 #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
39 #endif
40