Full support for Ginger Console
[linux-ginger.git] / arch / sh / include / asm / mmu.h
blobf5963037c9d6804457b85b1247c8b09408d94d48
1 #ifndef __MMU_H
2 #define __MMU_H
4 /*
5 * Privileged Space Mapping Buffer (PMB) definitions
6 */
7 #define PMB_PASCR 0xff000070
8 #define PMB_IRMCR 0xff000078
10 #define PMB_ADDR 0xf6100000
11 #define PMB_DATA 0xf7100000
12 #define PMB_ENTRY_MAX 16
13 #define PMB_E_MASK 0x0000000f
14 #define PMB_E_SHIFT 8
16 #define PMB_SZ_16M 0x00000000
17 #define PMB_SZ_64M 0x00000010
18 #define PMB_SZ_128M 0x00000080
19 #define PMB_SZ_512M 0x00000090
20 #define PMB_SZ_MASK PMB_SZ_512M
21 #define PMB_C 0x00000008
22 #define PMB_WT 0x00000001
23 #define PMB_UB 0x00000200
24 #define PMB_V 0x00000100
26 #define PMB_NO_ENTRY (-1)
28 #ifndef __ASSEMBLY__
30 /* Default "unsigned long" context */
31 typedef unsigned long mm_context_id_t[NR_CPUS];
33 typedef struct {
34 #ifdef CONFIG_MMU
35 mm_context_id_t id;
36 void *vdso;
37 #else
38 unsigned long end_brk;
39 #endif
40 #ifdef CONFIG_BINFMT_ELF_FDPIC
41 unsigned long exec_fdpic_loadmap;
42 unsigned long interp_fdpic_loadmap;
43 #endif
44 } mm_context_t;
46 struct pmb_entry;
48 struct pmb_entry {
49 unsigned long vpn;
50 unsigned long ppn;
51 unsigned long flags;
54 * 0 .. NR_PMB_ENTRIES for specific entry selection, or
55 * PMB_NO_ENTRY to search for a free one
57 int entry;
59 struct pmb_entry *next;
60 /* Adjacent entry link for contiguous multi-entry mappings */
61 struct pmb_entry *link;
64 /* arch/sh/mm/pmb.c */
65 int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
66 unsigned long flags, int *entry);
67 int set_pmb_entry(struct pmb_entry *pmbe);
68 void clear_pmb_entry(struct pmb_entry *pmbe);
69 struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
70 unsigned long flags);
71 void pmb_free(struct pmb_entry *pmbe);
72 long pmb_remap(unsigned long virt, unsigned long phys,
73 unsigned long size, unsigned long flags);
74 void pmb_unmap(unsigned long addr);
75 #endif /* __ASSEMBLY__ */
77 #endif /* __MMU_H */