^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Port on Texas Instruments TMS320C6x architecture
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef _ASM_C6X_PGTABLE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _ASM_C6X_PGTABLE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <asm-generic/pgtable-nopud.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <asm/setup.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * All 32bit addresses are effectively valid for vmalloc...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * Sort of meaningless for non-VM targets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define VMALLOC_START 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define VMALLOC_END 0xffffffff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define pgd_present(pgd) (1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define pgd_none(pgd) (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define pgd_bad(pgd) (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define pgd_clear(pgdp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define kern_addr_valid(addr) (1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define pmd_none(x) (!pmd_val(x))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define pmd_present(x) (pmd_val(x))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define pmd_bad(x) (pmd_val(x) & ~PAGE_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define pgprot_noncached(prot) (prot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern void paging_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define __swp_type(x) (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define __swp_offset(x) (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define __swp_entry(typ, off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * ZERO_PAGE is a global shared page that is always zero: used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * for zero-mapped memory areas etc..
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) extern unsigned long empty_zero_page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define swapper_pg_dir ((pgd_t *) 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * c6x is !MMU, so define the simpliest implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define pgprot_writecombine pgprot_noncached
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #endif /* _ASM_C6X_PGTABLE_H */