2 * arch/ubicom32/include/asm/pgtable.h
3 * Ubicom32 pseudo page table definitions and operations.
5 * (C) Copyright 2009, Ubicom, Inc.
6 * Copyright (C) 2004 Microtronix Datacom Ltd
8 * This file is part of the Ubicom32 Linux Kernel Port.
10 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
11 * it and/or modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation, either version 2 of the
13 * License, or (at your option) any later version.
15 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
16 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
17 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 * the GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with the Ubicom32 Linux Kernel Port. If not,
22 * see <http://www.gnu.org/licenses/>.
24 * Ubicom32 implementation derived from (with many thanks):
28 * and various works, Alpha, ix86, M68K, Sparc, ...et al
30 #ifndef _ASM_UBICOM32_PGTABLE_H
31 #define _ASM_UBICOM32_PGTABLE_H
33 #include <asm-generic/4level-fixup.h>
35 //vic - this bit copied from m68knommu version
36 #include <asm/setup.h>
38 #include <linux/sched.h>
40 typedef pte_t *pte_addr_t;
42 #define pgd_present(pgd) (1) /* pages are always present on NO_MM */
43 #define pgd_none(pgd) (0)
44 #define pgd_bad(pgd) (0)
45 #define pgd_clear(pgdp)
46 #define kern_addr_valid(addr) (1)
47 #define pmd_offset(a, b) ((void *)0)
49 #define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */
50 #define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */
51 #define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */
52 #define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */
53 #define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */
54 //vic - this bit copied from m68knommu version
56 extern void paging_init(void);
57 #define swapper_pg_dir ((pgd_t *) 0)
59 #define __swp_type(x) (0)
60 #define __swp_offset(x) (0)
61 #define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
62 #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
63 #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
66 * pgprot_noncached() is only for infiniband pci support, and a real
67 * implementation for RAM would be more complicated.
69 #define pgprot_noncached(prot) (prot)
71 static inline int pte_file(pte_t pte) { return 0; }
74 * ZERO_PAGE is a global shared page that is always zero: used
75 * for zero-mapped memory areas etc..
77 #define ZERO_PAGE(vaddr) (virt_to_page(0))
79 extern unsigned int kobjsize(const void *objp);
80 extern int is_in_rom(unsigned long);
83 * No page table caches to initialise
85 #define pgtable_cache_init() do { } while (0)
87 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
88 remap_pfn_range(vma, vaddr, pfn, size, prot)
90 extern inline void flush_cache_mm(struct mm_struct *mm)
94 extern inline void flush_cache_range(struct mm_struct *mm,
100 /* Push the page at kernel virtual address and clear the icache */
101 extern inline void flush_page_to_ram (unsigned long address)
105 /* Push n pages at kernel virtual address and clear the icache */
106 extern inline void flush_pages_to_ram (unsigned long address, int n)
111 * All 32bit addresses are effectively valid for vmalloc...
112 * Sort of meaningless for non-VM targets.
114 #define VMALLOC_START 0
115 #define VMALLOC_END 0xffffffff
117 #define arch_enter_lazy_mmu_mode() do {} while (0)
118 #define arch_leave_lazy_mmu_mode() do {} while (0)
119 #define arch_flush_lazy_mmu_mode() do {} while (0)
120 #define arch_enter_lazy_cpu_mode() do {} while (0)
121 #define arch_leave_lazy_cpu_mode() do {} while (0)
122 #define arch_flush_lazy_cpu_mode() do {} while (0)
124 #endif /* _ASM_UBICOM32_PGTABLE_H */