aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/mmu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/mmu.h')
-rw-r--r--include/asm-sh/mmu.h77
1 files changed, 63 insertions, 14 deletions
diff --git a/include/asm-sh/mmu.h b/include/asm-sh/mmu.h
index 72f07be6117f..cf47df79bb94 100644
--- a/include/asm-sh/mmu.h
+++ b/include/asm-sh/mmu.h
@@ -3,27 +3,76 @@
3 3
4#if !defined(CONFIG_MMU) 4#if !defined(CONFIG_MMU)
5 5
6struct mm_rblock_struct {
7 int size;
8 int refcount;
9 void *kblock;
10};
11
12struct mm_tblock_struct {
13 struct mm_rblock_struct *rblock;
14 struct mm_tblock_struct *next;
15};
16
17typedef struct { 6typedef struct {
18 struct mm_tblock_struct tblock; 7 struct vm_list_struct *vmlist;
19 unsigned long end_brk; 8 unsigned long end_brk;
20} mm_context_t; 9} mm_context_t;
21 10
22#else 11#else
23 12
24/* Default "unsigned long" context */ 13/* Default "unsigned long" context */
25typedef unsigned long mm_context_t; 14typedef unsigned long mm_context_id_t;
15
16typedef struct {
17 mm_context_id_t id;
18 void *vdso;
19} mm_context_t;
26 20
27#endif /* CONFIG_MMU */ 21#endif /* CONFIG_MMU */
28#endif /* __MMH_H */ 22
23/*
24 * Privileged Space Mapping Buffer (PMB) definitions
25 */
26#define PMB_PASCR 0xff000070
27#define PMB_IRMCR 0xff000078
28
29#define PMB_ADDR 0xf6100000
30#define PMB_DATA 0xf7100000
31#define PMB_ENTRY_MAX 16
32#define PMB_E_MASK 0x0000000f
33#define PMB_E_SHIFT 8
34
35#define PMB_SZ_16M 0x00000000
36#define PMB_SZ_64M 0x00000010
37#define PMB_SZ_128M 0x00000080
38#define PMB_SZ_512M 0x00000090
39#define PMB_SZ_MASK PMB_SZ_512M
40#define PMB_C 0x00000008
41#define PMB_WT 0x00000001
42#define PMB_UB 0x00000200
43#define PMB_V 0x00000100
44
45#define PMB_NO_ENTRY (-1)
46
47struct pmb_entry;
48
49struct pmb_entry {
50 unsigned long vpn;
51 unsigned long ppn;
52 unsigned long flags;
53
54 /*
55 * 0 .. NR_PMB_ENTRIES for specific entry selection, or
56 * PMB_NO_ENTRY to search for a free one
57 */
58 int entry;
59
60 struct pmb_entry *next;
61 /* Adjacent entry link for contiguous multi-entry mappings */
62 struct pmb_entry *link;
63};
64
65/* arch/sh/mm/pmb.c */
66int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
67 unsigned long flags, int *entry);
68int set_pmb_entry(struct pmb_entry *pmbe);
69void clear_pmb_entry(struct pmb_entry *pmbe);
70struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
71 unsigned long flags);
72void pmb_free(struct pmb_entry *pmbe);
73long pmb_remap(unsigned long virt, unsigned long phys,
74 unsigned long size, unsigned long flags);
75void pmb_unmap(unsigned long addr);
76
77#endif /* __MMU_H */
29 78