pgtable.h (ca5999fde0a1761665a38e4c9a72dbcd7d190a81) | pgtable.h (974b9b2c68f3d35a65e80af9657fe378d2439b60) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ALPHA_PGTABLE_H 3#define _ALPHA_PGTABLE_H 4 5#include <asm-generic/pgtable-nopud.h> 6 7/* 8 * This file contains the functions and defines necessary to modify and use --- 262 unchanged lines hidden (view full) --- 271 272extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; } 273extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; } 274extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); return pte; } 275extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_FOW; return pte; } 276extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; } 277extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; } 278 | 1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ALPHA_PGTABLE_H 3#define _ALPHA_PGTABLE_H 4 5#include <asm-generic/pgtable-nopud.h> 6 7/* 8 * This file contains the functions and defines necessary to modify and use --- 262 unchanged lines hidden (view full) --- 271 272extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; } 273extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; } 274extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); return pte; } 275extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_FOW; return pte; } 276extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; } 277extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; } 278 |
279#define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address)) 280 281/* to find an entry in a kernel page-table-directory */ 282#define pgd_offset_k(address) pgd_offset(&init_mm, (address)) 283 284/* to find an entry in a page-table-directory. */ 285#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 286#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) 287 | |
288/* 289 * The smp_read_barrier_depends() in the following functions are required to 290 * order the load of *dir (the pointer in the top level page table) with any 291 * subsequent load of the returned pmd_t *ret (ret is data dependent on *dir). 292 * 293 * If this ordering is not enforced, the CPU might load an older value of 294 * *ret, which may be uninitialized data. See mm/memory.c:__pte_alloc for 295 * more details. --- 4 unchanged lines hidden (view full) --- 300 301/* Find an entry in the second-level page table.. */ 302extern inline pmd_t * pmd_offset(pud_t * dir, unsigned long address) 303{ 304 pmd_t *ret = (pmd_t *) pud_page_vaddr(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PAGE - 1)); 305 smp_read_barrier_depends(); /* see above */ 306 return ret; 307} | 279/* 280 * The smp_read_barrier_depends() in the following functions are required to 281 * order the load of *dir (the pointer in the top level page table) with any 282 * subsequent load of the returned pmd_t *ret (ret is data dependent on *dir). 283 * 284 * If this ordering is not enforced, the CPU might load an older value of 285 * *ret, which may be uninitialized data. See mm/memory.c:__pte_alloc for 286 * more details. --- 4 unchanged lines hidden (view full) --- 291 292/* Find an entry in the second-level page table.. */ 293extern inline pmd_t * pmd_offset(pud_t * dir, unsigned long address) 294{ 295 pmd_t *ret = (pmd_t *) pud_page_vaddr(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PAGE - 1)); 296 smp_read_barrier_depends(); /* see above */ 297 return ret; 298} |
299#define pmd_offset pmd_offset |
|
308 309/* Find an entry in the third-level page table.. */ 310extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address) 311{ 312 pte_t *ret = (pte_t *) pmd_page_vaddr(*dir) 313 + ((address >> PAGE_SHIFT) & (PTRS_PER_PAGE - 1)); 314 smp_read_barrier_depends(); /* see above */ 315 return ret; 316} | 300 301/* Find an entry in the third-level page table.. */ 302extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address) 303{ 304 pte_t *ret = (pte_t *) pmd_page_vaddr(*dir) 305 + ((address >> PAGE_SHIFT) & (PTRS_PER_PAGE - 1)); 306 smp_read_barrier_depends(); /* see above */ 307 return ret; 308} |
309#define pte_offset_kernel pte_offset_kernel |
|
317 | 310 |
318#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr)) 319#define pte_unmap(pte) do { } while (0) 320 | |
321extern pgd_t swapper_pg_dir[1024]; 322 323/* 324 * The Alpha doesn't have any external MMU info: the kernel page 325 * tables contain all the necessary information. 326 */ 327extern inline void update_mmu_cache(struct vm_area_struct * vma, 328 unsigned long address, pte_t *ptep) --- 33 unchanged lines hidden --- | 311extern pgd_t swapper_pg_dir[1024]; 312 313/* 314 * The Alpha doesn't have any external MMU info: the kernel page 315 * tables contain all the necessary information. 316 */ 317extern inline void update_mmu_cache(struct vm_area_struct * vma, 318 unsigned long address, pte_t *ptep) --- 33 unchanged lines hidden --- |