162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
362306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
462306a36Sopenharmony_ci * for more details.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 2003 Ralf Baechle
762306a36Sopenharmony_ci * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci#ifndef _ASM_PGTABLE_32_H
1062306a36Sopenharmony_ci#define _ASM_PGTABLE_32_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <asm/addrspace.h>
1362306a36Sopenharmony_ci#include <asm/page.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include <linux/linkage.h>
1662306a36Sopenharmony_ci#include <asm/cachectl.h>
1762306a36Sopenharmony_ci#include <asm/fixmap.h>
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#include <asm-generic/pgtable-nopmd.h>
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#ifdef CONFIG_HIGHMEM
2262306a36Sopenharmony_ci#include <asm/highmem.h>
2362306a36Sopenharmony_ci#endif
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci/*
2662306a36Sopenharmony_ci * Regarding 32-bit MIPS huge page support (and the tradeoff it entails):
2762306a36Sopenharmony_ci *
2862306a36Sopenharmony_ci *  We use the same huge page sizes as 64-bit MIPS. Assuming a 4KB page size,
2962306a36Sopenharmony_ci * our 2-level table layout would normally have a PGD entry cover a contiguous
3062306a36Sopenharmony_ci * 4MB virtual address region (pointing to a 4KB PTE page of 1,024 32-bit pte_t
3162306a36Sopenharmony_ci * pointers, each pointing to a 4KB physical page). The problem is that 4MB,
3262306a36Sopenharmony_ci * spanning both halves of a TLB EntryLo0,1 pair, requires 2MB hardware page
3362306a36Sopenharmony_ci * support, not one of the standard supported sizes (1MB,4MB,16MB,...).
3462306a36Sopenharmony_ci *  To correct for this, when huge pages are enabled, we halve the number of
3562306a36Sopenharmony_ci * pointers a PTE page holds, making its last half go to waste. Correspondingly,
3662306a36Sopenharmony_ci * we double the number of PGD pages. Overall, page table memory overhead
3762306a36Sopenharmony_ci * increases to match 64-bit MIPS, but PTE lookups remain CPU cache-friendly.
3862306a36Sopenharmony_ci *
3962306a36Sopenharmony_ci * NOTE: We don't yet support huge pages if extended-addressing is enabled
4062306a36Sopenharmony_ci *       (i.e. EVA, XPA, 36-bit Alchemy/Netlogic).
4162306a36Sopenharmony_ci */
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciextern int temp_tlb_entry;
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci/*
4662306a36Sopenharmony_ci * - add_temporary_entry() add a temporary TLB entry. We use TLB entries
4762306a36Sopenharmony_ci *	starting at the top and working down. This is for populating the
4862306a36Sopenharmony_ci *	TLB before trap_init() puts the TLB miss handler in place. It
4962306a36Sopenharmony_ci *	should be used only for entries matching the actual page tables,
5062306a36Sopenharmony_ci *	to prevent inconsistencies.
5162306a36Sopenharmony_ci */
5262306a36Sopenharmony_ciextern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
5362306a36Sopenharmony_ci			       unsigned long entryhi, unsigned long pagemask);
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/*
5662306a36Sopenharmony_ci * Basically we have the same two-level (which is the logical three level
5762306a36Sopenharmony_ci * Linux page table layout folded) page tables as the i386.  Some day
5862306a36Sopenharmony_ci * when we have proper page coloring support we can have a 1% quicker
5962306a36Sopenharmony_ci * tlb refill handling mechanism, but for now it is a bit slower but
6062306a36Sopenharmony_ci * works even with the cache aliasing problem the R4k and above have.
6162306a36Sopenharmony_ci */
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci/* PGDIR_SHIFT determines what a third-level page table entry can map */
6462306a36Sopenharmony_ci#if defined(CONFIG_MIPS_HUGE_TLB_SUPPORT) && !defined(CONFIG_PHYS_ADDR_T_64BIT)
6562306a36Sopenharmony_ci# define PGDIR_SHIFT	(2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
6662306a36Sopenharmony_ci#else
6762306a36Sopenharmony_ci# define PGDIR_SHIFT	(2 * PAGE_SHIFT - PTE_T_LOG2)
6862306a36Sopenharmony_ci#endif
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define PGDIR_SIZE	(1UL << PGDIR_SHIFT)
7162306a36Sopenharmony_ci#define PGDIR_MASK	(~(PGDIR_SIZE-1))
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/*
7462306a36Sopenharmony_ci * Entries per page directory level: we use two-level, so
7562306a36Sopenharmony_ci * we don't really have any PUD/PMD directory physically.
7662306a36Sopenharmony_ci */
7762306a36Sopenharmony_ci#if defined(CONFIG_MIPS_HUGE_TLB_SUPPORT) && !defined(CONFIG_PHYS_ADDR_T_64BIT)
7862306a36Sopenharmony_ci# define __PGD_TABLE_ORDER (32 - 3 * PAGE_SHIFT + PGD_T_LOG2 + PTE_T_LOG2 + 1)
7962306a36Sopenharmony_ci#else
8062306a36Sopenharmony_ci# define __PGD_TABLE_ORDER (32 - 3 * PAGE_SHIFT + PGD_T_LOG2 + PTE_T_LOG2)
8162306a36Sopenharmony_ci#endif
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci#define PGD_TABLE_ORDER	(__PGD_TABLE_ORDER >= 0 ? __PGD_TABLE_ORDER : 0)
8462306a36Sopenharmony_ci#define PUD_TABLE_ORDER	aieeee_attempt_to_allocate_pud
8562306a36Sopenharmony_ci#define PMD_TABLE_ORDER	aieeee_attempt_to_allocate_pmd
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci#define PTRS_PER_PGD	(USER_PTRS_PER_PGD * 2)
8862306a36Sopenharmony_ci#if defined(CONFIG_MIPS_HUGE_TLB_SUPPORT) && !defined(CONFIG_PHYS_ADDR_T_64BIT)
8962306a36Sopenharmony_ci# define PTRS_PER_PTE	(PAGE_SIZE / sizeof(pte_t) / 2)
9062306a36Sopenharmony_ci#else
9162306a36Sopenharmony_ci# define PTRS_PER_PTE	(PAGE_SIZE / sizeof(pte_t))
9262306a36Sopenharmony_ci#endif
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define USER_PTRS_PER_PGD	(0x80000000UL/PGDIR_SIZE)
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define VMALLOC_START	  MAP_BASE
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci#define PKMAP_END	((FIXADDR_START) & ~((LAST_PKMAP << PAGE_SHIFT)-1))
9962306a36Sopenharmony_ci#define PKMAP_BASE	(PKMAP_END - PAGE_SIZE * LAST_PKMAP)
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci#ifdef CONFIG_HIGHMEM
10262306a36Sopenharmony_ci# define VMALLOC_END	(PKMAP_BASE-2*PAGE_SIZE)
10362306a36Sopenharmony_ci#else
10462306a36Sopenharmony_ci# define VMALLOC_END	(FIXADDR_START-2*PAGE_SIZE)
10562306a36Sopenharmony_ci#endif
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci#ifdef CONFIG_PHYS_ADDR_T_64BIT
10862306a36Sopenharmony_ci#define pte_ERROR(e) \
10962306a36Sopenharmony_ci	printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
11062306a36Sopenharmony_ci#else
11162306a36Sopenharmony_ci#define pte_ERROR(e) \
11262306a36Sopenharmony_ci	printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
11362306a36Sopenharmony_ci#endif
11462306a36Sopenharmony_ci#define pgd_ERROR(e) \
11562306a36Sopenharmony_ci	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ciextern void load_pgd(unsigned long pg_dir);
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ciextern pte_t invalid_pte_table[PTRS_PER_PTE];
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci/*
12262306a36Sopenharmony_ci * Empty pgd/pmd entries point to the invalid_pte_table.
12362306a36Sopenharmony_ci */
12462306a36Sopenharmony_cistatic inline int pmd_none(pmd_t pmd)
12562306a36Sopenharmony_ci{
12662306a36Sopenharmony_ci	return pmd_val(pmd) == (unsigned long) invalid_pte_table;
12762306a36Sopenharmony_ci}
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_cistatic inline int pmd_bad(pmd_t pmd)
13062306a36Sopenharmony_ci{
13162306a36Sopenharmony_ci#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
13262306a36Sopenharmony_ci	/* pmd_huge(pmd) but inline */
13362306a36Sopenharmony_ci	if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
13462306a36Sopenharmony_ci		return 0;
13562306a36Sopenharmony_ci#endif
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_ci	if (unlikely(pmd_val(pmd) & ~PAGE_MASK))
13862306a36Sopenharmony_ci		return 1;
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci	return 0;
14162306a36Sopenharmony_ci}
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_cistatic inline int pmd_present(pmd_t pmd)
14462306a36Sopenharmony_ci{
14562306a36Sopenharmony_ci	return pmd_val(pmd) != (unsigned long) invalid_pte_table;
14662306a36Sopenharmony_ci}
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_cistatic inline void pmd_clear(pmd_t *pmdp)
14962306a36Sopenharmony_ci{
15062306a36Sopenharmony_ci	pmd_val(*pmdp) = ((unsigned long) invalid_pte_table);
15162306a36Sopenharmony_ci}
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci#if defined(CONFIG_XPA)
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define MAX_POSSIBLE_PHYSMEM_BITS 40
15662306a36Sopenharmony_ci#define pte_pfn(x)		(((unsigned long)((x).pte_high >> PFN_PTE_SHIFT)) | (unsigned long)((x).pte_low << _PAGE_PRESENT_SHIFT))
15762306a36Sopenharmony_cistatic inline pte_t
15862306a36Sopenharmony_cipfn_pte(unsigned long pfn, pgprot_t prot)
15962306a36Sopenharmony_ci{
16062306a36Sopenharmony_ci	pte_t pte;
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ci	pte.pte_low = (pfn >> _PAGE_PRESENT_SHIFT) |
16362306a36Sopenharmony_ci				(pgprot_val(prot) & ~_PFNX_MASK);
16462306a36Sopenharmony_ci	pte.pte_high = (pfn << PFN_PTE_SHIFT) |
16562306a36Sopenharmony_ci				(pgprot_val(prot) & ~_PFN_MASK);
16662306a36Sopenharmony_ci	return pte;
16762306a36Sopenharmony_ci}
16862306a36Sopenharmony_ci
16962306a36Sopenharmony_ci#elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci#define MAX_POSSIBLE_PHYSMEM_BITS 36
17262306a36Sopenharmony_ci#define pte_pfn(x)		((unsigned long)((x).pte_high >> 6))
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_cistatic inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
17562306a36Sopenharmony_ci{
17662306a36Sopenharmony_ci	pte_t pte;
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci	pte.pte_high = (pfn << 6) | (pgprot_val(prot) & 0x3f);
17962306a36Sopenharmony_ci	pte.pte_low = pgprot_val(prot);
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci	return pte;
18262306a36Sopenharmony_ci}
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci#else
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci#define MAX_POSSIBLE_PHYSMEM_BITS 32
18762306a36Sopenharmony_ci#define pte_pfn(x)		((unsigned long)((x).pte >> PFN_PTE_SHIFT))
18862306a36Sopenharmony_ci#define pfn_pte(pfn, prot)	__pte(((unsigned long long)(pfn) << PFN_PTE_SHIFT) | pgprot_val(prot))
18962306a36Sopenharmony_ci#define pfn_pmd(pfn, prot)	__pmd(((unsigned long long)(pfn) << PFN_PTE_SHIFT) | pgprot_val(prot))
19062306a36Sopenharmony_ci#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_ci#define pte_page(x)		pfn_to_page(pte_pfn(x))
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ci/*
19562306a36Sopenharmony_ci * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that
19662306a36Sopenharmony_ci * are !pte_none() && !pte_present().
19762306a36Sopenharmony_ci */
19862306a36Sopenharmony_ci#if defined(CONFIG_CPU_R3K_TLB)
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci/*
20162306a36Sopenharmony_ci * Format of swap PTEs:
20262306a36Sopenharmony_ci *
20362306a36Sopenharmony_ci *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
20462306a36Sopenharmony_ci *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
20562306a36Sopenharmony_ci *   <----------- offset ------------> < type -> V G E 0 0 0 0 0 0 P
20662306a36Sopenharmony_ci *
20762306a36Sopenharmony_ci *   E is the exclusive marker that is not stored in swap entries.
20862306a36Sopenharmony_ci *   _PAGE_PRESENT (P), _PAGE_VALID (V) and_PAGE_GLOBAL (G) have to remain
20962306a36Sopenharmony_ci *   unused.
21062306a36Sopenharmony_ci */
21162306a36Sopenharmony_ci#define __swp_type(x)			(((x).val >> 10) & 0x1f)
21262306a36Sopenharmony_ci#define __swp_offset(x)			((x).val >> 15)
21362306a36Sopenharmony_ci#define __swp_entry(type, offset)	((swp_entry_t) { (((type) & 0x1f) << 10) | ((offset) << 15) })
21462306a36Sopenharmony_ci#define __pte_to_swp_entry(pte)		((swp_entry_t) { pte_val(pte) })
21562306a36Sopenharmony_ci#define __swp_entry_to_pte(x)		((pte_t) { (x).val })
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ci/* We borrow bit 7 to store the exclusive marker in swap PTEs. */
21862306a36Sopenharmony_ci#define _PAGE_SWP_EXCLUSIVE	(1 << 7)
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci#else
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ci#if defined(CONFIG_XPA)
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci/*
22562306a36Sopenharmony_ci * Format of swap PTEs:
22662306a36Sopenharmony_ci *
22762306a36Sopenharmony_ci *   6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3
22862306a36Sopenharmony_ci *   3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
22962306a36Sopenharmony_ci *   0 0 0 0 0 0 E P <------------------ zeroes ------------------->
23062306a36Sopenharmony_ci *
23162306a36Sopenharmony_ci *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
23262306a36Sopenharmony_ci *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
23362306a36Sopenharmony_ci *   <----------------- offset ------------------> < type -> V G 0 0
23462306a36Sopenharmony_ci *
23562306a36Sopenharmony_ci *   E is the exclusive marker that is not stored in swap entries.
23662306a36Sopenharmony_ci *   _PAGE_PRESENT (P), _PAGE_VALID (V) and_PAGE_GLOBAL (G) have to remain
23762306a36Sopenharmony_ci *   unused.
23862306a36Sopenharmony_ci */
23962306a36Sopenharmony_ci#define __swp_type(x)			(((x).val >> 4) & 0x1f)
24062306a36Sopenharmony_ci#define __swp_offset(x)			 ((x).val >> 9)
24162306a36Sopenharmony_ci#define __swp_entry(type, offset)	((swp_entry_t)  { (((type) & 0x1f) << 4) | ((offset) << 9) })
24262306a36Sopenharmony_ci#define __pte_to_swp_entry(pte)		((swp_entry_t) { (pte).pte_high })
24362306a36Sopenharmony_ci#define __swp_entry_to_pte(x)		((pte_t) { 0, (x).val })
24462306a36Sopenharmony_ci
24562306a36Sopenharmony_ci/*
24662306a36Sopenharmony_ci * We borrow bit 57 (bit 25 in the low PTE) to store the exclusive marker in
24762306a36Sopenharmony_ci * swap PTEs.
24862306a36Sopenharmony_ci */
24962306a36Sopenharmony_ci#define _PAGE_SWP_EXCLUSIVE	(1 << 25)
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci#elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_ci/*
25462306a36Sopenharmony_ci * Format of swap PTEs:
25562306a36Sopenharmony_ci *
25662306a36Sopenharmony_ci *   6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3
25762306a36Sopenharmony_ci *   3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
25862306a36Sopenharmony_ci *   <------------------ zeroes -------------------> E P 0 0 0 0 0 0
25962306a36Sopenharmony_ci *
26062306a36Sopenharmony_ci *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
26162306a36Sopenharmony_ci *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
26262306a36Sopenharmony_ci *   <------------------- offset --------------------> < type -> V G
26362306a36Sopenharmony_ci *
26462306a36Sopenharmony_ci *   E is the exclusive marker that is not stored in swap entries.
26562306a36Sopenharmony_ci *   _PAGE_PRESENT (P), _PAGE_VALID (V) and_PAGE_GLOBAL (G) have to remain
26662306a36Sopenharmony_ci *   unused.
26762306a36Sopenharmony_ci */
26862306a36Sopenharmony_ci#define __swp_type(x)			(((x).val >> 2) & 0x1f)
26962306a36Sopenharmony_ci#define __swp_offset(x)			 ((x).val >> 7)
27062306a36Sopenharmony_ci#define __swp_entry(type, offset)	((swp_entry_t)  { (((type) & 0x1f) << 2) | ((offset) << 7) })
27162306a36Sopenharmony_ci#define __pte_to_swp_entry(pte)		((swp_entry_t) { (pte).pte_high })
27262306a36Sopenharmony_ci#define __swp_entry_to_pte(x)		((pte_t) { 0, (x).val })
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci/*
27562306a36Sopenharmony_ci * We borrow bit 39 (bit 7 in the low PTE) to store the exclusive marker in swap
27662306a36Sopenharmony_ci * PTEs.
27762306a36Sopenharmony_ci */
27862306a36Sopenharmony_ci#define _PAGE_SWP_EXCLUSIVE	(1 << 7)
27962306a36Sopenharmony_ci
28062306a36Sopenharmony_ci#else
28162306a36Sopenharmony_ci/*
28262306a36Sopenharmony_ci * Format of swap PTEs:
28362306a36Sopenharmony_ci *
28462306a36Sopenharmony_ci *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
28562306a36Sopenharmony_ci *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
28662306a36Sopenharmony_ci *   <------------- offset --------------> < type -> 0 0 0 0 0 0 E P
28762306a36Sopenharmony_ci *
28862306a36Sopenharmony_ci *   E is the exclusive marker that is not stored in swap entries.
28962306a36Sopenharmony_ci *   _PAGE_PRESENT (P), _PAGE_VALID (V) and_PAGE_GLOBAL (G) have to remain
29062306a36Sopenharmony_ci *   unused. The location of V and G varies.
29162306a36Sopenharmony_ci */
29262306a36Sopenharmony_ci#define __swp_type(x)			(((x).val >> 8) & 0x1f)
29362306a36Sopenharmony_ci#define __swp_offset(x)			 ((x).val >> 13)
29462306a36Sopenharmony_ci#define __swp_entry(type, offset)	((swp_entry_t)	{ ((type) << 8) | ((offset) << 13) })
29562306a36Sopenharmony_ci#define __pte_to_swp_entry(pte)		((swp_entry_t) { pte_val(pte) })
29662306a36Sopenharmony_ci#define __swp_entry_to_pte(x)		((pte_t) { (x).val })
29762306a36Sopenharmony_ci
29862306a36Sopenharmony_ci/* We borrow bit 1 to store the exclusive marker in swap PTEs. */
29962306a36Sopenharmony_ci#define _PAGE_SWP_EXCLUSIVE	(1 << 1)
30062306a36Sopenharmony_ci
30162306a36Sopenharmony_ci#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_ci#endif /* defined(CONFIG_CPU_R3K_TLB) */
30462306a36Sopenharmony_ci
30562306a36Sopenharmony_ci#endif /* _ASM_PGTABLE_32_H */
306