1bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/****************************************************************************
2bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ****************************************************************************
3bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***
4bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   This header was automatically generated from a Linux kernel header
5bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   of the same name, to make information necessary for userspace to
6bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   call into the kernel available to libc.  It contains only constants,
7bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   structures, and macros generated from the original header, and thus,
8bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   contains no copyrightable information.
9bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***
10bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   To edit the content of this header, modify the corresponding
11bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   source file (e.g. under external/kernel-headers/original/) then
12bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   run bionic/libc/kernel/tools/update_all.py
13bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***
14bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   Any manual change here will be lost the next time this script will
15bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***   be run. You've been warned!
16bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ***
17bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ****************************************************************************
18bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham ****************************************************************************/
19bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#ifndef _ASM_PGTABLE_32_H
20bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define _ASM_PGTABLE_32_H
21bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#include <asm/addrspace.h>
22bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#include <asm/page.h>
23bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#include <linux/linkage.h>
25bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#include <asm/cachectl.h>
26bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#include <asm/fixmap.h>
27bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#include <asm-generic/pgtable-nopmd.h>
28bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PGDIR_SHIFT (2 * PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2)
30bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
31bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PGDIR_MASK (~(PGDIR_SIZE-1))
32bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __PGD_ORDER (32 - 3 * PAGE_SHIFT + PGD_T_LOG2 + PTE_T_LOG2)
33bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PGD_ORDER (__PGD_ORDER >= 0 ? __PGD_ORDER : 0)
35bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PUD_ORDER aieeee_attempt_to_allocate_pud
36bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PMD_ORDER 1
37bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PTE_ORDER 0
38bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PTRS_PER_PGD (USER_PTRS_PER_PGD * 2)
40bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
41bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
42bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define FIRST_USER_ADDRESS 0
43bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define VMALLOC_START MAP_BASE
45bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PKMAP_BASE (0xfe000000UL)
46bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
47bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_ERROR(e)   printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
48bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pgd_ERROR(e)   printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
50bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
51bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_page(x) pfn_to_page(pte_pfn(x))
52bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT))
53bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << _PFN_SHIFT) | pgprot_val(prot))
55bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __pgd_offset(address) pgd_index(address)
56bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
57bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
58bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pgd_offset_k(address) pgd_offset(&init_mm, address)
60bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
61bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
62bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __pte_offset(address)   (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
63bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_offset(dir, address)   ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
65bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_offset_kernel(dir, address)   ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
66bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_offset_map(dir, address)   ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
67bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_unmap(pte) ((void)(pte))
68bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __swp_type(x) (((x).val >> 8) & 0x1f)
70bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __swp_offset(x) ((x).val >> 13)
71bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __swp_entry(type,offset)   ((swp_entry_t) { ((type) << 8) | ((offset) << 13) })
72bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define PTE_FILE_MAX_BITS 28
73bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) |   (((_pte).pte >> 2) & 0x8) |   (((_pte).pte >> 8) << 4))
75bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) |   (((off) & 0x8) << 2) |   (((off) >> 4) << 8) |   _PAGE_FILE })
76bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
77bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
78bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79bfeb8a98b64d3f44a684e35b872972c7d88e88b1Raghu Gandham#endif
80