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 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _I386_PGTABLE_2LEVEL_H 20 #define _I386_PGTABLE_2LEVEL_H 21 #define pte_ERROR(e) printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low) 22 #define pgd_ERROR(e) printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #define set_pte(pteptr, pteval) native_set_pte(pteptr, pteval) 25 #define set_pte_at(mm,addr,ptep,pteval) native_set_pte_at(mm, addr, ptep, pteval) 26 #define set_pmd(pmdptr, pmdval) native_set_pmd(pmdptr, pmdval) 27 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval) 30 #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) 31 #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) 32 #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define pte_page(x) pfn_to_page(pte_pfn(x)) 35 #define pte_none(x) (!(x).pte_low) 36 #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 37 #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 40 #define PTE_FILE_MAX_BITS 29 41 #define pte_to_pgoff(pte) ((((pte).pte_low >> 1) & 0x1f ) + (((pte).pte_low >> 8) << 5 )) 42 #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x1f) << 1) + (((off) >> 5) << 8) + _PAGE_FILE }) 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 #define __swp_type(x) (((x).val >> 1) & 0x1f) 45 #define __swp_offset(x) ((x).val >> 8) 46 #define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) }) 47 #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low }) 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 50 #endif 51