pgtable.h (9ec3f4cb35bc8278f0582fed9f9229c9315c2ffb) pgtable.h (9e953cda5cdf1c230a3c9b7fc4d5e94f15885a9b)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2012 Regents of the University of California
4 */
5
6#ifndef _ASM_RISCV_PGTABLE_H
7#define _ASM_RISCV_PGTABLE_H
8

--- 99 unchanged lines hidden (view full) ---

108 *pmdp = pmd;
109}
110
111static inline void pmd_clear(pmd_t *pmdp)
112{
113 set_pmd(pmdp, __pmd(0));
114}
115
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2012 Regents of the University of California
4 */
5
6#ifndef _ASM_RISCV_PGTABLE_H
7#define _ASM_RISCV_PGTABLE_H
8

--- 99 unchanged lines hidden (view full) ---

108 *pmdp = pmd;
109}
110
111static inline void pmd_clear(pmd_t *pmdp)
112{
113 set_pmd(pmdp, __pmd(0));
114}
115
116
117static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot)
118{
119 return __pgd((pfn << _PAGE_PFN_SHIFT) | pgprot_val(prot));
120}
121
122#define pgd_index(addr) (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
123
124/* Locate an entry in the page global directory */

--- 120 unchanged lines hidden (view full) ---

245 return __pte(pte_val(pte) & ~(_PAGE_ACCESSED));
246}
247
248static inline pte_t pte_mkspecial(pte_t pte)
249{
250 return __pte(pte_val(pte) | _PAGE_SPECIAL);
251}
252
116static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot)
117{
118 return __pgd((pfn << _PAGE_PFN_SHIFT) | pgprot_val(prot));
119}
120
121#define pgd_index(addr) (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
122
123/* Locate an entry in the page global directory */

--- 120 unchanged lines hidden (view full) ---

244 return __pte(pte_val(pte) & ~(_PAGE_ACCESSED));
245}
246
247static inline pte_t pte_mkspecial(pte_t pte)
248{
249 return __pte(pte_val(pte) | _PAGE_SPECIAL);
250}
251
252static inline pte_t pte_mkhuge(pte_t pte)
253{
254 return pte;
255}
256
253/* Modify page protection bits */
254static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
255{
256 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
257}
258
259#define pgd_ERROR(e) \
260 pr_err("%s:%d: bad pgd " PTE_FMT ".\n", __FILE__, __LINE__, pgd_val(e))

--- 143 unchanged lines hidden (view full) ---

404 /* No page table caches to initialize */
405}
406
407#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
408#define VMALLOC_END (PAGE_OFFSET - 1)
409#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
410
411/*
257/* Modify page protection bits */
258static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
259{
260 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
261}
262
263#define pgd_ERROR(e) \
264 pr_err("%s:%d: bad pgd " PTE_FMT ".\n", __FILE__, __LINE__, pgd_val(e))

--- 143 unchanged lines hidden (view full) ---

408 /* No page table caches to initialize */
409}
410
411#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
412#define VMALLOC_END (PAGE_OFFSET - 1)
413#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
414
415/*
412 * Task size is 0x40000000000 for RV64 or 0xb800000 for RV32.
416 * Task size is 0x4000000000 for RV64 or 0xb800000 for RV32.
413 * Note that PGDIR_SIZE must evenly divide TASK_SIZE.
414 */
415#ifdef CONFIG_64BIT
416#define TASK_SIZE (PGDIR_SIZE * PTRS_PER_PGD / 2)
417#else
418#define TASK_SIZE VMALLOC_START
419#endif
420
421#include <asm-generic/pgtable.h>
422
423#endif /* !__ASSEMBLY__ */
424
425#endif /* _ASM_RISCV_PGTABLE_H */
417 * Note that PGDIR_SIZE must evenly divide TASK_SIZE.
418 */
419#ifdef CONFIG_64BIT
420#define TASK_SIZE (PGDIR_SIZE * PTRS_PER_PGD / 2)
421#else
422#define TASK_SIZE VMALLOC_START
423#endif
424
425#include <asm-generic/pgtable.h>
426
427#endif /* !__ASSEMBLY__ */
428
429#endif /* _ASM_RISCV_PGTABLE_H */