blob: 77cdefd88d4a043ccdb0e60fa5561d18f01ade1b [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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 ***
Ben Cheng654325d2012-03-07 21:13:49 -080010 *** 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 ***
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef _I386_PGTABLE_2LEVEL_H
20#define _I386_PGTABLE_2LEVEL_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#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))
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024#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)
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#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)
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#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))
Ben Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#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 })
Ben Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#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 })
Ben Cheng654325d2012-03-07 21:13:49 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
50#endif