/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) * Copyright 2003 PathScale, Inc. * Derived from include/asm-i386/pgtable.h
*/
#ifndef __UM_PGTABLE_H #define __UM_PGTABLE_H
#include <asm/page.h> #include <linux/mm_types.h>
#define _PAGE_PRESENT 0x001 #define _PAGE_NEEDSYNC 0x002 #define _PAGE_RW 0x020 #define _PAGE_USER 0x040 #define _PAGE_ACCESSED 0x080 #define _PAGE_DIRTY 0x100 /* If _PAGE_PRESENT is clear, we use these: */ #define _PAGE_PROTNONE 0x010 /* if the user mapped it with PROT_NONE;
pte_present gives true */
/* We borrow bit 10 to store the exclusive marker in swap PTEs. */ #define _PAGE_SWP_EXCLUSIVE 0x400
#if CONFIG_PGTABLE_LEVELS == 4 #include <asm/pgtable-4level.h> #elif CONFIG_PGTABLE_LEVELS == 2 #include <asm/pgtable-2level.h> #else #error"Unsupported number of page table levels" #endif
extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
/* zero page used for uninitialized stuff */ externunsignedlong *empty_zero_page;
/* Just any arbitrary offset to the start of the vmalloc VM area: the * current 8MB value just means that there will be a 8MB "hole" after the * physical memory until the kernel virtual memory starts. That means that * any out-of-bounds memory accesses will hopefully be caught. * The vmalloc() routines leaves a hole of 4kB between each vmalloced * area for the same reason. ;)
*/
/* * The i386 can't do page protection for execute, and considers that the same * are read. * Also, write permissions imply read permissions. This is the closest we can * get..
*/
/* * ZERO_PAGE is a global shared page that is always zero: used * for zero-mapped memory areas etc..
*/ #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)
/* * The following only work if pte_present() is true. * Undefined behaviour if not..
*/ staticinlineint pte_read(pte_t pte)
{ return((pte_get_bits(pte, _PAGE_USER)) &&
!(pte_get_bits(pte, _PAGE_PROTNONE)));
}
/* * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD] * * this macro returns the index of the entry in the pmd page which would * control the given virtual address
*/ #define pmd_page_vaddr(pmd) ((unsignedlong) __va(pmd_val(pmd) & PAGE_MASK))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.